[Bugfix] Fix DeepSeek V4 mHC broadcast buffer for weight sync - #52626
Merged
Merged
Conversation
HollowMan6
requested review from
AndreasKaratzas,
WoosukKwon,
mgoin,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
August 17, 2026 13:50
Collaborator
|
/ci run |
Contributor
|
Hi @HollowMan6, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
|
✅ No earlier CI build exists for this PR. Use |
Fix Stale broadcast weights after refit. finalize_mhc_broadcast_weights() rebound layer.hc_attn_fn_broadcast to a freshly-allocated tensor on every call. CUDA graphs captured against the original tensor's address keep replaying with the old pointer, so a weight refit (repeat load_weights() after capture, e.g. RL weight sync) left captured graphs reading stale broadcast weights. Fixed by allocating only when the buffer is None and otherwise copy_()-ing in place, keeping the address stable. Signed-off-by: Hollow Man <hollowman@opensuse.org>
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #84213 for commit |
4 tasks
jeejeelee
approved these changes
Aug 18, 2026
8 tasks
zufangzhu
pushed a commit
to zufangzhu/vllm
that referenced
this pull request
Aug 24, 2026
…roject#52626) Signed-off-by: Hollow Man <hollowman@opensuse.org> Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
garrett361
added a commit
to PrimeIntellect-ai/prime-rl
that referenced
this pull request
Sep 17, 2026
Points the wheel-URL source at the v0.29.0 release, raises the gpu extra floor to match, and drops the vllm exclude-newer exception as its comment intended. 0.29.0 carries vllm-project/vllm#52626, which makes finalize_mhc_broadcast_weights update hc_attn_fn_broadcast in place on a weight reload instead of rebinding it, so captured CUDA graphs stop reading a freed pointer. That was worth 0.159 to 0.0225 on DeepSeek V4's production mismatch KL. Lock churn: flashinfer-python 0.6.16.post3 -> 0.6.18, new vLLM dependency instanttensor 0.1.9. vLLM 0.29.0 still pins quack-kernels 0.6.4 and nvidia-cutlass-dsl 4.6.2, so the overrides stand. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
garrett361
added a commit
to PrimeIntellect-ai/prime-rl
that referenced
this pull request
Sep 21, 2026
Points the wheel-URL source at the v0.29.0 release, raises the gpu extra floor to match, and drops the vllm exclude-newer exception as its comment intended. 0.29.0 carries vllm-project/vllm#52626, which makes finalize_mhc_broadcast_weights update hc_attn_fn_broadcast in place on a weight reload instead of rebinding it, so captured CUDA graphs stop reading a freed pointer. That was worth 0.159 to 0.0225 on DeepSeek V4's production mismatch KL. Lock churn: flashinfer-python 0.6.16.post3 -> 0.6.18, new vLLM dependency instanttensor 0.1.9. vLLM 0.29.0 still pins quack-kernels 0.6.4 and nvidia-cutlass-dsl 4.6.2, so the overrides stand. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Purpose
Fix Stale broadcast weights after refit. finalize_mhc_broadcast_weights() rebound layer.hc_attn_fn_broadcast to a freshly-allocated tensor on every call. CUDA graphs captured against the original tensor's address keep replaying with the old pointer, so a weight refit (repeat load_weights() after capture, e.g. RL weight sync) left captured graphs reading stale broadcast weights. Fixed by allocating only when the buffer is None and otherwise copy_()-ing in place, keeping the address stable.
Test Plan
Two unit tests added to tests/kernels/test_mhc_kernels.py:
pytest tests/kernels/test_mhc_kernels.py -k mhc_broadcast -v
pytest tests/kernels/test_mhc_kernels.py -k "hc_head_tilelang or mhc_broadcast"
End to end tests on verl side with DSV4 training
Test Result
torch.set_default_device to CUDA earlier in the file): 10 passed.
fails on the buffer-identity assertion and the sums test still passes — the
pair pins both the pre-existing semantics and the new in-place contract.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.