DeepSeek-V4.1-Flash on 4× DGX Spark with SGLang
DeepSeek-V4.1-Flash on four DGX Spark GB10 nodes with the SGLang team's unmodified image and a small MIT-licensed overlay. Against the vLLM recipe it reads prompts 30–45 % faster, writes answers at the same speed and holds a 23 % larger KV pool. It served the test fleet from 2026-09-17 until 2026-11-12.
4× DGX Spark GB10 · TP4/EP4 · SGLang 1.8 · aidendle94/sparkrun-sglang-dsv41-gb10:production-1.8 · measured Sep 17, 2026
- DeepSeek-V4.1-Flash
- SGLang
- multi-node
- TP4
- DGX Spark
- FP8
- MXFP4
- MoE
01Overview
- Four DGX Spark GB10 nodes linked by a 200G RoCE fabric
- The image aidendle94/sparkrun-sglang-dsv41-gb10:production-1.8 (arm64), or a build from the repository's Dockerfile
- The overlay repository (MIT licence), github.com/aidendle94/DeepSeek-V4.1-Flash-SGLang-4x-DGX-Spark
- The deepseek-ai/DeepSeek-V4.1-Flash-1017 weights (510 GB) on one node, shared read-only over NFS with the other three
- About 50 GB of local NVMe disk per node for its share of the Engram tables, plus about 34 GB for the image
- Root on every node, and the out-of-memory guard earlyoom
This recipe serves DeepSeek-V4.1-Flash on four DGX Spark GB10 nodes with SGLang. The model is split across the four nodes (tensor parallel, TP4). It is a mixture of experts (MoE), and its experts are divided four ways (expert parallel, EP4). Tool calls, image input and reasoning are on.
The engine is the SGLang team's unmodified image with a small MIT-licensed overlay of import hooks that makes the model fit on a Spark. It served the test fleet from 2026-09-17 to 2026-11-12. The fleet now runs Inkling-2-Small.
02Build
One container per node
Start the three workers first and the head node (rank 0) last. The repository's launcher does this, and with --dry-run it prints the four commands. The command below is for rank 0. The workers differ in --node-rank, in HOST_IP and in the source of their Engram rows.
# On the node that holds the checkpoint, use these instead of -e SPARK_ENGRAM_DIR=/engram-local:
# -e SPARK_ENGRAM_DIR=/models/repo/snapshots/<snapshot> -e SPARK_ENGRAM_ROWS=1:<lo>:<hi>,14:<lo>:<hi>
docker run -d --name sgldsv41 --restart no --network host --ipc host --cap-add IPC_LOCK --gpus all \
--shm-size 32g --memory 112g --memory-swap 112g --ulimit memlock=-1:-1 --ulimit stack=67108864 \
--device /dev/infiniband:/dev/infiniband --oom-score-adj 500 \
-v <hf-repo-dir>:/models/repo:ro -v <writable-cache-dir>:/root/.cache \
-v <engram-local-dir>:/engram-local:ro -e SPARK_ENGRAM_DIR=/engram-local \
-e SPARK_ENGRAM_MODE=hostnode -e SPARK_ENGRAM_EARLY=1 -e SPARK_ENGRAM_PREFETCH=1 -e SPARK_PAGE_CACHE_RELEASE=1 \
-e SPARK_LATE_TAIL_SKIP=1 -e SPARK_LATE_TAIL_SKIP_ALL=0 -e SPARK_ENGRAM_THREADS=64 -e SPARK_ENGRAM_MAX_IDS=131072 -e SPARK_MXFP8_BACKEND=b12x \
-e SPARK_SERVED_ALIASES=<other-model-ids,comma-separated> \
-e SPARK_ROCE_AR=1 -e SPARK_ROCE_AR_MAX=1MB -e SPARK_ROCE_AG_MAX=16MB \
-e B12X_ROCE_HCA=<rdma-devices> -e B12X_ROCE_GID_INDEX=<this-node-roce-v2-gid-index> -e B12X_ROCE_SPIN_LIMIT=300000000 \
-e SGLANG_ENABLE_DSV41_ENGRAM_HOST_TABLE=0 -e SGLANG_FLASHINFER_MOE_FUSED_FINALIZE=0 -e SGLANG_DSV41_REASONING_EFFORT=100 \
-e PYTORCH_CUDA_ALLOC_CONF=expandable_segments:False -e CUDA_DEVICE_ORDER=PCI_BUS_ID -e HOST_IP=<this-node-fabric-ip> \
-e NCCL_NET=IB -e NCCL_IB_DISABLE=0 -e NCCL_IB_HCA=<rdma-devices> -e NCCL_SOCKET_IFNAME=<fabric-iface> -e GLOO_SOCKET_IFNAME=<fabric-iface> \
-e NCCL_IB_ROCE_VERSION_NUM=2 -e NCCL_IB_ADDR_FAMILY=AF_INET -e NCCL_IB_ADDR_RANGE=<fabric-subnet>/24 -e NCCL_IB_SUBNET_PREFIX_LEN=24 -e NCCL_IB_GID_INDEX=<gid-index> \
-e NCCL_CROSS_NIC=1 -e NCCL_IB_MERGE_NICS=0 -e NCCL_IB_SUBNET_AWARE_ROUTING=1 -e NCCL_CUMEM_ENABLE=0 -e NCCL_P2P_DISABLE=1 -e NCCL_SHM_DISABLE=1 \
-e NCCL_BUFFSIZE=1048576 -e NCCL_LL128_BUFFSIZE=262144 -e NCCL_PROTO=^LL128 -e NCCL_MAX_NCHANNELS=8 \
--entrypoint python3 aidendle94/sparkrun-sglang-dsv41-gb10:production-1.8 -m sglang.launch_server \
--model-path /models/repo/snapshots/<snapshot> --served-model-name deepseek-v4.1-flash --trust-remote-code --load-format safetensors \
--tp 4 --ep-size 4 --nnodes 4 --node-rank 0 --dist-init-addr <head-fabric-ip>:20100 --host 0.0.0.0 --port 8210 \
--attention-backend dsv4 --moe-runner-backend flashinfer_mxfp4 --fp8-gemm-backend flashinfer_cutlass \
--mem-fraction-static 0.80 --chunked-prefill-size 4096 --context-length 524288 --max-running-requests 16 --cuda-graph-max-bs-decode 16 \
--random-seed 0 --enable-decoder-swa-bounded-replay --speculative-algorithm DSPARK --speculative-dspark-block-size 5 \
--tool-call-parser deepseekv41 --reasoning-parser deepseek-v41 --watchdog-timeout 1800 --min-free-slots-delay 1 \
--default-chat-template-kwargs '{"thinking":true}' --enable-metrics- Pull the image on every node, or build it from the repository's Dockerfile. Share the checkpoint's directory over NFS from the node that holds it. The repository's
launch/relaunch.shruns the steps below from rank 0, with a site file,launch/fleet.env. - Copy each rank's Engram rows to its node with
engram_local.pyfrom the vLLM recipe. The node that holds the checkpoint skips the copy and setsSPARK_ENGRAM_ROWS. - Keep
--fp8-gemm-backend flashinfer_cutlassin the command. - Wait about 10 minutes. Check that the log shows
RoCE collectives on: world=4, and runfree -gon every node. - Send a few test requests: a count to 20, a long prompt with one fact to find, an image, a tool call. Then start
launch/watchdog.sh, which relaunches the fleet when it stops answering.
curl -s http://<head>:8210/v1/chat/completions -H 'Content-Type: application/json' -d '{
"model": "deepseek-v4.1-flash", "max_tokens": 300, "temperature": 0,
"messages": [{"role": "user", "content": "Is 91 a prime number? Answer briefly."}],
"chat_template_kwargs": {"thinking": true, "reasoning_effort": 25}}'
# "thinking": false turns reasoning off.
# reasoning_effort takes low (50), high (75), max (100) or any integer from 1 to 100.03Performance
Measured2026-09-17 to 2026-10-18, releases 1.0 to 1.8. The model runs on four nodes (TP4, EP4) with an MIT-licensed overlay on SGLang, and decode is one stream, greedy, thinking off. Image: aidendle94/sparkrun-sglang-dsv41-gb10:production-1.8.
Same fleet, same weights.
tonyd2wild's fixed prompt set of eight categories
Changelog · vLLM production-1.2 (DCP4, RoCE) → SGLang + overlay production-1.0
| vLLM production-1.2 (DCP4, RoCE) | SGLang + overlay production-1.0 | |
|---|---|---|
| Engine | vLLM branch, 28 patch files in the image | lmsysorg/sglang:dev-dsv41, unmodified, 8 import hooks (MIT) |
| Prefill, 32K / 128K | 2,094–2,362 / 2,152 tok/s | 3,068 / 2,580 tok/s |
| Decode, counting / code / prose | 93 / 67 / 31 tok/s | 94 / 68 / 32 tok/s |
| KV pool | 3,418,145 tokens | 4,219,904 tokens |
| Context | 500,000 tokens | 524,288 tokens |
Same weights, same nodes.
Across recipes
One request at a time. Inkling-2-Small at temperature 1.0, the others at temperature 0.
Prompts the server has not seen.
How fast it runs
| Same fleet, V4.1-Flash-1017 | production-1.7.1 | production-1.8 |
|---|---|---|
| 32K-token needle of unique words, time to first token | 8.0 s | 6.6–6.7 s |
| 128K-token needle of unique words, time to first token | 45.0 s | 34.1–39 s |
| decode with one stream, counting / code / prose | ~108 / 93 / 37 tok/s | 114 / 96–100 / 35–36 tok/s |
| coding conversation of 10 turns over ~62K tokens, decode speed over the whole conversation | 65.9 tok/s | 65.5 tok/s |
Release 1.7.1 against 1.8: time to first token on a long prompt with one fact to find, and decode speed.
| Same nodes, same prompts, same day | SGLang + overlay (production-1.0) | vLLM production-1.2 (DCP4, RoCE) |
|---|---|---|
| prefill of 32K tokens of unique random words | 3,068 tok/s · 10.7 s | 2,094–2,362 tok/s · 14.2–15.5 s |
| prefill of 128K tokens of unique random words | 2,580 tok/s · 51.1 s | 2,152 tok/s · 60.5 s |
| decode with one stream (counting / code / prose, greedy, reasoning off) | 94.4 / 67.8 / 32.4 tok/s | 93.0 / 66.6 / 31.3 tok/s (best boot 94.5 / 74.5 / 35.9) |
| KV pool | 4,219,904 tokens (4.2–5.8M tokens across boots) | 3,418,145 tokens (6 GiB pinned per rank, DCP4) |
| context length | 524,288 tokens | 500,000 tokens |
First SGLang release against the vLLM recipe, on prompts unique to each run.
04Notes
Limits and operating notes
- The hooks fit only their nightly base image and raise an error at start if their target has moved.
- Free memory is thin during long prompts, and one stopped rank stops the whole fleet, so watch MemFree on every node, not MemAvailable.
- Set the RoCE-v2 GID index for each node, because a wrong index moves the exchanges back to NCCL.
- Never start a rank while the previous engine still holds the GPU, or the other three ranks hang until the watchdog timeout.