DeepSeek-V4.1-Flash on 4× DGX Spark
This recipe serves DeepSeek-V4.1-Flash with vLLM on four DGX Spark GB10 nodes. It keeps the model's 203 GB of Engram tables on disk with patches from tonyd2wild and Kai, and splits the conversation memory between the nodes (DCP2/DCP4).
4× DGX Spark GB10 · TP4/EP4 · vLLM 1.1 · aidendle94/sparkrun-vllm-dsv41-gb10:production-1.1 · measured Sep 11, 2026
- DeepSeek-V4.1-Flash
- vLLM
- multi-node
- TP4
- DGX Spark
- FP8
- MXFP4
- MoE
01Overview
- Four DGX Spark GB10 nodes linked by a 200G RoCE network
- The image aidendle94/sparkrun-vllm-dsv41-gb10:production-1.2 from Docker Hub, with the patch set and the b12x RoCEnante runtime built in
- Or production-1.0 with the seven patch files from tonyd2wild/DeepSeek-V4.1-Flash-vLLM-DGX-Spark (MIT licence) bind-mounted over it
- The deepseek-ai/DeepSeek-V4.1-Flash weights (510 GB) on one node, shared over NFS with the other three. Or the 418 GB variant aidendle94/DeepSeek-V4.1-Flash-NVFP4-Engram
- About 50 GB of local NVMe disk per node for its Engram rows, plus about 25 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 vLLM. One request at a time, it writes 94.5 tok/s on a counting prompt and 74.5 tok/s on code. A request may hold up to 500K tokens, and the model accepts images and tool calls. Thinking is on: the model reasons before it answers.
Stock vLLM keeps the model's 203 GB of Engram tables in memory, so the model does not fit on four DGX Sparks. This recipe keeps the tables on disk and reads only the rows it needs.
02Build
Deploy one container per node
Run one container per node. Share the checkpoint from one node over NFS (network file system). Start the three workers first and the head, which runs rank 0 and serves the API, last. Thinking runs at reasoning_effort: max by default. A request sets its own level with any integer from 1 to 100, or turns thinking off with "thinking": false.
Pick the checkpoint in the selector below: the original with fp8 Engram tables, or the NVFP4-Engram variant.
Use the original 510 GB checkpoint. Keep about 50 GB of local disk per node for the Engram row copies.
# production-1.2 has the patch set built in. On production-1.0, add one -v per patch file after the /cache mount:
# -v <patches>/engram.py:/usr/local/lib/python3.12/dist-packages/vllm/models/deepseek_v4_1/common/engram.py:ro (etc., from mounts.txt)
# Set B12X_ROCE_GID_INDEX to this node's RoCE-v2 IPv4 entry, which is not always 3.
docker run -d --name dsv41vllm --restart no --network host --ipc host --shm-size 32g \
--memory 112g --memory-swap 112g --ulimit memlock=-1:-1 --cap-add IPC_LOCK \
--device /dev/infiniband:/dev/infiniband --oom-score-adj 500 --gpus all \
-v <hf-repo-dir>:/models/repo:ro -v <writable-cache-dir>:/cache \
-v <engram-local-dir>:/engram-local:ro -e DSV41_ENGRAM_DIR=/engram-local \
-e DSV41_ENGRAM_DISK=1 -e DSV41_ENGRAM_DISK_THREADS=32 -e DSV41_ENGRAM_DISK_CHUNK=16 \
-e DSV41_DCP_STAGE=3 -e DSV41_DCP_COMBINE=a2a -e DSV41_ENGRAM_MMAP=1 -e DSV41_ENGRAM_PREFETCH=1 -e DSV41_DCP_PREFILL_GATHER=1 \
-e VLLM_HOST_IP=<this-node-fabric-ip> -e HF_HUB_OFFLINE=1 -e VLLM_CACHE_ROOT=/cache/vllm \
-e TILELANG_CACHE_DIR=/cache/tilelang -e TRITON_CACHE_DIR=/cache/triton -e B12X_CACHE_DIR=/cache/b12x \
-e VLLM_USE_BREAKABLE_CUDAGRAPH=1 -e VLLM_USE_FLASHINFER_SAMPLER=0 -e VLLM_HAS_FLASHINFER_CUBIN=1 \
-e MAX_JOBS=2 -e FLASHINFER_NVCC_THREADS=1 -e PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
-e TORCH_CUDA_ARCH_LIST=12.1a -e FLASHINFER_CUDA_ARCH_LIST=12.1a -e FLASHINFER_DISABLE_VERSION_CHECK=1 \
-e NCCL_NET=IB -e NCCL_IB_HCA=<rdma-devices> -e NCCL_SOCKET_IFNAME=<fabric-iface> -e NCCL_IB_GID_INDEX=3 \
-e NCCL_IB_ROCE_VERSION_NUM=2 -e NCCL_ALGO=Ring -e NCCL_PROTO=LL,LL128,Simple -e NCCL_CUMEM_ENABLE=0 \
-e VLLM_ENABLE_ROCE_ALLREDUCE=1 -e VLLM_ROCE_ALLREDUCE_MAX_SIZE=1MB -e VLLM_ROCE_ALLGATHER_MAX_SIZE=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 B12X_ROCE_CACHE_DIR=/opt/b12x-roce/cache \
aidendle94/sparkrun-vllm-dsv41-gb10:production-1.2 /models/repo/snapshots/<snapshot> \
--served-model-name deepseek-v4.1-flash --host 0.0.0.0 --port 8410 \
--tensor-parallel-size 4 --decode-context-parallel-size 2 --dcp-comm-backend ag_rs \
--gpu-memory-utilization 0.80 --kv-cache-memory-bytes 6442450944 \
--max-model-len 500000 --max-num-seqs 8 --max-num-batched-tokens 8192 --block-size 128 \
--moe-backend b12x --engram-config '{"cpu_offload":false}' \
--default-chat-template-kwargs '{"thinking":true,"reasoning_effort":"max"}' \
--limit-mm-per-prompt '{"image":4}' --mm-processor-cache-gb 1 \
--tool-call-parser deepseek_v41 --enable-auto-tool-choice --reasoning-parser deepseek_v41 \
--speculative-config '{"method":"dspark","num_speculative_tokens":5,"draft_sample_method":"probabilistic","rejection_sample_method":"block","enable_adaptive_verification":false}' \
--compilation-config '{"cudagraph_mode":"FULL_AND_PIECEWISE","cudagraph_capture_sizes":[5,6,10,12,15,18,20,24,25,30,35,36,40,42,48]}' \
--distributed-executor-backend mp --nnodes 4 --node-rank 0 --master-addr <head-fabric-ip> --master-port 29551- Share the checkpoint's HuggingFace repository directory, not the snapshot, over NFS from the node that holds it (
ro,no_subtree_check). Mount it on the other nodes through fstab with_netdev,nofail. - Pull production-1.2 on every node. Set
B12X_ROCE_GID_INDEXfor each node: with a wrong value, the RoCE exchanges fall back to NCCL without an error. To turn them off, setROCE_AR=0in the launcher. - Boot once, and read the
Engram DISK mode: layer L rows [start, end)lines of each rank. Runengram_local.pyon each node with those ranges (about 6 minutes). Relaunch withDSV41_ENGRAM_DIRset, and every rank should logread from node-local. - Wait about 11 minutes for the fleet. Check that
GPU KV cache sizereads 1,888,800 tokens on DCP2 with 6 GiB, thatMemAvailableon the head is at least 5 GB, and that the log showsUsing 'B12X_MXFP4_MXFP8' Mxfp4 MoE backend. - Test the answers: count to 100, find a fact hidden in a 32K-token prompt, describe an image and make a tool call. Then send many unique requests at once.
curl -s http://<head>:8410/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}}'
# reasoning_content: "We need answer briefly. 91 = 7*13, not prime." (19 reasoning tokens)
# content: "No. 91 = 7 × 13, so it is not prime."03Performance
Measured2026-09-10 for 1.0, 2026-09-11 for 1.1 and 1.2. The model runs on four nodes (TP4) with DSpark decoding, and decode uses tonyd2wild's fixed prompt set: one stream, temperature 0, thinking off. Image: aidendle94/sparkrun-vllm-dsv41-gb10:production-1.1.
C is the number of streams started together.
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.
Headline numbers
| DCP2 (production-1.2) | DCP4 (production since 2026-09-11) | |
|---|---|---|
| KV pool at a 300K context limit | 1,888,800 tokens | 2,477,126 tokens |
| decode, one stream (counting / code / prose) | 90.7 / 63.6 / 34.4 tok/s | 90.7 / 63.5 / 31.3 tok/s |
| prefill 32K / 128K | 15.3 s / 61.0 s | 17.2 s / 67.6 s |
| 12-min soak test, 8 streams | 0 errors | 0 errors |
Four-node test fleet, prompts of unique content, decode one stream at a time.
NCCL against RoCE exchanges
| NCCL (same day) | RoCE (production since 2026-09-16) | |
|---|---|---|
| decode, one stream (counting / code / prose) | 85.6 / 49.9 / 25.8 tok/s | 94.5 / 74.5 / 35.9 tok/s |
| draft acceptance (tokens kept per step) | 3.10 | 3.56 |
| KV pool (tokens) | 3,418,145 | 3,418,145 |
One stream at a time, same fleet, same day.
04Notes
Operating notes and limits
- Watch MemAvailable, not the KV number.A KV size that leaves too little memory gives no error, so keep MemAvailable on the head above 5 GB.
- Weights over NFS need an fstab entry.Use fstab with
_netdev,nofail, because a mount made by hand is gone after a node reset. - A 1M-token context is untested.500K is tested, and a prefill that long starves any health check that expects an answer within seconds.
- Copy Engram rows while serving only with a rate limit.At 150 MB/s under live traffic, free memory did not move.
- Kill by process ID (PID), never by pattern.A
pkill -fwhose pattern matches the shell that runs it kills that shell too.