[feat] Support fine-grained activation offloading in fused group mlp - #5082
Conversation
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
5606996 to
950455b
Compare
|
/ok to test 950455b |
950455b to
577bb49
Compare
|
/ok to test 577bb49 |
cd146b8 to
ebf631c
Compare
|
/ok to test ebf631c |
Signed-off-by: hongbinl <hongbinl@nvidia.com>
|
/ok to test 2d6f25f |
Signed-off-by: hongbinl <hongbinl@nvidia.com>
|
/ok to test 8014953 |
Signed-off-by: hongbinl <hongbinl@nvidia.com>
|
/ok to test b389f3e |
|
/claude review |
|
@lhb8125 It seems a bug: Mcore's side fine-grained offloading modules ( |
Confirmed, while the TE side corresponding MR is already merged, draft a quick fix, please help review: NVIDIA/TransformerEngine#3128 |
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
|
/ok to test c6dd285 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/27660487406 |
Summary
This PR updates fine-grained activation offloading for the Transformer Engine fused grouped MLP path after the TE-side selective offload API was reverted. Instead of relying on per-op TE activation-offload opt-out markers, Megatron now exposes a separate offload module,
fused_group_mlp, that offloads the whole fused grouped MLP as one group.Changes:
fused_group_mlptoTransformerConfig.offload_modules.use_transformer_engine_op_fuser=Truewhenfused_group_mlpis selected.fused_group_mlpwith partial MoE offload modules (expert_fc1/moe_act).fused_group_mlp.expert_fc1/moe_actselective offload on the unfused grouped MLP path only.fused_group_mlplike other dynamic MoE activation offload groups by disabling the CPU tensor pool for it.Parameter, fake/functional tensors, and non-CUDA tensors), while still respecting_TE_do_not_offloadandoffloading_activation=False.Testing
git diff --checkpython3.12 -m py_compile megatron/core/pipeline_parallel/fine_grained_activation_offload.py megatron/core/transformer/moe/experts.py megatron/core/transformer/transformer_config.py tests/unit_tests/pipeline_parallel/test_fine_grained_activation_offloading.pyPATH=.venv/bin:$PATH CHECK_ONLY=true BASE_REF=main bash tools/autoformat.shSigned-off-by: hongbinl <hongbinl@nvidia.com>Notes: