Skip to content

Support GLM5.2 and recipe for GLM 5.1 & 5.2 on GB200 and H100 - #4520

Merged
yaoyu-33 merged 4 commits into
NVIDIA-NeMo:mainfrom
HollowMan6:glm52
Jul 9, 2026
Merged

Support GLM5.2 and recipe for GLM 5.1 & 5.2 on GB200 and H100#4520
yaoyu-33 merged 4 commits into
NVIDIA-NeMo:mainfrom
HollowMan6:glm52

Conversation

@HollowMan6

Copy link
Copy Markdown
Contributor

What does this PR do ?

Support GLM5.2 and use correct GLM5.x related flags, as introduced in NVIDIA/Megatron-LM#5246 and related PRs.

Changelog

  • Pass related flags correctly to mcore

GitHub Actions CI

See the CI section in the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

If you haven't finished some of the above items you can still open "Draft" PR.

Additional Information

  • Related to # (issue)

@HollowMan6 HollowMan6 added feature New capabilities, enhancements, or enablement work area:model Model implementations and HF bridge logic area:perf Performance optimizations and benchmarking needs-review PR is ready for code review and waiting on a reviewer labels Jun 26, 2026
@HollowMan6
HollowMan6 requested a review from yaoyu-33 June 26, 2026 06:05
@yaoyu-33 yaoyu-33 added the needs-more-tests Requires additional L0 and L1 test coverage before merge label Jun 29, 2026
@yaoyu-33 yaoyu-33 removed the area:model Model implementations and HF bridge logic label Jun 30, 2026
@HollowMan6

Copy link
Copy Markdown
Contributor Author

/claude review

@claude

claude Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review - GLM-5.2 support + GLM-5.1/5.2 perf recipes

Overall clean and well-tested. One blocking bug in the tests.

[High] Arithmetic assertion is wrong and will fail CI - tests/unit_tests/recipes/test_glm5_perf_recipes.py lines 127-135. The GLM-5.2 H100 recipe sets PP=13, EP=16, ETP=1, so 416 // (13161) = 416 // 208 = 2, but the test asserts == 4. The recipe is self-consistent (dense DP = 416 // (TPPPCP) = 416 // 208 = 2, expert DP = 416 // (PPEPETP) = 2), so the expected value should be 2. Inline suggestion posted. As written, this test fails and the whole file errors out.

Notes (non-blocking):

  • glm5_bridge.py:115 reads hf_config.indexer_rope_interleave unconditionally (no getattr). It exists on GLM-5/5.1/5.2 HF configs and the toy config and new unit test both define it, so this is fine - just flagging that a config missing this key raises AttributeError rather than falling back.
  • Dispatcher selection matches guidance: hybridep on GB200, deepep on H100.

Suggested test cases:

  • glm51_sft_192gpu_gb200_bf16_config
  • glm52_sft_192gpu_gb200_bf16_config
  • glm51_sft_416gpu_h100_bf16_config
  • glm52_sft_416gpu_h100_bf16_config
  • test_glm5_perf_recipes_are_flat_and_preserve_bridge_dsa_fields[glm51_sft_192gpu_gb200_bf16_config]
  • test_glm5_perf_recipes_are_flat_and_preserve_bridge_dsa_fields[glm52_sft_192gpu_gb200_bf16_config]
  • test_glm5_perf_recipes_are_flat_and_preserve_bridge_dsa_fields[glm51_sft_416gpu_h100_bf16_config]
  • test_glm5_perf_recipes_are_flat_and_preserve_bridge_dsa_fields[glm52_sft_416gpu_h100_bf16_config]
  • test_glm52_h100_pipeline_layout_keeps_dsa_index_sharing_within_each_stage
  • test_provider_bridge_maps_dsa_architecture_from_hf_config

Comment thread tests/unit_tests/recipes/test_glm5_perf_recipes.py
Signed-off-by: Hollow Man <hollowman@opensuse.org>
Signed-off-by: Hollow Man <hollowman@opensuse.org>
Signed-off-by: Hollow Man <hollowman@opensuse.org>
Signed-off-by: Hollow Man <hollowman@opensuse.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:perf Performance optimizations and benchmarking feature New capabilities, enhancements, or enablement work needs-more-tests Requires additional L0 and L1 test coverage before merge needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants