GLM-5.3-Flash on one GPU
Served a 181 GiB mixture-of-experts LLM from one 96 GiB GPU and took decoding from 10.8 to 15.0 tokens/s shipped, 16.5 at peak.
- Performance and inference
- Independent
- 2 Sep 2026
- Published
- 2 min read
A 181 GiB model does not fit on a 96 GiB GPU, so most of its experts live in host memory and are read over PCIe as the tokens need them. Three changes took decoding from 10.8 to 15.0 tokens/s as shipped, 16.5 tokens/s at peak, on one workstation card.
Problem
GLM-5.3-Flash is a mixture-of-experts model with 320B parameters, 18B of them active per token: each layer has 288 experts and uses 8 per token. In 4-bit NVFP4 it is 181 GiB; the card has 96 GiB. Plain offloading works, but every token waits on expert weights crossing PCIe.
Approach
- Read experts in wide blocks. Narrow, scattered loads across PCIe were the slow part. A gather kernel, a small GPU program that reads wide and contiguous, took decoding to 13.5 tokens/s.
- Keep the hot experts on the card, not the first ones. In each layer, 35% of the experts get 74% of the picks. So more of the model moved off the card (105 → 125 GiB in host memory) and the freed memory became a cache of the most-used experts: 16.5 tokens/s at peak. The shipped setup caches fewer experts per layer (54 instead of 66) to leave room for long prompts: 15.0 tokens/s.
- Read long prompts in groups. A long prompt touches nearly every expert; staging them 64 at a time took prompt reading from 614 to 1,750 tokens/s.
Results
Decoding went from 10.8 to 15.0 tokens/s as shipped, and 16.5 tokens/s at peak; prompt reading from 614 to 1,750 tokens/s. Most numbers are single runs on one machine, with about ±1 token/s of spread.
What did not work
- Using fewer experts per token reached 20.48 tokens/s, but the output got worse, so it is off.
- Eight bugs stood between a fresh checkout and correct output. One gave no error at all: the model repeated the same token forever.
- One known output defect is not fixed. It affects every NVFP4 mixture-of-experts checkpoint made with the same quantization tool, not only this one.
More in performance and inference
- Keras on PyTorch: compiled generation 11.6x fasterJul 2026 – Oct 2026
Traced why Keras on PyTorch ran about 9x slower than plain PyTorch, and merged the fixes upstream, one root cause each. · Google · Merged
- One call from a Keras model to a phone: LiteRT exportDec 2025 – Jul 2026
Built the LiteRT export path in Keras and KerasHub: a trained model to a phone-ready file in one call, on TensorFlow and PyTorch. · Google · Merged
- End-to-end UI tests for XProfAug 2026 – now
Wrote the end-to-end UI test suite for XProf, the open-source ML profiler, with 107 browser tests and a side-by-side check of two builds. · Google · Shipped
- Llama 3.1 in KerasHub, and Gemma 3 fixesApr 2025 – Jul 2026
Implemented Llama 3.1 in KerasHub and fixed Gemma 3 bugs, including a preprocessor crash across Gemma 3, 3n and 4. · Google · Merged