Repository navigation
Route custom process groups through GDP and latent MoE checkpoints - #6781
Conversation
Signed-off-by: ykarnati <ykarnati@nvidia.com>
| {"weight": 0}, | ||
| sharded_offsets, | ||
| tp_group=self.tp_group, | ||
| dp_cp_group=metadata["dp_cp_group"], |
There was a problem hiding this comment.
Why do we not just use dp_cp_group directly?
There was a problem hiding this comment.
This is just following the existing convention as other layers like Mamba, moe, TE linear layers. I think the above helper function is added ensure_metadata_has_dp_cp_group , so if hte group does not exist, it falls back to paralel state for backward compatibility
| ), "Must have at least TE version 2.3 or higher to use symmetric memory all reduce" | ||
| extra_kwargs["symmetric_ar_type"] = symmetric_ar_type | ||
| if parallel_mode == "duplicated": | ||
| assert tp_group is None, "duplicated linear should not have tp_group set" |
There was a problem hiding this comment.
the bottom line: we don't require tp_group for duplicated mode,
pls try to figure out a better fix if possible
Signed-off-by: ykarnati <ykarnati@nvidia.com>
Signed-off-by: ykarnati <ykarnati@nvidia.com>
f634f32 to
0e3b1fa
Compare
|
/claude review |
|
Light review — two points, both minor. The core change looks right: routing |
| tensor, | ||
| layer_key, | ||
| tp_axis=tp_axis if tp_axis is not None else 0, | ||
| replica_id=None if tp_axis is not None else (0, tp_rank, dp_replica_rank), |
There was a problem hiding this comment.
Thanks for fixing this!
That's real bug after supporting --gtp-remat-opt-in-modules moe_latent_proj 2 weeks ago where the latent weights are DUPLICATED across TP group while are SHARDED across GTP groups!
Signed-off-by: ykarnati <ykarnati@nvidia.com>
0e3b1fa to
1633cb5
Compare
|
/ok to test 1633cb5 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/32672610316 |
…VIDIA#6781) Signed-off-by: ykarnati <ykarnati@nvidia.com>
…VIDIA#6781) Signed-off-by: ykarnati <ykarnati@nvidia.com> (cherry picked from commit 2dc1b2b)
…VIDIA#6781) Signed-off-by: ykarnati <ykarnati@nvidia.com> (cherry picked from commit 2dc1b2b)
…VIDIA#6781) Signed-off-by: ykarnati <ykarnati@nvidia.com>
…VIDIA#6781) Signed-off-by: ykarnati <ykarnati@nvidia.com> (cherry picked from commit 2dc1b2b)
…VIDIA#6781) Signed-off-by: ykarnati <ykarnati@nvidia.com> (cherry picked from commit 2dc1b2b)
…VIDIA#6781) Signed-off-by: ykarnati <ykarnati@nvidia.com> (cherry picked from commit 2dc1b2b) Signed-off-by: xuwenc <xuwenc@nvidia.com>
What does this PR do?
Route explicit model-parallel process groups through GDP and latent-MoE distributed-checkpoint metadata without changing duplicated TELinear execution semantics.
MIMO models can own process groups that differ from the globally initialized MPU topology. This change:
TELinearonly for checkpoint metadata, while Transformer Engine still receivestp_group=None,tp_size=1, andparallel_mode=None;in_projcheckpoint split and resharding path.This is intentionally separate from LayerWise optimizer changes, MTP, optimizer policy, recipes, and padding-only checkpoint work.
Issue tracking
Linked issue: N/A
Contribution process
Pre-checks
Validation:
CHECK_ONLY=true uv run --no-sync bash tools/autoformat.sh(Black, isort, Pylint 10.00/10, and Ruff passed; mypy was unavailable and is non-blocking in the script)python3 -m compileall -qon all six changed Python files16387980: 1 H100; locked test environment preflight passed with PyTorch 2.13 nv26.06, Transformer Engine 2.16, pytest 9.1.1, and pytest-mock16388633: 1 node, 8 H100s, 8 ranks, current26.06-py3development image; all ranks passed the 6 focused GDP custom-group/TP-reshard, latent-MoE construction, and duplicated-TELinear execution/checkpoint tests