Repository navigation
[Kimi-K3] Keep the latent-MoE tail fusion under sleep mode - #66273
Merged
Merged
Conversation
vllm-project#64583 turned the tail fusion off under sleep mode because level 2 used to discard its non-parameter state: the Lamport flags and peer pointers of the collective kernel live in the weights pool. Since vllm-project#66010, level 2 restores every allocation that does not hold only parameters, so that state survives and the fallback (and its warning) can go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ao Shen <aoshen524@gmail.com> Signed-off-by: aoshen02 <aoshen02@users.noreply.github.com>
aoshen02
requested review from
AndreasKaratzas,
DarkLight1337 and
ywang96
as code owners
November 7, 2026 13:01
Contributor
Author
|
/ci run |
ZJY0516
approved these changes
Nov 7, 2026
aoshen02
enabled auto-merge (squash)
November 7, 2026 13:10
|
✅ Triggered Buildkite CI #100772 for commit |
6 tasks done
yeshihai
pushed a commit
to yeshihai/vllm
that referenced
this pull request
Nov 8, 2026
…ect#66273) Signed-off-by: aoshen02 <aoshen02@users.noreply.github.com> Co-authored-by: Ao Shen <aoshen524@gmail.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
#64583 turned off the Kimi-K3 latent-MoE tail fusion whenever sleep mode is on, and logged a warning. At the time, level-2 sleep discarded the whole
weightspool. The fusion's collective kernel keeps its state in that pool: the Lamport flags (_routed_flags,_shared_flags) and the peer pointer table. None of these are parameters, so they were lost on wake.Since #66010, level 2 discards only allocations that hold nothing but parameters, and offloads and restores everything else at the same address. That state now survives sleep, so this PR removes the fallback and its warning. The tail fusion now runs with sleep mode on, at TP 8 and 16 on SM100.
latent_moe_runner.py: delete the sleep-mode fallback (11 lines).test_latent_moe_tail.py: deletetest_sleep_mode_falls_back_to_default_pathand theenable_sleep_modeparameter that only it used.Test Plan
Kimi-K3 at TP 8 across two GB200 nodes (multi-node NVLink), with dummy weights and 4 layers (
hf_overrides), CUDA graphs on,enable_sleep_mode=Trueandsleep_preserve_parameter_names=["*"]. Keeping every parameter means that any difference after wake comes from non-parameter state.The run checks each rank's
LatentMoERunners throughcollective_rpc, then generates greedily for 16 prompts and 48 tokens:sleep(1)+wake_up();sleep(2)+wake_up(["weights"])+wake_up(["kv_cache"])cycles.Each output is compared with the first, token for token.
Negative control: the same run, but after the first level-2 wake the collective kernel's Lamport flags are zeroed. This emulates what the old level 2 did to them.
tests/models/kimi_k3/test_latent_moe_tail.pyalso runs on GB200.Test Result
RPC call to sample_tokens timed outThe control shows that the test catches lost tail-fusion state. Without #66010 (main at 2ced9ce with the same fallback removed), the same run crashes at the first level-2 wake with
cudaErrorIllegalAddress, even though the fusion was not confirmed to be on there.test_latent_moe_tail.py: 1 passed, 3 skipped (the skipped kernel tests need more GPUs).Not covered: real Kimi-K3 weights and GSM8K (no checkpoint available here), TP 16, and level 2 with a real weight update. In that path, parameters are discarded and rewritten. That is the generic #66010 path, which this PR doesn't change.
Pull Request Checklist
🤖 Generated with Claude Code