[eldritch] Fix B12X DCP global-topk MTP path - #37
Conversation
Keep the B12X DCP global top-k path rank-consistent through graph warmup and MTP draft execution. The target GLM path already allocated score buffers for B12X DCP top-k, but the MTP draft layer only allocated indices. With B12X sparse indexer global-topk enabled, the draft capture either failed or fell back to non-comparable slow paths. Allocate and pass top-k score buffers for MTP when DCP and B12X sparse indexer are active. Also keep empty DCP prefill chunks participating in the global-topk merge and prewarm the actual B12X merge/extend paths so rank-sensitive graph warmup enters the same collectives on every rank.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds DCP warmup synchronization and prewarm paths, a local-to-global top-k conversion path, B12X prefill/decode routing changes based on ChangesB12X DCP Top-K Routing, Warmup, and Buffer Wiring
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@vllm/model_executor/layers/sparse_attn_indexer.py`:
- Around line 430-448: The _sync_dcp_warmup function currently catches all
exceptions and silently returns, which masks barrier failures and prevents
proper error surfacing. Replace the broad except Exception clause with a more
specific exception handler that only catches the expected uninitialized DCP
group case (when get_dcp_group() is unavailable or raises an initialization
error), and allow barrier() failures and other runtime exceptions to propagate
up so they surface as real errors instead of being silently ignored.
In `@vllm/v1/attention/backends/mla/b12x_mla_sparse.py`:
- Around line 699-714: The memoization key in the _prewarm_extend_kernels_once
method is being added to _EXTEND_PREWARM_DONE before any kernel warmup succeeds,
and the key tuple does not include the max_batched parameter even though this
parameter controls the largest warmed row shape. Include max_batched as an
additional element in the key tuple construction alongside the other parameters
like q_head_dim, kv_lora_rank, and topk_tokens, and move the
_EXTEND_PREWARM_DONE.add(key) statement to execute only after the kernel warmup
has completed successfully to prevent skipping required prewarm work for failed
attempts or larger scheduler batches.
- Around line 683-697: The current exception handling in the _sync_dcp_warmup
method catches all exceptions including failures from the
get_dcp_group().barrier() call, which hides critical synchronization failures
when dcp_world_size > 1. Restructure the error handling to only catch exceptions
from the import statement itself (the get_dcp_group import), but allow any
exceptions raised by the barrier() call to propagate so that rank-consistency
contract failures are not silently swallowed. This ensures that synchronization
failures are properly surfaced rather than hidden.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3670bc94-24c2-4aa9-9c9e-36e3b023ea0a
📒 Files selected for processing (4)
vllm/model_executor/layers/sparse_attn_indexer.pyvllm/model_executor/models/deepseek_mtp.pyvllm/v1/attention/backends/mla/b12x_mla_sparse.pyvllm/v1/attention/backends/mla/indexer.py
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 3 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 2 file(s) based on 3 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Summary
Port the validated GLM-5.2 B12X DCP global-topk/MTP fix onto
dev/eldritch-enlightenment.This is the eldritch-targeted equivalent of the already validated dark-devotion PR #31. It keeps the B12X DCP global-topk path rank-consistent during warmup and makes the MTP draft path provide the same top-k score buffer that the target path expects.
Changes
-infscores and mask invalid results back to-1.plan.bind(scratch=...).topk_scores_bufferfrom the MTP draft layer under DCP + B12X sparse indexer.Notes
This keeps the vLLM B12X binding rule: no cached vLLM workspace/arena ownership; plans bind caller scratch per call.
Validation
git diff --check lil/dev/eldritch-enlightenment..HEADpython3 -m py_compileon changed Python filesRuntime validation will be done in the composed eldritch Docker stack.
Summary by CodeRabbit