Onboard glm5.1#4458
Open
notabee wants to merge 6 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…p gcloud call in try-except
7f13ff3 to
dfe830f
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.
Description
Onboards the GLM-5.1 (744B parameters Mixture of Experts) model architecture onto MaxText to support full-parameter pre-training and fine-tuning.
Context & Problem Solved
This change introduces the official GLM-5.1 model configuration parameters to enable pre-training and verification on Google TPU slices. To prevent configuration schema validation errors during execution, the model has been registered as an allowed literal option in the MaxText Pydantic schemas.
Implementation Details
src/maxtext/configs/models/glm5.1-744b.ymldefining:mla) hyperparameters (q_lora_rank=2048,kv_lora_rank=512,qk_nope_head_dim=192,qk_rope_head_dim=64,v_head_dim=256).num_experts=256,num_experts_per_tok=8,shared_experts=1,routed_scaling_factor=2.5).dot_productto satisfy sparse indexer validation.bfloat16to reduce HBM memory consumption by 50%.4for local single-node verification."glm5.1-744b"to the allowedModelNameliterals insrc/maxtext/configs/types.py.Future Improvements
Scaling to the original full model (78 layers / 744B parameters) requires multi-node TPU slices combined with Pipeline/Tensor/Expert Parallelism sharding configurations.
Tests
Environment Setup
If running in a PyTorch-preloaded TPU VM image (e.g., standard
vllm-tpu), uninstall conflicting torchvision/triton binary packages to prevent dynamo startup crashes:Reproduction Commands
Verify JAX PJRT device compilation and execute a 2-step synthetic training sanity run (e.g., testing 16 layers, ~131.5B parameters):
Verified Scaling Limits (on 8x TPU7x VM, 94.75 GB HBM per device):
Checklist