feat(glm5_next): serve GLM-5.3-Flash with tensor parallelism - #507
Open
calvarado2004 wants to merge 1 commit into
Open
calvarado2004 wants to merge 1 commit into
calvarado2004 wants to merge 1 commit into
Conversation
Shard MLA heads, KDA heads and state, the dense and shared-expert MLPs, and NVFP4 expert banks across TP ranks; the MLA latent, DSA indexer and KDA gate bottleneck stay replicated. The reader cuts every tensor per rank, including each KDA part before it is fused. Assisted-by: Claude Opus 5
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
Serve GLM-5.3-Flash (
glm5_next) with tensor parallelism. Today the model loads at TP=1 only.q_b/kv_bcolumn-parallel,o_projrow-parallel). The latent projections (q_a,kv_a) and the DSA indexer stay replicated, so every rank selects the same blocks and reads the same latent KV.q|k|v|b, thef_b/g_bup-projections, the conv channels,A_loganddt_bias. The rank-128f_a/g_abottleneck moves to its own replicated projection (in_proj_fg). The linear state pool is sized per rank.Tests
tests/models/test_glm5_next_tp.py: the per-rank shape contract, that the reader's shards tile back to the full tensors, and NVFP4 shard packing.tests/models/test_glm5_next_tp_equivalence.py(multi-GPU,slow): TP=2 and TP=4 prefill and decode logits match TP=1 on a tiny checkpoint, with real NCCL collectives.Run on the branch head (4x RTX A4000; production held GPUs 0-1, so two GPUs were visible):
With two GPUs the equivalence test runs its TP=2 case and skips TP=4.
Hardware
4x RTX A4000 (16 GB, Ampere), 2x Xeon, 502 GB RAM,
RedHatAI/GLM-5.3-Flash-NVFP4, TP=4 with hybrid CPU/GPU experts:Plain decode on this box runs at 14-15 tok/s (single stream, temperature 1.0).