Skip to content

Add GLM-5.1 ms-swift LoRA fine-tuning recipe - #116

Open
William-Gao1 wants to merge 1 commit into
mainfrom
will/glm-5.1-msswift
Open

Add GLM-5.1 ms-swift LoRA fine-tuning recipe#116
William-Gao1 wants to merge 1 commit into
mainfrom
will/glm-5.1-msswift

Conversation

@William-Gao1

Copy link
Copy Markdown
Collaborator

Adds examples/glm-5.1-msswift — LoRA SFT of GLM-5.1 (744B glm_moe_dsa MoE, 256 routed experts, DeepSeek Sparse Attention) via MS-Swift + Megatron, mirroring the existing glm-4.7-msswift recipe.

Key differences from the GLM-4.7 recipe

  • Image: requires 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.
  • Compute: 4 nodes × 8 H200 (expert_model_parallel_size=32). The 256 experts shard cleanly only across power-of-2 GPU counts; 24 GPUs can't fit the weights.
  • Args: --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.

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

Example Validation Results

examples/glm-5.1-msswift/training/config.py

Status: EXCEPTION | Job: `` | Project: pr-116-examples--glm-5.1-msswift

Error: 400 Client Error: Bad Request for url: https://api.baseten.co/v1/training_projects/8w6zr53/jobs

Cache Summary
▪▪▪▪ There's a new version of truss available, 0.18.13 (you are currently on 
0.16.0)!
▪▪▪▪ To upgrade to the latest version, run: truss upgrade
▪▪▪▪ To disable this check, set `check_for_updates` to false in 
/home/runner/.config/truss/settings.toml
Error fetching cache summary: 404 Client Error: Not Found for url: https://api.baseten.co/v1/training_projects/8w6zr53/cache/summary
Client error: No training jobs with cache enabled found in this project.
ERROR HTTPError: 404 Client Error: Not Found for url: 
https://api.baseten.co/v1/training_projects/8w6zr53/cache/summary
Checkpoints
(no job ID available)

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
William-Gao1 force-pushed the will/glm-5.1-msswift branch from 375069b to c5398c7 Compare June 21, 2026 23:49
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