Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zjy0516 <riverclouds.zhu@qq.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e22519ef62
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mamba_block_size = vllm_config.cache_config.mamba_block_size | ||
| assert mamba_block_size is not None | ||
| page_size_padded = vllm_config.cache_config.mamba_page_size_padded | ||
| checkpoint_alignment = self.get_prefill_checkpoint_alignment() |
There was a problem hiding this comment.
Preserve the fallback for duck-typed spec callers
When test_replayssm_does_not_reserve_speculative_state_blocks runs, it calls MambaBase.get_kv_cache_spec unbound on the SimpleNamespace constructed in tests/v1/attention/test_attention_backends_selection.py:32-48; that object has no get_prefill_checkpoint_alignment, so this unconditional dynamic call raises AttributeError before either parameterized case reaches its assertions. Add the default hook to that fixture or otherwise retain a safe default for this existing caller.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dhb2S8VUrZXrPS93htTJZz Signed-off-by: zjy0516 <riverclouds.zhu@qq.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zjy0516 <riverclouds.zhu@qq.com>
…duler Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zjy0516 <riverclouds.zhu@qq.com>
|
/ci run --allow-stale |
|
✅ Triggered Buildkite CI #97930 for commit
|
|
This pull request has merge conflicts that must be resolved before it can be |
Overview
Each Mamba layer declares the token alignment of the prefill checkpoints it can export from inside a forward pass once, in
MambaBase.get_prefill_checkpoint_alignment().MambaBase.get_kv_cache_specderivesnum_prefill_checkpoint_blocksandprefill_checkpoint_alignmentfrom it. Mamba2 (#57329), GLM-5.3-Flash KDA (#56960) and Kimi-K3 KDA (NVIDIA and AMD) drop theirget_kv_cache_specoverrides. Split out of #60050.Claims
1, FlashKDA16, ROCm fused KDAKDA_CHECKPOINT_ALIGNMENT. Mamba layers that declare none still get no checkpoint fields.replace(spec, num_prefill_checkpoint_blocks=..., prefill_checkpoint_alignment=...)override become one, so the two fields can no longer disagree. A checkpoint block reserved without an alignment would cache a state that is never written.16). ROCm fused KDA blocks become multiples ofKDA_CHECKPOINT_ALIGNMENT, so its checkpoints are no longer declined off-grid.Validation
Tests (after merging main, 1x GB200 node):
tests/v1/attention/test_mamba2_prefill_checkpoints.py,tests/v1/attention/test_gdn_metadata_builder.py,tests/models/kimi_k3/test_kda_metadata.py,tests/models/kimi_k3/test_amd_kda_checkpoint.py,tests/models/qwen4_exp/test_ple.py233 passed, 29 skippedtests/kernels/mamba/test_mamba2_checkpoint_state.py8 passedtests/kernels/mamba/test_mamba_mixer2.py3 passedtests/models/kimi_k3/test_kda.py,tests/models/glm5next/test_kda_recurrent.py123 passed, 7 skippedtests/v1/core/test_mamba_align_chunk_split.py48 passedtests/v1/core/test_prefix_caching.py -k "mamba or Mamba"30 passedtests/v1/e2e/general/test_mamba_prefix_cache.py(mrv1, mrv1_async, mrv2, mrv2_async, mrv2_async_flashinfer)5 passedtests/models/language/generation/test_hybrid.py -k apc7 passedtest_layer_checkpoint_alignment_reaches_the_kv_cache_specchecks that a declared alignment, or none, reaches the spec together with its checkpoint block.test_amd_kda_checkpoint.pyneeds a gfx950 build with the fused KDA chunk kernel, so it is skipped here. Its_spec_forhelper now runs the layer's realget_kv_cache_specover stubbed state shapes instead of stubbing the base spec, which would bypass the derivation.GSM8K (
tests/evals/gsm8k/gsm8k_eval.py, 20-shot, 1319 questions,--enable-prefix-caching, 1x GB200), so prompts take and resume from internal checkpoints:Details
get_prefill_checkpoint_alignment()returnsNoneby default. Readers act on it only in align mode, as before.get_prefill_checkpoint_alignmentand the rule that the scheduler takes internal checkpoints only when every Mamba layer declares an alignment. Its FlashInfer GDN layer and Qwen4-Exp's PLE overrideget_kv_cache_specto put their offsets on the prefix-cache grid. Both return the base spec unchanged when another layer cannot checkpoint.MambaBase.get_kv_cache_spectherefore applies that rule itself: it fills the checkpoint fields only when every Mamba layer declares an alignment. Otherwise those layers would inherit a checkpoint block that is never written.test_no_checkpoint_block_unless_every_mamba_layer_declares_onecovers this.get_kv_cache_specto__init__.kv_cache_interface.py, which this PR does not touch.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
🤖 Generated with Claude Code