feat(glm5-next): add GLM-5.3-Flash training support - #3699
Open
HuiyingLi wants to merge 8 commits into
Open
Conversation
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Contributor
|
馃尶 Preview your docs: https://nvidia-preview-preview-e3c3cacad2e8.docs.buildwithfern.com/nemo/automodel |
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
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 ?
Adds native AutoModel training support for zai-org/GLM-5.3-Flash, including its hybrid Kimi Delta Attention (KDA) / DeepSeek Sparse Attention (DSA) decoder, MoE routing, VLM processing, Hugging Face checkpoint conversion, and packed-sequence context parallelism.
The included MedPix recipe uses the validated EP72/CP2 topology: TP1, PP1, 9 nodes / 72 GPUs, packed sequence length 2048, and 100 optimizer steps. It now selects the shared FlashMLA-forward/cuDNN-backward kernel for sparse MLA layers; KDA layers remain on FLA.
Important
Full-model single-GPU checkpoint loading and training are not supported. The supported base-checkpoint initialization path is distributed DCP loading.
Changelog
D=576, top-k <= 2048 contract.Validation
Hugging Face numerical parity
Reference setup:
5.16.0.dev0Packed CP1 / CP2 training parity
Both full-model runs use
mmoukouba/MedPix-VQA, packed sequence length 2048, global batch size 144, local batch size 1, TP1, PP1, and complete 100/100 optimizer steps. These runs validate the packed CP implementation and EP72/CP2 topology using the SDPA sparse-attention reference; the cuDNN sparse path is validated separately below.Across all 100 matched steps:
0.00180.00751.3615, CP21.3624cuDNN sparse MLA parity
The released checkpoint uses 64 query heads, a 512-wide latent K/V,
index_topk=2048, andindex_kpool=4, producing 2051 raw sparse slots before FlashMLA alignment.H100 shared-kernel stress test (
D=512, rawK=2063, larger than the released model's 2051 slots):Full native GLM-5.3 sparse layer versus the SDPA reference (
seq=64,D=512, rawK=2051, BF16):Single-node distributed training smoke test:
backend.attn=cudnn, activation checkpointing enabled10.7592,11.233913.29 GiB, then17.26 GiBRuntime used
nvidia-cudnn-frontend[cutedsl]==1.27.0and FlashMLA b7643bd on H100 with CUDA 13.3.Unit tests
Result:
35 passed, 3 skippedin the interactive development container. The skipped cases require real optional GPU kernels; the H100 results above exercise those kernels directly.Before your PR is "Ready for review"
Pre checks:
Additional Information
backend.attn=cudnnrequires bothnvidia-cudnn-frontend[cutedsl]and a compatible FlashMLA build; environments without them can selectbackend.attn=sdpa.