Repository navigation
Conversation
The modelopt NVFP4 checkpoint of GLM-5.3-Flash keeps the attention projections, shared experts and LM head in BF16, so at decode on DGX Spark (GB10, SM121) these GEMMs fall back to cuBLAS GEMV kernels at 170-200 GB/s of the 273 GB/s available. Add vllm/models/glm5next/nvidia/low_latency_gemm.py with measured SkinnyGemmConfig plans for the 7 TP=2 local (N, K) shapes at M = 1/2/4, routed only on capability (12, 1), and install them from Glm5NextForCausalLM and Glm5NextMTP in the same way as Qwen4Exp. The replacement method is chosen by the quant method the layer carries: a quant config that excludes lm_head gives ParallelLMHead an UnquantizedLinearMethod rather than an UnquantizedEmbeddingMethod. 2x DGX Spark TP=2, no speculative decoding, concurrency 1, nightly 8e2beaa: median TPOT 64.8-65.0 ms -> 56.2-57.9 ms (-12%), GSM8K n=100 93 -> 94. With MTP3 the GEMMs run at M=4 and ITL improves by 2.5%. Signed-off-by: Tim Ren <yuetim001@gmail.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCJJEDfMrRFQKAqpkgcY4Q
TimRen01
requested review from
AndreasKaratzas,
WoosukKwon,
mgoin,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
October 21, 2026 17:42
6 tasks done
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.
Overview
GLM-5.3-Flash decode TPOT -12% at concurrency 1 on 2x DGX Spark (SM121, TP=2). On
nvidia/GLM-5.3-Flash-NVFP4the attention projections (KDA and MLA), shared experts and LM head stay BF16 and take roughly 46 of a 68 ms decode step on cuBLAS gemv.glm5nexthas no low-latency GEMM module yet, so this adds one modelled onqwen4_exp/nvidia/low_latency_gemm.py(#59753, #59632, #61437) with measured SM121 plans for the TP=2 local shapes, installed fromGlm5NextForCausalLMandGlm5NextMTP.Claims
(N, K)shapes at M = 1/2/4 (20 entries), routed only on capability(12, 1); other GPUs, dtypes, token counts and shapes keep the standard linear path.Validation
Probe through the module path on GB10 (CUDA graph replay, weight rotated out of L2, nightly 8e2beaa), cosine 1.000000 vs
F.linearfor every entry:These are cold-L2 numbers, which is the serving case: decode reads each weight once per step and 45 layers do not fit the 24 MB L2. The M=1 entries add up to 12.8 ms per step; the server gains 8 ms because the GEMMs interleave with MoE and attention. M=8/16 are within 2% of cuBLAS and are not listed.
End to end,
nvidia/GLM-5.3-Flash-NVFP4TP=2 on two Sparks, FP8 KV, SPEED-Bench 2K in / 1K out, 4 requests at concurrency 1, two interleaved runs per arm, nightly 8e2beaa:With MTP k=3 (
--speculative-config '{"method":"mtp","num_speculative_tokens":3}', 2026-10-17 nightly):An nsys census of the plans arm shows every listed shape on
CuteSkinnyGemmin the server (45% of GPU time without speculation, 39.5% with MTP); what is left on cuBLAS is KDAf_b/g_b(4096, 128) (#57617), the fp32-output router gate (288, 4096) and MLA o_proj at M=1.Tests:
pytest tests/kernels/test_bf16_skinny_gemm.py -k glm5next, 26 passed on GB10 (table validity, capability routing, hook installation, 20 selected shapes with cosine > 0.999). The selected-shape test skips off capability (12, 1), which CI does not have.Reproduction
# on each DGX Spark, --node-rank 0 / 1 vllm serve nvidia/GLM-5.3-Flash-NVFP4 --tensor-parallel-size 2 --nnodes 2 --node-rank 0 \ --master-addr 192.168.100.1 --master-port 29500 --distributed-executor-backend mp \ --gpu-memory-utilization 0.84 --max-model-len 32768 --max-num-seqs 16 \ --max-num-batched-tokens 8192 --enable-prefix-caching --disable-custom-all-reduce \ --no-enable-flashinfer-autotune --reasoning-parser glm45 --kv-cache-dtype fp8 vllm bench serve --backend openai-chat --endpoint /v1/chat/completions \ --dataset-name speed_bench --speed-bench-dataset-subset throughput_2k \ --speed-bench-output-len 1024 --ignore-eos --num-warmups 2 --num-prompts 4 --max-concurrency 1 --seed 0 pytest tests/kernels/test_bf16_skinny_gemm.py -k glm5nextDetails
(2048, 4096)serves both the shared-expert gate/up and the MLA fused q_a/kv_a projection.lm_headgivesParallelLMHeadanUnquantizedLinearMethodrather than anUnquantizedEmbeddingMethod, and the head stayed on cuBLAS until this was handled.f_b/g_b(4096, 128)([Perf][GLM-5.3-Flash] Batch paired KDA gate projections (f_b_proj/g_b_proj) into one bmm #57617), MTPeh_proj(a plainnn.Linear), and M=3, which uses cuBLAS.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.