Repository navigation
feat: NCCL-Xfer refit merge PR - #2808
Closed
youngeunkwon0405 wants to merge 7 commits into
Closed
youngeunkwon0405 wants to merge 7 commits into
youngeunkwon0405 wants to merge 7 commits into
Conversation
Contributor
Author
|
/okay to test 374c26e |
youngeunkwon0405
force-pushed
the
youngeunk/new-refit-merge
branch
from
June 15, 2026 05:17
374c26e to
bda6edf
Compare
Contributor
Author
|
/okay to test bda6edf |
youngeunkwon0405
force-pushed
the
youngeunk/new-refit-merge
branch
from
June 15, 2026 05:21
bda6edf to
f800a11
Compare
Contributor
Author
|
/okay to test f800a11 |
Contributor
Author
|
/okay to test 977bfe4 |
youngeunkwon0405
force-pushed
the
youngeunk/new-refit-merge
branch
from
June 15, 2026 20:11
977bfe4 to
d90bf0c
Compare
Contributor
Author
|
/okay to test d90bf0c |
youngeunkwon0405
force-pushed
the
youngeunk/new-refit-merge
branch
from
June 15, 2026 20:43
d90bf0c to
977bfe4
Compare
When the model ties embeddings (share_embeddings_and_output_weights / tie_word_embeddings, e.g. Qwen3-0.6B/1.7B), Bridge's export still materializes lm_head.weight (reconstructed from embed_tokens), so it landed in the nccl-xfer transfer list -- but no rank owns a standalone lm_head tensor (task.param_weight is None), so nccl_xfer_refit asserted "no local tensor for 'lm_head.weight'". Skip lm_head.weight from the nccl-xfer metadata when the tie flag is set. The gen backend has no standalone lm_head param either -- it reads logits from the tied embed_tokens, which IS transferred -- so the shared refit_info stays consistent across train+gen. Keyed on the tie flag (NOT on per-rank local ownership) so it is a strict no-op for non-tied models, whose lm_head is a real param transferred from the last PP stage (an ownership-based filter would have wrongly dropped non-rank-0 EP/PP params). Found by tests/functional/grpo_nccl_xfer_refit.sh (Qwen3-0.6B, tied). Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Youngeun Kwon <[email protected]>
Contributor
Author
|
/okay to test 989d3c7 |
Signed-off-by: Youngeun Kwon <[email protected]>
Signed-off-by: Youngeun Kwon <[email protected]>
Introduce a backend-agnostic per-param refit interface in nccl_xfer_utils:
- RefitCtx pre->post handoff; the loop reads only .buf, .extra carries
backend-specific state (e.g. gen merged params' region)
- LocalParamSpec base/pre/post recipe for transferring one HF param
- HFToLocalParamMap hf_name -> LocalParamSpec container (.get + coverage assert)
- RefitBuilderInterface structural Protocol both backends satisfy
Both the Megatron train (src) and vLLM gen (dst) backends now expose
build_hf_to_local_param_map(refit_info) -> HFToLocalParamMap, and their
nccl_xfer_refit loops share one shape: get -> pre -> xferdtensor -> post.
The train side folds the former _param_map/_expert_groups into build-time
locals, so hf_to_local_param_map is the single persistent param structure
(mirroring the gen side). xferdtensor.py and the policy/generation ABC
interfaces are untouched.
Behavior-preserving: full golden CI reproduces baseline KL with no errors --
BF16 L0 (DP/TP/PP/EP-experts/CP), FP8 L0, and L1 (235B, DSv3).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Youngeun Kwon <[email protected]>
Unit coverage for the LocalParamSpec / HFToLocalParamMap / RefitBuilderInterface
refactor:
- test_nccl_xfer_utils (CPU): RefitCtx & LocalParamSpec defaults,
HFToLocalParamMap.get (hit/miss/default), RefitBuilderInterface structural
isinstance (conforms by having build_hf_to_local_param_map; no inheritance).
- test_nccl_xfer_backend (vLLM): build_hf_to_local_param_map -> direct/merged/
grouped LocalParamSpecs + a pre/post buffer round-trip (fill recv buffer,
post, verify it scattered into the live qkv/w13 region); extension conforms
to RefitBuilderInterface.
- test_group_experts (mcore): train-side build_hf_to_local_param_map folds this
rank's local shards into specs; grouped-expert pre stacks per-expert views
into [E_local, ...].
Validated in-container: CPU 34 passed, vLLM 8 passed, mcore 5 passed.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Youngeun Kwon <[email protected]>
Contributor
Author
|
/okay to test 53d6a84 |
4 tasks
This branch was previously deployed
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 does this PR do ?
Add a one line overview of what this PR aims to accomplish.
Current test results
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information