# GLM-5.3-Flash on 4× DGX Spark

Status: production. Measured: 2026-08-31 (page updated 2026-09-10). Web page: https://aidenle.com/recipes/glm-5-3-flash-4x-dgx-spark/
Image: `aidendle94/sparkrun-vllm-glm53-gb10:production-1.2`

GLM-5.3-Flash on four DGX Spark GB10 nodes with vLLM. One request at a time is answered at about 90 tokens per second (tok/s), and one request can hold 393K tokens of context.

**Time:** About 30 min per node, plus 10 to 15 min for the first boot

**Result:** 4 nodes: about 90 tok/s for one request, 393K-token context, 1.69M-token KV pool

## What you need

- 4× DGX Spark GB10 nodes, each with two 200 Gb/s RoCE network links.
- The Docker image aidendle94/sparkrun-vllm-glm53-gb10:production-1.2.
- The weights unsloth/GLM-5.3-Flash-FP8 (328 GB).
- The draft model incoai/GLM-5.3-Flash-DFlash2 (2.34 GB).
- About 340 GB of free disk space per node.
- Root access on every node.

## Overview

This recipe serves GLM-5.3-Flash on four DGX Spark GB10 nodes with vLLM. Every layer of the model is split across the four nodes (tensor parallel, TP4), and each node has two 200 Gb/s RoCE links to the others.

