Skip to content

fix(model): use TP=1 for GLM-5 inference - #4999

Merged
yaoyu-33 merged 2 commits into
mainfrom
yuya/nvbug-6462597-glm5-tp1-pp2
Jul 22, 2026
Merged

yaoyu-33 merged 2 commits into
mainfrom
yuya/nvbug-6462597-glm5-tp1-pp2

Conversation

@yaoyu-33

Copy link
Copy Markdown
Contributor

What does this PR do ?

Use a supported 64-GPU topology for GLM-5 conversion and inference by switching the example defaults from TP=2/PP=1/EP=32 to TP=1/PP=2/EP=32.

Changelog

  • Avoid the AbsorbedMLA sequence-parallel requirement by using TP=1.
  • Split all 78 transformer layers evenly across two pipeline stages while retaining eight routed experts per GPU.
  • Update the GLM-5 README, conversion wrapper, inference launcher, and launcher contract tests.
  • Pass runtime variables through explicit Slurm and container allowlists, keep the Hugging Face token out of process arguments, and propagate inference failures from srun.

GitHub Actions CI

  • uv run python -m pytest tests/unit_tests/models/glm_moe_dsa/test_glm5_bridge.py tests/unit_tests/conversion/launcher/test_slurm_examples.py -q (18 passed)
  • uv run pre-commit run --all-files (passed)
  • Real GLM-5 checkpoint generation on 64 GPUs with TP=1/PP=2/EP=32 (20-token generation completed with coherent output)

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; this PR changes no dependencies or optional imports.
    • Reviewer: Does the PR have correct import guards for all optional libraries?

Additional Information

  • Fixes an internally reported GLM-5 inference regression after the Megatron-Core update.

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 21, 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 added area:model Model implementations and HF bridge logic bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels Jul 21, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 5823974

@claude

claude Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LGTM

Reviewed the GLM-5 launcher parallelism change (TP=2,PP=1 -> TP=1,PP=2) and the slurm_inference.sh hardening. Changes are consistent and correct:

  • Parallelism updated in lockstep across README.md, slurm_conversion.sh, slurm_inference.sh, and the test fixture. GPU math holds: 8 nodes x 8 = 64 = TP(1)xPP(2)xEP(32); 78 layers split evenly at 39/stage under PP=2.
  • bash -c body switched from double to single quotes and HF_TOKEN now passed via --export/--container-env instead of being interpolated into the command string, keeping the secret out of process arguments; the new test verifies this.
  • Exit status captured into status before the trailing echo (which would reset $?) and re-exited, so the launcher propagates the real srun exit code (asserted via returncode == 7).

No correctness, typo, docs, or coverage issues found. Note: could not run the unit test in this sandbox; please confirm tests/unit_tests/conversion/launcher/test_slurm_examples.py passes in CI.

Suggested test cases:

  • No perf tests impacted.
  • tests/unit_tests/conversion/launcher/test_slurm_examples.py::test_glm5_inference_launcher_keeps_hf_token_out_of_process_arguments
  • tests/unit_tests/conversion/launcher/test_slurm_examples.py::test_slurm_conversion_wrapper_forwards_public_launcher_args[examples/models/glm/glm5/slurm_conversion.sh-expected0]

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@yaoyu-33
yaoyu-33 merged commit 20800c7 into main Jul 22, 2026
4 checks passed
@yaoyu-33
yaoyu-33 deleted the yuya/nvbug-6462597-glm5-tp1-pp2 branch July 22, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:model Model implementations and HF bridge logic bug Something isn't working 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.

1 participant