Repository navigation
Conversation
This was referenced May 22, 2026
Connor-XY
force-pushed
the
mhc-pr2-gpt-wiring
branch
from
June 12, 2026 17:42
7fdbed4 to
b26c6fd
Compare
Connor-XY
added a commit
to Connor-XY/Megatron-LM
that referenced
this pull request
Jun 12, 2026
Third split of NVIDIA#3430 (mirror of upstream NVIDIA#2943). Extends the pipeline-parallel schedules so they handle the n-stream hidden-state shape used by mHC across PP boundaries, and adds the corresponding unit tests. Files: - megatron/core/pipeline_parallel/schedules.py: n-stream-aware tensor-shape computation in `get_tensor_shapes`, and the matching expand/contract handling at first/last PP stages. - tests/unit_tests/pipeline_parallel/test_pp_mhc_compatibility.py: coverage for `get_tensor_shapes`, `get_num_layers_to_build`, VPP edge cases, PP boundary shape consistency, and standalone embedding/loss layers under mHC. Depends on NVIDIA#4531 (Split 1) for the core mHC module symbols, and on NVIDIA#4945 (Split 2) for the spec-side `enable_hyper_connection` wiring used by the forward tests. Reviewer groups touched: core-adlr, core-nemo, pipeline-parallelism. Subsequent splits still pending: - Split 4: fused mHC cuTile kernels - Split 5: functional-test recipe Original work by @jingqiny-99 in NVIDIA#3430 (upstream NVIDIA#2943). Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com>
Connor-XY
added a commit
to Connor-XY/Megatron-LM
that referenced
this pull request
Jun 12, 2026
Final split of NVIDIA#3430 (mirror of upstream NVIDIA#2943 + kernel-fusion NVIDIA#3828). Adds the end-to-end functional test for the mHC feature: Files: - tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp2_pp2_mhc/ model_config.yaml — TP=2, PP=2 GPT-3 mHC training recipe golden_values_dev_dgx_h100.json — golden metrics on dgx_h100 - tests/test_utils/recipes/h100/gpt.yaml — registers the new test case under the mr / mr-github scopes for dgx_h100. Golden values picked up from NVIDIA#4469 (dsv4 branch) where the recipe has been calibrated against the final fused-kernel-on configuration. Reviewers can recalibrate if needed once Splits 1-4 land. Depends on NVIDIA#4531 (Split 1), NVIDIA#4945 (Split 2), and NVIDIA#4947 (Split 4) — the recipe enables enable_hyper_connections via the GPT spec and exercises the fused kernel path, so all three feature splits must land first. Reviewer groups touched: ci. Original work by @jingqiny-99 in NVIDIA#3430 (upstream NVIDIA#2943). Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com>
Connor-XY
force-pushed
the
mhc-pr2-gpt-wiring
branch
from
June 12, 2026 17:48
b26c6fd to
e1a40d6
Compare
Connor-XY
added a commit
to Connor-XY/Megatron-LM
that referenced
this pull request
Jun 12, 2026
Third split of NVIDIA#3430 (mirror of upstream NVIDIA#2943). Extends the pipeline-parallel schedules so they handle the n-stream hidden-state shape used by mHC across PP boundaries, and adds the corresponding unit tests. Files: - megatron/core/pipeline_parallel/schedules.py: n-stream-aware tensor-shape computation in `get_tensor_shapes`, and the matching expand/contract handling at first/last PP stages. - tests/unit_tests/pipeline_parallel/test_pp_mhc_compatibility.py: coverage for `get_tensor_shapes`, `get_num_layers_to_build`, VPP edge cases, PP boundary shape consistency, and standalone embedding/loss layers under mHC. Depends on NVIDIA#4531 (Split 1) for the core mHC module symbols, and on NVIDIA#4945 (Split 2) for the spec-side `enable_hyper_connection` wiring used by the forward tests. Reviewer groups touched: core-adlr, core-nemo, pipeline-parallelism. Subsequent splits still pending: - Split 4: fused mHC cuTile kernels - Split 5: functional-test recipe Original work by @jingqiny-99 in NVIDIA#3430 (upstream NVIDIA#2943). Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Connor-XY
added a commit
to Connor-XY/Megatron-LM
that referenced
this pull request
Jun 12, 2026
Final split of NVIDIA#3430 (mirror of upstream NVIDIA#2943 + kernel-fusion NVIDIA#3828). Adds the end-to-end functional test for the mHC feature: Files: - tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp2_pp2_mhc/ model_config.yaml — TP=2, PP=2 GPT-3 mHC training recipe golden_values_dev_dgx_h100.json — golden metrics on dgx_h100 - tests/test_utils/recipes/h100/gpt.yaml — registers the new test case under the mr / mr-github scopes for dgx_h100. Golden values picked up from NVIDIA#4469 (dsv4 branch) where the recipe has been calibrated against the final fused-kernel-on configuration. Reviewers can recalibrate if needed once Splits 1-4 land. Depends on NVIDIA#4531 (Split 1), NVIDIA#4945 (Split 2), and NVIDIA#4947 (Split 4) — the recipe enables enable_hyper_connections via the GPT spec and exercises the fused kernel path, so all three feature splits must land first. Reviewer groups touched: ci. Original work by @jingqiny-99 in NVIDIA#3430 (upstream NVIDIA#2943). Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Connor-XY
force-pushed
the
mhc-pr2-gpt-wiring
branch
from
August 13, 2026 18:25
e1a40d6 to
af41e41
Compare
Connor-XY
added a commit
to Connor-XY/Megatron-LM
that referenced
this pull request
Aug 13, 2026
Third split of NVIDIA#3430 (mirror of upstream NVIDIA#2943). Extends the pipeline-parallel schedules so they handle the n-stream hidden-state shape used by mHC across PP boundaries, and adds the corresponding unit tests. Files: - megatron/core/pipeline_parallel/schedules.py: n-stream-aware tensor-shape computation in `get_tensor_shapes`, and the matching expand/contract handling at first/last PP stages. - tests/unit_tests/pipeline_parallel/test_pp_mhc_compatibility.py: coverage for `get_tensor_shapes`, `get_num_layers_to_build`, VPP edge cases, PP boundary shape consistency, and standalone embedding/loss layers under mHC. Depends on NVIDIA#4531 (Split 1) for the core mHC module symbols, and on NVIDIA#4945 (Split 2) for the spec-side `enable_hyper_connection` wiring used by the forward tests. Reviewer groups touched: core-adlr, core-nemo, pipeline-parallelism. Subsequent splits still pending: - Split 4: fused mHC cuTile kernels - Split 5: functional-test recipe Original work by @jingqiny-99 in NVIDIA#3430 (upstream NVIDIA#2943). Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Connor-XY
added a commit
to Connor-XY/Megatron-LM
that referenced
this pull request
Aug 13, 2026
Final split of NVIDIA#3430 (mirror of upstream NVIDIA#2943 + kernel-fusion NVIDIA#3828). Adds the end-to-end functional test for the mHC feature: Files: - tests/functional_tests/test_cases/gpt/gpt3_mcore_te_tp2_pp2_mhc/ model_config.yaml — TP=2, PP=2 GPT-3 mHC training recipe golden_values_dev_dgx_h100.json — golden metrics on dgx_h100 - tests/test_utils/recipes/h100/gpt.yaml — registers the new test case under the mr / mr-github scopes for dgx_h100. Golden values picked up from NVIDIA#4469 (dsv4 branch) where the recipe has been calibrated against the final fused-kernel-on configuration. Reviewers can recalibrate if needed once Splits 1-4 land. Depends on NVIDIA#4531 (Split 1), NVIDIA#4945 (Split 2), and NVIDIA#4947 (Split 4) — the recipe enables enable_hyper_connections via the GPT spec and exercises the fused kernel path, so all three feature splits must land first. Reviewer groups touched: ci. Original work by @jingqiny-99 in NVIDIA#3430 (upstream NVIDIA#2943). Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Second split of NVIDIA#3430 (mirror of upstream NVIDIA#2943). Wires the mHC core module added in Split 1 (NVIDIA#4531) into the GPT layer specs: - megatron/core/models/gpt/gpt_layer_specs.py: add enable_hyper_connection kwarg; build mHC-aware ModuleSpec selecting HyperConnectionTransformerLayer - megatron/core/models/gpt/experimental_attention_variant_module_specs.py: forward the kwarg through experimental specs - gpt_builders.py: thread enable_hyper_connection from config to spec - tests/unit_tests/models/test_gpt_layer_specs.py: coverage for the enable_hyper_connection branch - tests/unit_tests/test_fp8_param.py: minor mHC-related test wiring Depends on NVIDIA#4531 — this PR is mergeable only after Split 1 lands. Rebase note (onto main after NVIDIA#4531 / NVIDIA#6401 merged): the original megatron/training/initialize.py hunk (enable NVTX ranges at init when --profile is set) is dropped — main's nvtx_decorator now checks the flag at call time and training.py toggles it at profile_step_start under --nvtx-ranges. The fused-MLA (mla_down_proj_fusion) TE submodules added upstream are wired for mHC as well. Reviewer groups touched: core-adlr, core-nemo, gpt, training-adlr, training-nemo. Subsequent splits (still pending Split 1's merge): - Split 3: pipeline-parallel support - Split 4: fused mHC cuTile kernels - Split 5: functional-test recipe Original work by @jingqiny-99 in NVIDIA#3430 (upstream NVIDIA#2943). Co-authored-by: jingqiny-99 <jingqiny@nvidia.com> Co-authored-by: Dennis Liu <denliu@nvidia.com> Signed-off-by: Yan Xu <yxu1@nvidia.com>
Split 1 (NVIDIA#4531) renamed the config fields to `enable_mhc_connections` / `mhc_num_residual_streams` per review. This split still read the old `config.enable_hyper_connections`, which would raise AttributeError once Split 1 lands. Sweep the spec builders, gpt_builders and tests onto the new names, and rename the `enable_hyper_connection` spec kwarg (plus the `enable_hc` local) to match, so the whole mHC surface uses one vocabulary. No behavior change beyond the rename. Signed-off-by: Yan Xu <yxu1@nvidia.com>
Connor-XY
force-pushed
the
mhc-pr2-gpt-wiring
branch
from
September 8, 2026 20:30
af41e41 to
1543c57
Compare
Contributor
Author
|
included in other PR, no longer needed |
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?
Second of a sequence of split PRs derived from #3430 (mirror of upstream #2943). The goal of splitting is to keep each PR small and limit the number of CODEOWNERS reviewer groups required, making review faster and easier.
This PR contains the GPT model wiring layer of mHC — i.e., how the core mHC module (added in Split 1) gets selected by the GPT layer specs and reached from the training-time initialization path. No new mHC math lives in this PR; everything is plumbing.
Files
Reviewer groups touched: core-adlr, core-nemo, gpt, training-adlr, training-nemo.
Dependency
Deferred to follow-up split PRs (NOT in this PR)
Credit
All changes here are a re-slice of @jingqiny-99's work in #3430 (upstream #2943). No new functionality has been added, removed, or rewritten in this split — only repackaged for narrower review scope.
Pre-checks