It builds on [tonyd2wild's NVFP4 1M-KV recipe](https://github.com/tonyd2wild/GLM-5.3-Flash-NVFP4-1M-KV-4x-DGX-Spark) for the attention setup and on [FujitsuPolycom's TP4 Spark recipe](https://github.com/FujitsuPolycom/glm53-flash-tp4-spark) for the network settings.

## Build

### Keep memory free for the GPU

- Flush the page cache on every node before every boot, and keep exactly one flusher running on each node that drops it at a low rate.
- Pin the size of the KV cache with `--kv-cache-memory-bytes`. production-1.2 pins it at 12 GiB.
- **Set a memory floor on every node** with six sysctl settings, and persist them in `/etc/sysctl.d/`: `vm.min_free_kbytes=1048576`, `vm.dirty_bytes=536870912`, `vm.dirty_background_bytes=134217728`, `vm.dirty_expire_centisecs=500`, `vm.dirty_writeback_centisecs=100`, `vm.swappiness=10`. Do not raise the floor to 2 GiB.
- Do not run downloads or other large writes on a serving node.

### Start the container on each node

Run one container on each node. Set the network values for your site. `NCCL_IB_HCA` must list **both** RoCE devices.

docker run · per node:

```bash
# Your fabric: set NCCL_IB_HCA through VLLM_HOST_IP per cluster and per node.
#   NCCL_IB_HCA lists both RoCE devices, e.g. rocep1s0f0,roceP2p1s0f0
docker run -d --name glm53flash \
  --network host --ipc host --shm-size 32g --gpus all \
  --cap-add IPC_LOCK --ulimit memlock=-1:-1 \
  --memory 112g --memory-swap 112g \
  --device /dev/infiniband:/dev/infiniband \
  -v $HOME/.cache/huggingface:/cache/huggingface \
  -e HF_HOME=/cache/huggingface \
  -e NCCL_IB_HCA=<dev0>,<dev1> \
  -e NCCL_SOCKET_IFNAME=<your-fabric-iface> \
  -e GLOO_SOCKET_IFNAME=<your-fabric-iface> \
  -e VLLM_HOST_IP=<this-node-fabric-ip> \
  -e NCCL_IB_ROCE_VERSION_NUM=2 \
  -e NCCL_IB_ADDR_FAMILY=AF_INET \
  -e NCCL_IB_ADDR_RANGE=10.0.0.0/24 \
  -e NCCL_NET=IB -e NCCL_IB_DISABLE=0 \
  -e NCCL_ALGO=Ring -e NCCL_PROTO=LL,LL128,Simple \
  -e NCCL_SKIP_TREE_CONNECT=1 \
  -e NCCL_IB_SUBNET_AWARE_ROUTING=1 -e NCCL_IB_SUBNET_PREFIX_LEN=24 \
  -e NCCL_IB_MERGE_NICS=0 -e NCCL_P2P_LEVEL=SYS -e NCCL_NET_PLUGIN=none \
  -e NCCL_MAX_NCHANNELS=4 -e NCCL_MIN_NCHANNELS=4 \
  -e NCCL_CROSS_NIC=1 -e NCCL_CUMEM_ENABLE=0 -e NCCL_IGNORE_CPU_AFFINITY=1 \
  -e TORCH_USE_RTLD_GLOBAL=1 -e TORCHINDUCTOR_COMPILE_THREADS=1 \
  -e CUTE_DSL_ARCH=sm_121a -e TORCH_CUDA_ARCH_LIST=12.1a \
  -e PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
  -e VLLM_ENGINE_READY_TIMEOUT_S=3600 -e VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 \
  aidendle94/sparkrun-vllm-glm53-gb10:production-1.2 \
  bash -lc 'unset VLLM_PREFIX_CACHE_RETENTION_INTERVAL; exec <the serve command below>'
```

> **`VLLM_PREFIX_CACHE_RETENTION_INTERVAL` must be unset.**
>
> The container command unsets it.

### The serve command

Before any boot, run `sync && echo 3 > /proc/sys/vm/drop_caches` on **every** node. Start ranks 1 to 3 first and rank 0, on the head node, last. A full start takes about 15 minutes with the FP8 checkpoint.

vllm serve · rank 0:

```bash
# --reasoning-parser through --default-chat-template-kwargs: client flags (see Notes).
vllm serve <path-to>/GLM-5.3-Flash-FP8 \
  --served-model-name <your-alias> --host 0.0.0.0 --port 8210 \
  --trust-remote-code \
  --tensor-parallel-size 4 \
  --nnodes 4 --node-rank $RANK --master-addr $HEAD_IP --master-port 29513 \
  --distributed-executor-backend mp --disable-custom-all-reduce \
  --distributed-timeout-seconds 240 --cpu-distributed-timeout-seconds 3600 \
  --reasoning-parser glm45 \
  --tool-call-parser glm47 --enable-auto-tool-choice \
  --chat-template <path-to>/chat_template_mm.jinja \
  --default-chat-template-kwargs '{"enable_thinking": true, "reasoning_effort": "high"}' \
  --kv-cache-dtype fp8_e4m3 \
  --block-size 2304 \
  --moe-backend marlin \
  --max-model-len 393216 --max-num-batched-tokens 8192 --max-num-seqs 16 \
  --enable-chunked-prefill \
  --gpu-memory-utilization 0.85 \
  --kv-cache-memory-bytes 12884901888 \
  --speculative-config '{"method":"dflash","model":"<path-to>/GLM-5.3-Flash-DFlash2","num_speculative_tokens":7}'
```

- Keep `--gpu-memory-utilization 0.85`.

### Which image tag to use

- `production-1.2` is the current image.
- `production-1.0` drafts with the MTP head instead of DFlash2. Pass `'{"method":"mtp","num_speculative_tokens":5}'` as `--speculative-config`.

## Performance

> **The decode figures were measured with thinking **off**.**
>
> The shipped default is thinking **on** at High effort.

Measured: 2026-09-04

The model runs on four nodes (TP4) with FP8 weights and the DFlash2 drafter, thinking on at High by default.

| Measurement | Value | Note |
|---|---|---|
| Decode | 88.5–89.7 tok/s | One stream, structured output, thinking off |
| Decode · code | 80.7 tok/s | Thinking off |
| Prefill | 2,045–2,150 tok/s | New prompts of 32K–128K tokens |
| TTFT | 4 → 40 s | Time to first token, from 8K to 94K tokens of context |
| KV pool | 1.69M tokens | Room for 4.29 full-length contexts at once |
| Context | 393K tokens | Checked with a prompt of 386,159 tokens |
| Answer agreement | 30/30 | Greedy answers of 1.2 match those of 1.1 on keyed test prompts |

**Decode by output type, thinking off** (tok/s · one stream · higher is better)

|  | production-1.1 (no CUDA graphs, 16 GiB KV) | production-1.2 (CUDA graphs, 12 GiB KV) |
|---|---|---|
| structured | 86.4 | 89.7 |
| alphabet | 86.2 | 89.6 |
| code | 75.3 | 80.7 |
| freeform prose | 28.5 | 33.8 |

**Changelog: production-1.1 → production-1.2**

|  | production-1.1 | production-1.2 |
|---|---|---|
| CUDA graphs | Off (`--enforce-eager`) | On, decode 4–19% faster |
| `--kv-cache-memory-bytes` | 16 GiB per rank, 2,252,384 tokens | 12 GiB per rank, 1,688,835 tokens |
| Prefill | 2,073–2,124 tok/s at 32K–128K tokens | 2,045–2,150 tok/s, within noise |
| Weights, drafter, flags | unsloth FP8 weights, the DFlash2 drafter, thinking on at High | Unchanged |
| Host memory floor | Kernel defaults | 1 GiB kept free, dirty pages capped at 512 MiB, against `cudaErrorNotPermitted` |

## Notes

### Three flags that matter only when a request arrives

| Missing flag | Symptom |
|---|---|
| `--reasoning-parser glm45` | The reasoning text appears in the answer (`message.content`). |
| `--tool-call-parser glm47 --enable-auto-tool-choice` | A tool-call request (`tool_choice: auto`) returns HTTP 400. |
| `--chat-template <mm template>` | An image request returns HTTP 500. |

Without these flags the server still starts and reports healthy.

### A node with a hot GPU can reset silently

If a node resets during long prefills, cap its GPU clock with `nvidia-smi -lgc 0,2176` (costs 1.2% of prefill speed).

### FP8 MLA does not work with DFlash2

> **Warning: No flag fixes it.**
>
> - Keep the plain `fp8_e4m3` KV cache, not `fp8_ds_mla`.

#### Operating advice

- **Run load tests in a planned window, never against production.**
- **Check liveness with `/health`, never with `/v1/models`.**
- **Arm a watchdog only after the first healthy response.**
- **Save the logs before you remove the containers.**
- **Do not hardcode `NCCL_IB_GID_INDEX`.**
- **Send `reasoning_effort` as `low` or `high`.** The chat template honours only those two. Any other value, or none, silently means maximum effort.
