Repository navigation
Conversation
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit 707968a)
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit cbd4138)
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit bda8858)
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit 2aa1570)
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit 4aece4b)
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit 1292dbe)
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit 56e27a8)
Signed-off-by: seonjinn <[email protected]> (cherry picked from commit 0c33c30)
…e-refit-pr-20260807 Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
…e-refit-pr-20260807 Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
…e-refit-pr-20260807
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test 9d5a10a |
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test 2844542 |
Contributor
Author
|
Self-review completed against the latest
No unresolved correctness findings remain in the NCCL reshard extension. The PR remains draft because it includes and depends on #3545. |
Contributor
Author
|
Latest-main end-to-end validation completed at
This verifies the implementation on the current |
Signed-off-by: seonjinn <[email protected]>
sharonyu-115
requested changes
Sep 6, 2026
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test eb7529f |
Signed-off-by: seonjinn <[email protected]>
…erify-20260906 Signed-off-by: seonjinn <[email protected]> # Conflicts: # tests/test_suites/disabled.txt
Signed-off-by: seonjinn <[email protected]>
Contributor
|
/ok to test 014a305 |
sharonyu-115
previously approved these changes
Sep 7, 2026
terrykong
enabled auto-merge (squash)
September 9, 2026 05:44
Contributor
Author
|
/ok to test fecc707 |
…0815 Signed-off-by: seonjinn <[email protected]> # Conflicts: # nemo_rl/models/generation/vllm/vllm_backend.py
Contributor
Author
|
/ok to test cecdaf8 |
Contributor
Author
|
/ok to test 8bb95b3 |
Contributor
Author
|
/ok to test 7126eed |
terrykong
approved these changes
Sep 9, 2026
asolergi-nv
added a commit
that referenced
this pull request
Sep 10, 2026
Nine commits, no conflicts. Four of them touch files this PR owns (vllm_generation.py, single_controller_utils/config.py and setup.py, generation/__init__.py), so the clean merge was checked rather than trusted -- the previous sync merged clean and still broke L0_Unit_Tests_Vllm_2/_3 on a fake that no longer matched the dispatch. Checked specifically: - #3659 (BF16 TRTLLM NCCL reshard refit) adds 421 lines to test_vllm_backend.py, the file 6cb495c just fixed. It introduces no new worker-group fake calling run_all_workers_single_data, and prepare_refit_info itself is untouched. The per-leader dispatch assertions still hold against the merged implementation, re-run for both parametrisations. - Every artefact this PR adds is still present: _refit_participants, record_weight_version, _restart_off_loop, should_rebuild, shard_liveness_ref, restart_timeout_s, and the ray.sub export. - Submodule pins match main on all three. 1349 tests pass across single_controller, fleet_health, weight_sync, the gym utils and the refit signature checks. pyrefly clean apart from the pre-existing optional transfer_queue import. Signed-off-by: asolergibert <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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 PR does
Makes weight refit work for BF16 MoE models running on the FlashInfer TRTLLM backend when using
refit_transport=nccl_reshard.Without this fix, a refit silently corrupts the MoE expert weights and the model generates garbage. With this fix, expert weights load correctly, and any configuration we cannot handle is rejected with a clear error instead of corrupting anything.
#3545 already fixed this for the
ipcandcollectivetransports. This PR extends the fix tonccl_reshard, which needs a different approach.The problem in one picture
nccl_reshardstreams every received tensor directly into vLLM's live parameter buffers. That is fast, and it is correct as long as the buffer stores the weight in the same layout as the checkpoint.The FlashInfer TRTLLM MoE backend breaks that assumption: at model load time, vLLM repacks the grouped expert weights (
gate/up/downprojections) into a private layout its kernels need. Streaming checkpoint-layout bytes into a repacked buffer writes the right numbers into the wrong places — no error, just a corrupted model.Why we can't just reuse the #3545 fix
#3545 fixes
ipc/collectiveby reloading the whole model through vLLM's normal weight loader (which knows how to repack). Butnccl_reshardreceives most weights directly into live buffers. A whole-model reload would reset all buffers back to checkpoint layout — including the dense/attention buffers that direct receive depends on and that were never broken. The fix must be surgical: touch only the expert weights.How the fix works
Split the weights into two groups and treat them differently:
For the expert weights, concretely:
[num_experts, ...]weight.experts.<expert_start + local_idx>.<proj>.weight). vLLM repacks it exactly like it does at model load.finalize()at the end rebuilds the kernel layout.When we refuse to refit (on purpose)
Two layouts cannot be mapped to "one named load per expert", so we reject them loudly at setup instead of guessing:
ValueErrorwhen the refit map is built.expert_placement_strategy != "linear", e.g. round-robin) →RuntimeError, because "global expert ID =expert_start + local_idx" would be wrong.And if anything fails after the expert buffers have been invalidated mid-refit, the worker is marked permanently unusable rather than serving a half-updated model.
What is NOT affected
Everything else is untouched: other MoE backends, other transports, quantized (FP8/MXFP8) paths, dense models.
vLLM version compatibility
The backend detection touches three vLLM internals, verified byte-identical at v0.25.1 (our current pin) and v0.28.0:
UnquantizedMoeBackend.FLASHINFER_TRTLLM,UnquantizedFusedMoEMethod.unquantized_backend, andExpertMapManager.placement_strategy. If a future vLLM moves them, the guarded imports degrade to "backend not detected" and the placement check raises — there is no silent-corruption path.How it was validated
Policy generation refit completed successfully,moe_backend=flashinfer_trtllm.pre-commitpasses.Dependency
#3545 has merged and this branch is synced with latest
main, so the diff here is only thenccl_reshardextension.