Repository navigation
Perf page - #1696
Merged
Merged
Perf page#1696
Conversation
Give each request one of three token-index modes and let the allocator speak only in tokens, so page compression stays internal and the original free and match flow remains intact. Co-authored-by: Cursor <cursoragent@cursor.com>
Host input packing, the FlashMLA test harness, and the calibration blob are separate from token-level page indexes. Restore the tests that still match the page-size behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
The fused kernel was separate from paged allocation. Forward again selects indexes from the request table and gathers token ids on its own, while page indexes stay on the token-level API. Co-authored-by: Cursor <cursoragent@cursor.com>
ReqManager only owns request slots and the token table. Page-aligned allocation and release now go through the attention allocator and each request's token index. Co-authored-by: Cursor <cursoragent@cursor.com>
The allocator already supplies one reserved page. bind_hold_page only needs to tile that page across the padding request row. Co-authored-by: Cursor <cursoragent@cursor.com>
The return buffer is only needed when handing back token indexes, so it no longer starts as an empty placeholder. Co-authored-by: Cursor <cursoragent@cursor.com>
Request rows are written by the token-index modes, so the packed page-start publish kernel has no callers. Co-authored-by: Cursor <cursoragent@cursor.com>
Padded decode writes token id 1 directly into input_ids, so the HOLD row of req_to_next_token_ids is never read. Co-authored-by: Cursor <cursoragent@cursor.com>
Match the master/slave flow that waits for the in-flight prefill read, frees deduped pages through the token-index view, and keeps the page tail across reset. Co-authored-by: Cursor <cursoragent@cursor.com>
Each accepted request reserves its own pages, and pending token indexes are copied with one stream-ordered H2D batch. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the optional finish mark consistent with the getattr read that treats a missing attribute as false. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the index reset after free snapshots are captured, and write matched prefixes in place instead of through a shared helper. Co-authored-by: Cursor <cursoragent@cursor.com>
Read the matched GPU prefix with get_gpu_token_indexes so the upload is ordered with the load stream, and drop the early upload in add_reqs. Co-authored-by: Cursor <cursoragent@cursor.com>
Recovered requests wait for the next scheduling round, which uploads their indexes before inference. Co-authored-by: Cursor <cursoragent@cursor.com>
Export prompt logprobs and routed experts from the CPU index snapshot, and load a CPU-cache page from one GPU index span after allocation. Co-authored-by: Cursor <cursoragent@cursor.com>
Build prefill and decode metadata with one NumPy conversion and write prompt ids into pinned memory, matching the wzj_demo input path. Co-authored-by: Cursor <cursoragent@cursor.com>
hiworldwzj
force-pushed
the
perf_page
branch
from
November 10, 2026 09:20
a25656f to
316b40a
Compare
The prefix rewrite and its later synchronize already run on the current stream, so the overlap wait belongs there too. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.