Specialize batch prefill for paged KV layout - #4388
Draft
rlrs wants to merge 1 commit into
Draft
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Rasmus Larsen <rasmus.larsen@alexandra.dk>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
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.
What this changes
Specialize the JIT batch-prefill build for the page size, KV memory layout, and
page-table layout used by the call. It also adds 2048-token pages to the batch
prefill tests and command-line test runner.
This lets vLLM send a shuffled paged KV cache directly to CK batch prefill
instead of gathering a long prefix into a temporary contiguous buffer.
The signature order is aligned with the registered operator schema so the
generated module and its fake implementation expose the same optional
arguments.
This draft depends on ROCm/composable_kernel#3760. I will update AITER's CK
submodule after that change is available on a compatible CK revision.
Results
MI250X, BF16 MQA, four query heads, one KV head, head dimension 128:
The isolated 2048-page correctness run covered both contiguous and strided
caches:
I also ran an end-to-end 128K TP8 serving test with NVIDIA Nemotron 3 Super.
All requests completed successfully, including a 40K prompt that exercises a
paged continuation.
The open-PR search did not find another batch-prefill change for 2048-token
pages.
The change was prepared with AI assistance and reviewed and tested by the
submitter.