Deployment
Install SGLang
Install SGLang
Use an SGLang build that includes GLM-5.3-Flash support (v0.5.20 or later).For the listed NVIDIA hardware, the deployment panel can render a complete
Command
docker run command. See Install SGLang with Docker for host setup.For MI355X, follow the AMD GPU installation guide and run the generated Python command on four GPUs. Select FP8 or MXFP4; SGLang downloads the model and tokenizer automatically.For MI300X and MI325X, use the lmsysorg/sglang:v0.5.22-rocm10-mi30x image and the launch commands in MI300X and MI325X deployment measured with SemiAnalysis InferenceX. The deployment panel does not list these GPUs.For TPU7x, install sglang-torchtpu from source (its main branch; the v0.1.0-tpu image predates the GLM-5.3-Flash MTP fixes) and run the generated Python command on one TPU7x host with 4 chips:Command
Install and prepare Ascend NPUs
Install and prepare Ascend NPUs
Use a Linux host with the Ascend driver and a compatible CANN / TorchNPU environment. Follow the
Ascend installation guide and the
GLM-5.3-Flash deployment tutorial to start a container with the NPU devices, driver mounts, and checkpoint directory. Run the setup and the generated Python command inside that container.Run the following setup before copying the generated command (CANN 9.1.0). CPU tuning requires host privileges.Replace the model path in the generated command with your mounted ModelSlim checkpoint directory. Include its configuration, tokenizer, quantization metadata, and MTP weights.Use W8A8 for A3 and W8A8_MXFP8 for 950PR/DT series.Replace network placeholders such as
- A3
- 950PR/DT series
Command
Command
<network-interface>, <prefill-head-ip>, and <decode-head-ip> in the generated NPU command with your cluster settings.- Low Latency starts with MTP 5/1/6 speculative decoding and tensor parallelism to shorten interactive responses.
- High Throughput starts with speculative decoding off, which avoids draft-and-verify overhead under sustained batches.
--cuda-graph-backend-prefill breakable to the generated command. This requires a build that includes PR #38522; the option is disabled on MI355X.
GLM-5.3-Flash defaults to
--mamba-full-memory-ratio 0.25 with --mamba-radix-cache-strategy extra_buffer_lazy: a small KDA state pool and a large KV pool, so multi-turn agent sessions stay resident between turns. High Throughput commands on GPUs where that small state pool would cap running requests below the benchmarked concurrency (GB300 FP8, GB200, H200, H100) pin --mamba-full-memory-ratio 0.9, because many short concurrent requests need more KDA states than KV. Neither is a workload-tuned split: too low starves the KDA state pool and clamps max_running_requests, too high shrinks the KV pool. Use the repo-local compute-mamba-ratio skill to compute the balanced ratio — or the --max-mamba-cache-size pin to use instead — from your average request length and the two pool sizes printed in one boot log. See Size both memory pools for what each pool caps.Playground
Use the Playground for lower-level tuning such as attention parallelism, MoE communication, PD disaggregation, speculative decoding, and reasoning or tool parsers. It inherits every selection from the deployment panel and shows only the command-line diff. The MoE backend defaults toflashinfer_trtllm on B300, B200, GB300 and GB200, to DeepGemm on Hopper, and to AITER on MI355X.
Agentic Long-Context Deployment
Agentic workloads, such as coding agents and other multi-turn, tool-using assistants, send long prompts whose prefixes grow and repeat from turn to turn. This section gives complete launch commands for such deployments, each benchmarked in SemiAnalysis InferenceX and linked to the run that measured it.MI300X and MI325X deployment measured with SemiAnalysis InferenceX
FP8 checkpoint with EAGLE MTP on four MI300X or MI325X GPUs (TP4·EP4), benchmarked in SemiAnalysis InferenceX (InferenceX #5117, run 44072959411): GPU-resident KV at concurrency 1–16 on MI300X and 1–12 on MI325X, and HiCache at concurrency 24–40 on MI300X and 16–32 on MI325X. GSM8K strict-match accuracy is 0.9735 on MI300X and 0.9742 on MI325X (1,319 questions, HiCache at concurrency 40 and 32).- Container image.
lmsysorg/sglang:v0.5.22-rocm10-mi30x(sha256:5658cd0d8de0c68de10d2e349296f55ceff98053182fa87b2a7e942e5e7f3c2a, the image tested in InferenceX). - Block-FP8 GEMM.
SGLANG_AITER_GFX942_BLOCKSCALE_USE_CK=1runs the block-FP8 linear layers on the AITER CK GEMM instead of the AITER Triton GEMM. In this image, four of the model’s six linear shapes at TP4 have no gfx942 Triton config and run the default tile. Compared with the same commands without the variable (InferenceX #4721 and #4722), it raised throughput per GPU by 5–17% and lowered median TPOT by 11–23% at every measured point. Images built frommainafter #43815 use the CK GEMM on gfx942 by default. - gfx942 kernels.
SGLANG_OPT_FUSE_MHC_POST_PRE=0keeps the unfused mHC path, because gfx942 HIP cannot compile the fused TileLang lane-index operation.SGLANG_DSA_FUSE_TOPK=0andSGLANG_OPT_USE_TOPK_V2=0select the portable top-k path instead of the CUDA-header JIT kernels;--dsa-topk-backend torchrequiresSGLANG_DSA_FUSE_TOPK=0. - All-reduce.
ROCM_QUICK_REDUCE_QUANTIZATION=NONEoverrides the image’sROCM_QUICK_REDUCE_QUANTIZATION=INT8default. - Batch limits. Set
--max-running-requestsand--cuda-graph-max-bs-decodeto twice the concurrency. The commands below use concurrency 8. - HiCache. At the higher concurrencies, add
--enable-hierarchical-cache. On MI300X, the host tier keeps its default size of twice the device KV pool, about 118–131 GiB per rank. On MI325X, also add--hicache-host-memory-fraction 0.60 --hicache-io-backend direct --hicache-mem-layout page_first_direct, and leave--hicache-sizeand--hicache-ratiounset so that the host pools of all ranks stay within 60% of the available host memory. - Differences between the GPUs. The MI300X command uses an FP8 E4M3 KV cache,
--prefill-decode-interval 0,--min-free-slots-delay 1, andSGLANG_OPT_FUSED_KDA_VERIFY=1. The MI325X command uses a BF16 KV cache and the default scheduling settings.
- MI300X
- MI325X
MI300X TP4·EP4 (concurrency 8)
1. Model introduction
GLM-5.3-Flash is a natively multimodal Mixture-of-Experts model built around a hybrid attention architecture — 320B total parameters with 18B active. Its 45 text layers combine MLA attention, DSA sparse attention, and KDA linear attention, and a 24-layer vision encoder handles image and video input. The checkpoint uses 288 routed experts with 8 active experts per token and includes a native MTP draft layer for speculative decoding. See the GLM-5.3-Flash blog and the GLM-5 technical report for training details.| Attribute | Description |
|---|---|
| Architecture | MoE with hybrid attention (MLA, DSA, KDA), mHC, and MTP — 320B total / 18B active parameters |
| Precision | FP8 weights (zai-org/GLM-5.3-Flash); MXFP4 on MI355X (OneNexus/GLM-5.3-Flash-MXFP4); NVFP4 on Blackwell from RadixArk/GLM-5.3-Flash-NVFP4 and nvidia/GLM-5.3-Flash-NVFP4; FP8 KV cache by default on Blackwell and MI355X, BF16 KV cache on H100 and H200 |
| Context | 1M tokens |
| Inputs | Text, image, and video |
| Generation defaults | temperature=1.0, top_p=0.95, thinking enabled |
2. Configuration tips
Choose a strategy
Start with Low Latency for chat and agent workloads. It drafts from the checkpoint’s MTP head at a fixed depth (5 steps, top-k 1, 6 draft tokens) with natural acceptance. Measure High Throughput for heavily batched traffic where disabling speculative decoding can be more efficient. SGLang serves MTP through--speculative-algorithm EAGLE (upstream folds the older NEXTN spelling into EAGLE), so generated commands use that flag value.
Strategy labels describe the workload goal, not a hardware restriction. Both strategies stay available when you switch hardware; only the verification badge changes. On MI355X, the measured AgentX frontier used Low Latency (EAGLE 5/1/6); High Throughput is an unmeasured speculation-off starting point.
Change the speculative algorithm
The Speculative card in the Playground changes the algorithm without leaving the selected strategy:- EAGLE / MTP 5-1-6 is exactly what Low Latency serves, so a Low Latency base starts on this chip. Pick it from a High Throughput base to keep that recipe’s other settings and add the MTP head.
- Off (greedy) strips the whole
--speculative-*family, which is what High Throughput already starts from. - DFlash2 swaps the in-checkpoint MTP head for the trained block-diffusion draft in
incoai/GLM-5.3-Flash-DFlash2. The draft proposes a whole block per step and the target verifies it in one forward pass, so output quality stays the target’s. Its block size comes from the draft checkpoint, and the draft runs onfa4rather than the target’s DSA backends. The hidden-state capture it needs (PR #36708) shipped with the GLM-5.3-Flash support in v0.5.20, so the image pinned above is enough. The draft repository is access-gated: request access on its model page, then download it alongside the target before serving. This combination is not yet measured on the cookbook hardware, so treat it as a starting point.
Serve on TPU7x
The TPU7x recipe serves the language model with DeepSeek Sparse Attention on the Pallas sparse MLA kernels and MTP 3/1/4 on the experimental chain speculative worker (SGLANG_TPU_ENABLE_EXPERIMENTAL_SPEC_WORKER=1). On TPU7x, 3/1/4 decodes faster than 5/1/6 at the same accept length, because each extra draft row widens the target verify. It is sized for one request with 8K input and 1K output: --context-length 10240, --max-running-requests 1, and a 20,480-token KV pool. Raise --context-length, --max-total-tokens, --max-running-requests and --max-mamba-cache-size together for longer or concurrent requests; those settings are outside the verified command. The first start compiles every decode and prefill shape listed in --tpu-compile-bs and --tpu-compile-tokens, so it takes longer than later starts that reuse the compilation cache.
Size both memory pools
GLM-5.3-Flash maintains a paged KV pool for attention and a separate KDA state pool. The KDA state pool can limit concurrency before the KV pool is full. If startup reducesmax_running_requests because of KDA state capacity, increase --mamba-full-memory-ratio or set --max-mamba-cache-size for the expected concurrency, then tune --max-running-requests to the workload.
Keep the prefix cache enabled for every strategy.
Keep the checkpoint’s KDA lower-bound setting unchanged. In particular, do not override linear_lower_bound through --json-model-override-args.
Tune B300 TP4 for long-context agent traffic
For long-context agent workloads with prefix reuse, tune the prefill interval together with the KV/KDA memory split. On four NVIDIA B300 GPUs with TP4 and FP8 weights, the configuration below increased AgentX S19 total throughput by 26.3% and output throughput by 35.6% at client concurrency 64.
Reducing the memory ratio shifts capacity from KDA states to KV tokens. KV capacity increased from 13.92M to 17.62M tokens, while KDA checkpoint capacity decreased from 1,626 to 1,144 states. At C64, the input cache-hit rate rose from 87.00% to 92.12%.
Benchmark server command
Benchmark server command
Measured on Linux with SGLang revision For the baseline, change the interval to
3fa242f27c5e6caca28ccd2538f2043eec654740, FlashInfer 0.7.2, and PyTorch 2.14.1+cu130. Set MODEL_PATH to the public model identifier or your local FP8 checkpoint.The benchmark pins speculative acceptance to 3.5 with the three SGLANG_SIMULATE_ACC_* variables below. Omit these variables for normal serving and accuracy evaluation.0, the path-state cap to -1, and the memory ratio to 0.9. Both configurations use 16,384-token prefill chunks and explicitly pin the prefill graph capacity to 8,192 tokens to match the measured configuration rather than rely on version-dependent defaults.max_running_requests remains 32.
Total throughput includes cached input tokens. TPOT p99 is the 99th percentile of per-request average time per output token.
Tune the cap and memory ratio together: with interval
1 and ratio 0.9, adding cap=2 reduced C64 total throughput from 184,053.1 to 166,257.3 tokens/s. A follow-up at ratio 0.5 with an unlimited path-state cap measured 190,658.5 total tokens/s and 1,292.1 output tokens/s, compared with 227,018.8 and 1,642.5 with cap=2.
Measurement details
Measurement details
Each C4/C64 point is one 900-second AgentX send window after graph/kernel warmup, snapshot primers, and one additional warmup request per client lane. Each point used a fresh server, client seed 42, and corpus revision
23f152f6f0f9399a85901b89a6458def0ef16729. Native full-run metrics include a final drain of up to 30 seconds.The C64 baseline completed 1,344 requests and cancelled 5 at the measurement boundary; the tuned configuration completed 1,644 with no cancellations. Both passed the native submission checks with no request errors. The sweep covers C4 and C64 with simulated acceptance; repeated runs and natural-acceptance performance are separate follow-ups.Keep the KV and DSA backends paired
On Blackwell, the recipes default to an FP8 KV cache with TRT-LLM DSA: on GB300 this pairing measured 2.9–5.7% higher throughput and about 1.8x the KV token capacity at identical pool bytes, with GSM8K accuracy within noise of BF16. BF16 KV with TileLang DSA remains selectable in the deployment panel and is the default on H100 and H200, where FP8 KV with TRT-LLM DSA is disabled. MI355X instead uses FP8 KV with TileLang DSA in the recorded ROCm recipe. Switch the dtype and both DSA backends together. On CUDA, TileLang FP8 KV uses raw rows rather than the scaled layout offlashmla_kv: use TileLang for both backends, or the Hopper Q8 prefill pairing below. TRT-LLM DSA is not the MI355X backend.
On Hopper, BF16 KV can also run the sparse prefill in FP8 with --dsa-prefill-backend flashmla_sparse_q8 (decode stays on tilelang and the cache stays BF16): on H200 this pairing measured 5.8–12.1% higher throughput on prefill-only requests, with GSM8K accuracy within noise of BF16 + TileLang. It is SM90-only and requires a build that includes PR #41790.
With the raw FP8 KV support in PR #42957 and PR #44217, you can also pair Q8 prefill with --kv-cache-dtype fp8_e4m3 and TileLang decode on CUDA H100/H200 (SM90). This path requires NoPE MLA (qk_rope_head_dim=0, kv_lora_rank=512) and gathers only the requested prefix rows from the raw FP8 pool. It does not use the scaled/packed FP8 layout. HiSparse and --dcp-size > 1 are not supported with this pairing. The BF16 benchmark results above do not measure this FP8 KV configuration.
Extend the cache hierarchy
Keep HiCache off when GPU memory is sufficient. Select L1 + L2 to spill reusable cache entries into host memory. Select + L3 only after configuring Mooncake on every serving node; the generated command exposes the required configuration path. These options remain selectable but are marked Not Verified until the resulting command is validated on the chosen hardware. For agentic MXFP4 serving on MI355X, select Low Latency with L1 + L2. The host tier uses--hicache-size 180 (about 190 GB of host memory per rank once the KDA state and DSA indexer pools are included, 750 GB per node) and requires a build that includes PR #42178. With less free host memory, keep HiCache off; the server does not start when the host tier does not fit.
Multimodal memory
All strategies enable multimodal serving. Image and video input useGlm5NextProcessor, which the pinned Transformers release ships (the MI355X checks predate that release and used commit e4052f55). On MI355X, text, image, and an image-bearing follow-up were qualified with that build; video was not evaluated. The processor samples video at 2 FPS and caps video input at 240,000 visual tokens. Install torchcodec in the serving environment before sending video requests. For very long videos on 4x GB300, use encoder disaggregation to isolate the vision encoder’s memory spikes from language decoding.
The default multimodal feature transport is automatic, and on a single CUDA node auto resolves to CPU transport. The MI355X selection explicitly emits CPU transport, matching its image-serving check. CUDA IPC is opt-in: pass --mm-feature-transport cuda_ipc when lower transfer latency matters more than the GPU memory the IPC pool reserves. CUDA VMM transport applies only to multi-node GB200/GB300 systems on the MNNVL fabric, where auto selects it.
3. Advanced usage
3.1 Reasoning
Thinking is enabled by the checkpoint’s generation configuration, and generated commands enable--reasoning-parser auto (which resolves to glm45 for GLM-5.3-Flash) by default. The OpenAI-compatible API then places thinking in message.reasoning_content and the final answer in message.content. You can disable Reasoning Parser in the Playground when an integration needs the raw response format.
To disable thinking for a request, pass chat_template_kwargs: {"thinking": false} in the request body.
3.2 Tool calling
Generated commands enable--tool-call-parser auto (which resolves to glm47 for GLM-5.3-Flash) by default, so structured calls are returned in message.tool_calls. You can disable Tool Call Parser in the Playground when tool calling is not needed. On follow-up turns, read both reasoning_content and content because a thinking model can use either field around tool execution.
3.3 Multimodal serving
The base recipes accept image and video content through the OpenAI-compatible chat API. Keep the processor defaults unless you have measured a different sampling or resize policy. Inputs above the video token budget are clamped to the processor’s limit rather than rejected.3.4 Encoder disaggregation
Encoder disaggregation separates vision preprocessing from language inference. The verified topology uses one 4x GB300 node shared by an encoder-only TP4 process on port 30001 and a language-only TP4 process on port 30000. Start the encoder first.Encoder server (GB300)
Encoder server (GB300)
Command
Language server (GB300)
Language server (GB300)
Command
--mem-fraction-static 0.78 on the language process so the encoder retains room for vision workspaces.
Install torchcodec for video and see the encoder disaggregation guide for the generic architecture and operational model.
3.5 Prefill Context Parallelism
Use prefill context parallelism (CP) to distribute DSA prefill computation for long prompts, including multimodal inputs. This hybrid model uses interleave CP for DSA layers and head-wise tensor parallelism for KDA layers, sharing the same communication group. Layer boundaries all-gather the context shards before KDA and reduce-scatter its output back onto those shards. The mHC residual streams and their coefficients stay local, with each output’s reduction completed before the residual update. In the Playground’s Attention card, select TP=8 and CP=8 on B300 or B200 to add--attn-cp-size 8 --enable-prefill-cp --cp-strategy interleave. For CP4, set TP=4 and CP=4. With CP enabled, the MoE card restricts EP to 1 or the CP size; an incompatible EP selection falls back to 1. Choosing EP=CP also adds --moe-dense-tp-size with the CP size. Prefill CP and PD disaggregation cannot be enabled together for this model.
Example of launching with Prefill CP on Blackwell GPU
Example of launching with Prefill CP on Blackwell GPU
Command
3.6 PD disaggregation (preview)
PD splits prefill and decode into separate server groups behind a router. For this hybrid model, the transfer moves both the paged DSA KV and the KDA recurrent state. The Playground’s PD Disagg card defaults to Off, with Mooncake as its only transfer backend. Select Prefill or Decode to add--disaggregation-mode prefill or --disaggregation-mode decode, respectively, together with --disaggregation-transfer-backend mooncake. Selecting either role disables prefill CP. The generated prefill and decode commands use ports 30000 and 30100, respectively.
PD serving on 4x GB300 (single node)
PD serving on 4x GB300 (single node)
Prefill (GPU 0-1)
Decode (GPU 2-3)
Router
- Give each role a distinct
--nccl-portwhen both share one node. - Single-node NIXL needs
UCX_NET_DEVICES=loandUCX_TLS=tcp,cuda_copy,cuda_ipc,self,smin both server environments. - The validated arm used the triton MoE runner; the flashinfer_trtllm runner from the deployment recipes is untested under PD.
- Speculative decoding does not start under PD at the current cut (draft-graph capture width assert on the prefill role; decode-side memory pressure at TP2). Run PD without speculative flags.
- Prefill and decode with different TP sizes transfer state through slice paths, but numeric correctness is unverified. Keep both roles at the same TP size.
