This is a reusable SparkRun v4 adaptation of Tony D's two-node DGX Spark deployment for GLM-5.3-Flash NVFP4 with DFlash2 speculative decoding.
Upstream credit: The container image, SM121 patches, launch settings, debugging work, and performance findings come from Tony D (
tonyd2wild) and contributors to GLM-5.3-Flash-NVFP4-DFlash2-2x-DGX-Spark. This Gist only translates that work into a portable SparkRun recipe. It is not an official upstream artifact.
SparkRun supplies each node's rank, rendezvous address and port, --nnodes,
and the worker's --headless flag through its native vllm-distributed
runtime. It detects cluster communication interfaces, so this recipe contains
no hostnames, IP addresses, cluster names, or NIC names.
- Exactly two NVIDIA DGX Spark nodes in a saved SparkRun cluster
- SparkRun 0.3.6 or newer
- SSH connectivity from the SparkRun control machine to both nodes
- Enough free local storage for the model on both nodes
Stop other GPU workloads before launching. Keep swap enabled as a safety
valve, set vm.swappiness=0, and drop filesystem caches on both nodes when
your sudo configuration permits it.
Run these commands on each DGX Spark:
hf download RedHatAI/GLM-5.3-Flash-NVFP4 \
--local-dir /var/tmp/glm-5.3-flash-nvfp4
hf download incoai/GLM-5.3-Flash-DFlash2 \
--local-dir /var/tmp/glm-5.3-flash-nvfp4/dflash2-draft
curl -fL \
https://raw.githubusercontent.com/tonyd2wild/GLM-5.3-Flash-NVFP4-DFlash2-2x-DGX-Spark/53912b4494bb04c71f381e1b0680ae4fa7747ce9/chat_template_mm.jinja \
-o /var/tmp/glm-5.3-flash-nvfp4/chat_template_mm.jinjaThe model directory must have the same absolute path on both nodes. SparkRun identity-mounts that path into each container instead of redistributing the large checkpoint at launch.
Run this on the same machine from which you invoke sparkrun run:
mkdir -p /var/tmp/sparkrun-patches/glm53-sm121
curl -fL \
https://raw.githubusercontent.com/tonyd2wild/GLM-5.3-Flash-NVFP4-DFlash2-2x-DGX-Spark/a5c4b197b2bd57d7be734b0ea17183e36fea962b/docker/sparse_attn_indexer_kpool_sm121.py \
-o /var/tmp/sparkrun-patches/glm53-sm121/sparse_attn_indexer_kpool_sm121.py
echo "8a3ecfb0bab2441dd7417ed00a10d142191496149f88e5fe79fcfaea4b160980 /var/tmp/sparkrun-patches/glm53-sm121/sparse_attn_indexer_kpool_sm121.py" \
| sha256sum -c -The recipe copies the directory, not the individual file, because
SparkRun 0.3.6 copy hooks use directory semantics. With no source_host, the
source is the control machine running SparkRun. The checksum is verified again
inside every container before installation.
If launch fails with rsync ... change_dir ... No such file or directory, the
patch was staged on a different machine or at a different path. Stage the
directory above on the machine that actually runs sparkrun run.
Skip this if you already have a suitable saved cluster:
sparkrun cluster create glm-tp2 \
--hosts HEAD_HOST,WORKER_HOST \
-d "2x DGX Spark GLM-5.3 TP2"Replace the placeholders with SSH-reachable names or addresses. Do not copy upstream hard-coded NIC or subnet values unless they match your fabric.
sparkrun recipe validate glm-5.3-flash-nvfp4-dflash2-tp2.yaml
sparkrun run glm-5.3-flash-nvfp4-dflash2-tp2.yaml \
--cluster YOUR_CLUSTERStartup commonly takes 10–15 minutes because checkpoint loading dominates. Use the engine health endpoint for readiness:
curl -f http://HEAD_HOST:8000/healthDo not use /v1/models as the readiness probe: it may return configuration
metadata before the engine core is healthy.
To follow both tensor-parallel ranks, get the job/cluster ID from sparkrun cluster status, then run:
sparkrun logs JOB_ID --cluster YOUR_CLUSTER --lines 200 --follow --all-sourcesPress Ctrl-C to detach from logs without stopping the workload.
The default vLLM multimodal profile reserved one maximum-size video with a 32,242-token encoder budget on the tested build. That consumed enough activation memory to leave only 1.05 GiB for KV cache, below the 2.65 GiB required to start with a 262,144-token context.
This recipe uses:
limit_mm_per_prompt: '{"video":0}'This keeps image input, disables video input.
Measured on one two-node DGX Spark cluster with this recipe:
- Encoder cache budget: 8,192 tokens
- Peak activation memory: 4.5 GiB per rank
- Available KV cache: 3.37 GiB per rank
- KV capacity: 330,861 tokens
- Maximum 262,144-token request concurrency: 1.26x
Treat the memory figures as observations, not guarantees; background memory, driver versions, and container builds can move them between boots.
The recipe deliberately omits --kv-cache-memory. A fixed KV allocation can
bypass activation-headroom accounting and boot successfully while remaining
unsafe under a long prompt. Let vLLM profile the available memory.
Add the model under an OpenAI-compatible provider in ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"spark-local": {
"npm": "@ai-sdk/openai-compatible",
"name": "DGX Spark (local cluster)",
"options": {
"baseURL": "http://HEAD_HOST:8000/v1",
"apiKey": "local"
},
"models": {
"glm-5.3-flash": {
"name": "GLM-5.3 Flash NVFP4 + DFlash2 (2-node)",
"reasoning": true,
"attachment": true,
"modalities": {
"input": ["text", "image"],
"output": ["text"]
},
"limit": {
"context": 262144,
"output": 16384
},
"variants": {
"low": { "reasoningEffort": "low" },
"high": { "reasoningEffort": "high" },
"max": { "reasoningEffort": "max" }
}
}
}
}
}
}Select it with /models, or launch OpenCode with:
opencode -m spark-local/glm-5.3-flashlow, high, and max are native GLM-5.3 reasoning levels. The OpenCode
AI-SDK option is camel-case reasoningEffort; the OpenAI-compatible provider
translates it to the API's reasoning_effort. With no variant, this recipe's
server default leaves thinking disabled for faster speculative decoding.
- Tensor parallelism: 2
- Context length: 262,144 tokens
- DFlash2 speculative tokens: 7
- KV cache: FP8 E4M3
- GPU memory utilization: 0.85
- Block size: 2304
- MoE backend: Marlin
- Maximum sequences: 6
- Maximum batched tokens: 8192
- Multimodal limit: 0 videos
- Tool parser:
glm47 - Reasoning parser:
glm45 - Thinking disabled by default; OpenCode variants enable native reasoning
If you use different model, draft, cache, or patch paths, update every matching
path in the YAML. In particular, model:, speculative_config,
--chat-template, the cache volume, and both patch-hook paths must remain
consistent.