GLM-5.3-Flash
GLM-5.3-Flash
GLM-5.3-Flash is a 320-billion-parameter, 18-billion-active vision-language model. Its language backbone combines Kimi Delta Attention (KDA), KPool-indexed DeepSeek Sparse Attention (DSA), Mixture-of-Experts (MoE) layers, and four-stream Manifold-Constrained Hyper-Connections (mHC).
Architecture
- A 24-block vision encoder and patch merger project image features into the 4,096-wide language hidden state.
- The 45-layer decoder repeats three KDA layers followed by one KPool-DSA layer, with a final KDA layer. Four persistent mHC streams wrap attention and feed-forward sublayers.
- The first three decoder layers use dense feed-forward networks. The remaining 42 layers use 288 routed experts with top-8 routing and one shared expert.
- KPool-DSA selects up to 2,048 token positions through four-token pools before running sparse latent attention over a shared 512-wide K/V representation.
Supported Training Path
NeMo AutoModel provides a native configuration, image processor, vision tower,
language model, and Hugging Face state-dict adapter. The implementation runs on
the repository’s pinned transformers==5.12.1; users do not need Transformers
5.16, a nightly Transformers build, or trust_remote_code.
The supported base-checkpoint initialization path uses distributed checkpoint loading and dequantizes the released FP8 weights for BF16 training. Full-model single-GPU checkpoint loading and training are not supported.
The current path supports image training with FSDP2, activation checkpointing, expert parallelism, and contiguous packed context parallelism. Tensor parallelism, pipeline parallelism, and video training are not enabled. An EP size must evenly divide the model’s 288 routed experts and fit the available GPU memory; EP72 is the published validated topology, not a model requirement.
Attention Backends
- KDA layers use Flash Linear Attention (FLA) kernels. For CP, FLA carries the recurrent state across contiguous sequence shards while preserving packed document boundaries.
- Sparse DSA layers support an SDPA numerical-reference path.
- On SM90 or later,
backend.attn: cudnnuses FlashMLA for the sparse forward pass and cuDNN Frontend for backward. This is the backend selected by the published recipe.
Validated Configuration
Example Recipe
Install and Run
Clone and install NeMo AutoModel from source:
The cuDNN backend also requires FlashMLA’s flash_mla_sparse_fwd, which is not
published as a complete source distribution on PyPI. Install the tested
revision with its submodules:
The recipe requires 9 nodes with 8 GPUs per node. Launch it through the cluster launcher from inside the repository:
Use the Slurm Launcher Guide to configure the
multi-node launch. If FlashMLA or cuDNN Frontend is unavailable, change
model.backend.attn to sdpa; KDA still requires the FLA dependency.
Numerical Validation
Hugging Face Logit Parity
A four-layer model containing KDA, KDA, KDA, and DSA was compared with the Transformers reference at sequence length 4,096 over the full 154,880-token vocabulary. All 135 expected tensors loaded with no missing, unexpected, or shape-mismatched keys.
Packed CP1 / CP8 Training Parity
The full model trained for 100 steps with the same MedPix packed-2K workload, global batch size 144, EP144, TP1, PP1, and the SDPA DSA reference backend.
Across all 100 matched steps, the loss curves had mean absolute difference 0.001879, RMSE 0.002800, and maximum absolute difference 0.0130.
cuDNN Sparse Attention Performance
The SDPA and cuDNN backends were compared end to end with the published EP72 / CP2 topology. Both trained for 100 steps on the same MedPix packed-2K workload; the throughput window covers steps 10 through 99.
The cuDNN path improved mean throughput by 13.26% and median throughput by 13.32%, with 0.025 GiB/GPU higher mean steady-state memory. The two loss curves had mean absolute difference 0.002648, RMSE 0.003076, and final losses 1.2359 for SDPA and 1.2337 for cuDNN.
Current Scope
- Image training is supported; video training is not.
- TP and PP are not supported for this model. Packed contiguous CP and EP are supported with TP1 and PP1.
- Full-model single-GPU checkpoint loading and training are not supported. Use the distributed checkpoint initialization path.
- The recipe freezes the embeddings and vision tower while training the language backbone.
- The cuDNN sparse-attention path requires SM90 or later, cuDNN Frontend, and
FlashMLA. Use
backend.attn: sdpaas the portable reference path.