Skip to content

perf(glm): add GLM-5.2 GB200 debugging proxy recipes - #5095

Draft
yaoyu-33 wants to merge 2 commits into
songlinj/glm52_cardfrom
yuya/glm52-gb200-perf
Draft

perf(glm): add GLM-5.2 GB200 debugging proxy recipes#5095
yaoyu-33 wants to merge 2 commits into
songlinj/glm52_cardfrom
yuya/glm52-gb200-perf

Conversation

@yaoyu-33

Copy link
Copy Markdown
Contributor

What does this PR do ?

Add canonical 8-GPU GB200 BF16 and MXFP8 dense-equivalent performance proxy recipes for GLM-5.2, plus verified MXFP8 results in the model verification card. This PR is stacked on #5034.

The proxy is deliberately not train-equivalent GLM-5.2: it uses 18 layers, 64 experts, mock data, forced router balancing, DSA indexer top-k 512, and zero indexer-loss coefficient. The public recipe and card state this limitation explicitly.

Changelog

  • Add exported BF16 and MXFP8 GLM-5.2 50B dense-equivalent proxy recipes for 8x GB200.
  • Enable HybridEP, fused grouped MLP, MXFP8 output projection, and precision-aware optimizer settings selected from profiling and controlled experiments.
  • Add focused recipe tests for topology, proxy semantics, precision, environment, and parameter-count bounds.
  • Record the canonical 20-step MXFP8 result in the GLM-5.2 model verification card.

Performance

  • MXFP8 exact committed recipe: final-10 averages of 977.88 and 974.03 model TFLOP/s/GPU across two independent allocations, with finite LM/MTP losses and zero skipped or NaN iterations.
  • BF16 exact committed recipe: final-5 average 809.60 model TFLOP/s/GPU.
  • Two tuning runs with the same core 18-layer/64-expert/top-k-512 kernel and parallel configuration reached final-5 averages of 1007.18 and 1000.84 model TFLOP/s/GPU. These development peaks are reported separately from the canonical card metric because their timing schedule was not identical to the committed recipe.

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? No.

Validation:

  • uv run python -m pytest tests/unit_tests/recipes/test_glm5_perf_recipes.py — 10 passed.
  • uv run --no-project --with pyyaml python skills/create-model-verification-card/scripts/validate_card.py examples/model_verification_cards/glm5-2/card.yaml — passed.
  • uv run --no-project --with pre-commit pre-commit run --all-files — passed.

Additional Information

yaoyu-33 added 2 commits July 25, 2026 11:46
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33
yaoyu-33 marked this pull request as draft July 25, 2026 19:10
@yaoyu-33 yaoyu-33 changed the title perf(glm): add GLM-5.2 GB200 proxy recipes perf(glm): add GLM-5.2 GB200 debugging proxy recipes Jul 25, 2026
@claude

claude Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

line1
line2

@claude

claude Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Light review — LGTM with minor notes

The two new GB200 GLM-5.2 50B dense-equivalent proxy recipes (glm52_50b_pretrain_8gpu_gb200_bf16_config, glm52_50b_pretrain_8gpu_gb200_fp8mx_config) are clean. The benchmark-only overrides (mock data, forced router balancing, reduced DSA indexer top-k, disabled indexer loss) are correctly classified as non-convergence evidence in both the recipe comments and the card expected_result, matching the create-model-verification-card contract. Override ordering relative to _benchmark_common is correct: moe_hybridep_num_sms=16, apply_rope_fusion=False, lr_warmup_iters=0, and (fp8mx) use_transformer_engine_op_fuser=True are all applied after the helper runs, so none get clobbered. The fp8mx variant mutates a fresh env_vars dict (spread copy), so COMMON_PERF_ENV_VARS is not aliased. Card verification_index.performance.GB200 and the pretrain_performance.GB200 item are consistent.

Minor, non-blocking:

  • Test fidelity: test_glm52_50b_proxy_pretrain_recipes checks the ~50B param assertion (45e9-55e9) against the fabricated _FakeAutoBridge dimensions, not the real GLM-5.2 HF config. It proves the overrides (18 layers, 64 experts) yield ~50B given GLM-5.2-shaped per-layer dims, but shouldn't be read as validating the true model config.
  • Coverage gap (pre-existing): the GLM perf family is not listed in test_perf_config_integration.py::test_nemo_ci_perf_family_builders_embed_environment_settings (deepseek/gpt_oss/kimi/llama/nemotronh/qwen/qwen_vl/wan are). Not introduced by this PR, but the new GB200 env-var block is only covered by the new unit test.

Suggested test cases

There is no scripts/performance/configs/ tree in this repo (perf recipes are Python factories under src/megatron/bridge/perf_recipes/), so the <model>_*gpu_<gpu>_*_perf glob mapping does not apply here. The impacted cases are:

  • tests/unit_tests/recipes/test_glm5_perf_recipes.py::test_glm52_50b_proxy_pretrain_recipes[bf16]
  • tests/unit_tests/recipes/test_glm5_perf_recipes.py::test_glm52_50b_proxy_pretrain_recipes[fp8mx]
  • tests/unit_tests/recipes/test_all_perf_recipe_factories.py::test_all_perf_recipe_factories_are_exported
  • tests/unit_tests/recipes/test_all_perf_recipe_factories.py::test_perf_recipe_factory_builds_config[megatron.bridge.perf_recipes.glm_moe_dsa.gb200.glm5:glm52_50b_pretrain_8gpu_gb200_bf16_config]
  • tests/unit_tests/recipes/test_all_perf_recipe_factories.py::test_perf_recipe_factory_builds_config[megatron.bridge.perf_recipes.glm_moe_dsa.gb200.glm5:glm52_50b_pretrain_8gpu_gb200_fp8mx_config]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant