Add GLM-5.1 ms-swift LoRA fine-tuning recipe - #116
Open
William-Gao1 wants to merge 1 commit into
Open
Conversation
Example Validation Results❌
|
GLM-5.1 (744B glm_moe_dsa, 256 experts, DeepSeek Sparse Attention) LoRA SFT on 4x8 H200. Requires a megatron-core >= 0.17.1 image: earlier builds lack the DSA indexer kernel and reject the model's interleaved-RoPE + multi-latent attention. Uses expert_model_parallel_size=32 (256 experts shard cleanly only across power-of-2 GPU counts). max_length is 16384 — longer context is limited by the DSA indexer's O(seqlen^2) score matrix until context-parallel support lands upstream. Validated end-to-end at 16k on 4x8 H200.
William-Gao1
force-pushed
the
will/glm-5.1-msswift
branch
from
June 21, 2026 23:49
375069b to
c5398c7
Compare
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.
Adds
examples/glm-5.1-msswift— LoRA SFT of GLM-5.1 (744Bglm_moe_dsaMoE, 256 routed experts, DeepSeek Sparse Attention) via MS-Swift + Megatron, mirroring the existingglm-4.7-msswiftrecipe.Key differences from the GLM-4.7 recipe
megatron-core >= 0.17.1(...megatron0.17.1-msswift4.3.1-peftstamp). Earlier builds lack the DSA indexer kernel and hard-reject GLM-5.1's interleaved-RoPE + multi-latent-attention combo.expert_model_parallel_size=32). The 256 experts shard cleanly only across power-of-2 GPU counts; 24 GPUs can't fit the weights.--template glm5_1,--tuner_type lora,--output_dir,--dataloader_num_workers(the 4.x ms-swift arg surface).max_length=16384: longer context currently OOMs in the DSA indexer's O(seqlen²) score matrix; context-parallel support for DSA isn't available upstream yet.Validation
Ran end-to-end on 4×8 H200 at 16k seqlen — completed training and saved a LoRA checkpoint.