MEASURED·3 min read·Sep 3, 2026

DeepSeek-V4-Flash-Vision on 4× DGX Spark

This recipe serves DeepSeek-V4-Flash-Vision-Exp, a model that also reads images, on four DGX Spark GB10 nodes with vLLM. It writes 66–71 tokens per second, each request can hold 393K tokens, and the fleet holds 3.45M tokens of conversation at once.

4× DGX Spark GB10 · TP4/EP4 · vLLM 3.73-vision · aidendle94/sparkrun-vllm-ds4-gb10:production-3.73-vision · measured Sep 3, 2026

  • DeepSeek-V4-Flash
  • vLLM
  • multi-node
  • TP4
  • DCP
  • DGX Spark
  • FP8
  • MoE
67.9tok/sDecodeOne stream, code prompts
393KtokensContext3 streams of 56K tokens at once passed the coherence check
3.45MtokensKV poolRoom for 8.78 full-length contexts at once

01Overview

What you need
  • 4× DGX Spark GB10 nodes, linked by a 200G RoCE network
  • The container image aidendle94/sparkrun-vllm-ds4-gb10:production-3.73-vision (Docker Hub)
  • The deepseek-ai/DeepSeek-V4-Flash-Vision-Exp weights (they include the draft model)
  • About 120 GB of free disk space per node
  • Root access on every node
  • earlyoom or another out-of-memory guard on every node

This recipe serves DeepSeek-V4-Flash-Vision-Exp, a model that also reads images, on four DGX Spark GB10 nodes with vLLM. It runs tensor parallel across the four nodes (TP4) with decode context parallel (DCP2) and DSpark speculative decoding. Reasoning is on by default.

Image handling matches the vision support of upstream vLLM (PR #54566). The kernels are the sparkinfer B12X kernels.

02Build

Memory settings

  • Leave KV_CACHE_MEMORY_BYTES= empty, or an inherited value caps the pool at about 26 GB per rank.
  • On every node, set this memory floor and persist it 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.

Per-node deployment

Each node runs one container with its own .env file.

.env · per node (production values)
IMAGE=aidendle94/sparkrun-vllm-ds4-gb10:production-3.73-vision
MODEL_HOST_PATH=<path-to>/models--deepseek-ai--DeepSeek-V4-Flash-Vision-Exp
CACHE_HOST_PATH=<writable-jit-cache-dir>
SERVED_MODEL_NAME=deepseek-v4-vision
API_PORT=8300
NNODES=4  TP_SIZE=4
MASTER_ADDR=<head-fabric-ip>  MASTER_PORT=29511
VLLM_HOST_IP=<this-node-fabric-ip>          # differs per node
FABRIC_IFACE=<fabric-iface>  IB_HCA=<rdma-device>  IB_GID_INDEX=<resolved-at-boot>

# layout: TP4 across the nodes, DCP2 inside it
DCP_SIZE=2
DCP_COMM_BACKEND=ag_rs                       # +12% KV over a2a, decode within noise
KV_CACHE_MEMORY_BYTES=                       # empty on purpose: unpins the ~26 GB cap
GPU_MEMORY_UTILIZATION=0.75                  # 0.82 gets a worker killed by earlyoom
MAX_MODEL_LEN=393216  MAX_NUM_SEQS=8  MAX_NUM_BATCHED_TOKENS=8192

# speculative decoding
VLLM_ENABLE_DSPARK=1  VLLM_ENABLE_MTP=0
NUM_SPECULATIVE_TOKENS=6
DSPARK_DRAFT_SAMPLE_METHOD=greedy  DSPARK_SPS_CURVE=auto
MAX_CUDAGRAPH_CAPTURE_SIZE=56                # = MAX_NUM_SEQS × (spec tokens + 1)
VLLM_CUDAGRAPH_MODE=FULL_AND_PIECEWISE

# prefill gather (required for images under DCP)
VLLM_DSV4_CKV_GATHER=1
VLLM_DSV4_CKV_GATHER_MAX_TOKENS=393216
VLLM_DSV4_CKV_ALLOW_IMAGES=1

ENABLE_PREFIX_CACHING=1
VLLM_DSV4_DCP_PREFIX_CACHE=1                 # unset = 3.72 behaviour
VISION_MHC=1
vllm serve · what the launcher generates
vllm serve <model-snapshot> \
  --served-model-name deepseek-v4-vision --host 0.0.0.0 --port 8300 \
  --trust-remote-code --distributed-executor-backend mp \
  --nnodes 4 --node-rank $RANK --master-addr $HEAD_IP --master-port 29511 \
  --tensor-parallel-size 4 \
  --decode-context-parallel-size 2 --dcp-comm-backend ag_rs \
  --attention-backend B12X_MLA_SPARSE --moe-backend b12x --linear-backend b12x \
  --kv-cache-dtype fp8 --block-size 256 \
  --gpu-memory-utilization 0.75 \
  --max-model-len 393216 --max-num-seqs 8 --max-num-batched-tokens 8192 \
  --max-cudagraph-capture-size 56 \
  --compilation-config '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"],"cudagraph_capture_sizes":[1,2,3,4,5,6,7,11,15,...,56]}' \
  --async-scheduling --no-scheduler-reserve-full-isl --enable-chunked-prefill --enable-prefix-caching \
  --tokenizer-mode deepseek_v4 \
  --tool-call-parser deepseek_v4 --enable-auto-tool-choice \
  --reasoning-parser deepseek_v4 \
  --reasoning-config '{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}' \
  --default-chat-template-kwargs.thinking=true \
  --speculative-config '{"method":"dspark","num_speculative_tokens":6,"draft_sample_method":"greedy", ...}' \
  --disable-chunked-mm-input --limit-mm-per-prompt '{"image": 4}'
  1. Drop the page cache on every node. Start the three workers, then the head. The server is healthy after about 10 minutes.
  2. Check rank 0: GPU KV cache size about 3.5M tokens, acceptance length 3.5–3.8 tokens per step.
  3. The first image request compiles a kernel for about 6 s. Later ones take about a second.
  4. Send one long prompt twice. vllm:prefix_cache_hits_total in /metrics should rise by about the prompt length. Zero hits means that the container did not receive VLLM_DSV4_DCP_PREFIX_CACHE=1.
image request · OpenAI-compatible
{"model": "deepseek-v4-vision",
 "messages": [{"role": "user", "content": [
   {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}},
   {"type": "text", "text": "What animal is this? Two sentences."}]}],
 "max_tokens": 160, "temperature": 0,
 "chat_template_kwargs": {"thinking": false}}

# The answer (352 prompt tokens, 1.2 s once the partition kernel is compiled):
# "This is a brown and black tabby cat with striking green eyes. It is sitting
#  upright on a textured white ledge, with blurred bare branches visible in the
#  background."

03Performance

Measured2026-09-04. The model runs on four nodes (TP4) with the KV cache split two ways (DCP2), DSpark decoding, images and prefix caching on. Image: aidendle94/sparkrun-vllm-ds4-gb10:production-3.73-vision.

Decode67.9tok/sOne stream, code prompts
Cold prefill2,380tok/sA new 92K-token prompt takes 38.8 s
Warm prefill60,249tok/sThe same 92K-token prompt sent again takes 1.5 s
KV pool3.45MtokensRoom for 8.78 full-length contexts at once
Context393Ktokens3 streams of 56K tokens at once passed the coherence check
Prefix-cache hit95–100%An identical prompt of 9K–92K tokens sent again
Image request~1.2sAn image prompt of 200–350 tokens, once the kernel is compiled
Prefill by prompt size, cold and warmtok/s · higher is better
cold (first send)warm (prefix already in the cache)
2.6K tokens1,2451,956+57%
9.2K tokens1,9796,5303.3×
33K tokens2,35023,3779.9×
92K tokens2,38060,24925×

Each prompt was sent twice.

Changelog · production-3.72-vision → production-3.73-vision

production-3.72-visionproduction-3.73-vision
Prefix cachingOffOpt-in with VLLM_DSV4_DCP_PREFIX_CACHE=1, hits on 512-token boundaries
Decode, cold prefill66–71 tok/s decodeUnchanged
Warm prefill (repeated prefix)None6,530 / 23,377 / 60,249 tok/s at 9K / 33K / 92K tokens
KV pool3,508,513 tokens3,452,405 tokens (−1.6%)
ValidationDecode, long-context, vision and stress testsThe same, without the long stress suite
Known open items—One warm answer differed from its cold one, one cache hit one block short

Same weights, same nodes.

Across recipes

Single-stream decode, by recipetok/s · higher is better
Inkling-2-Small · 4-bit KV cache (experimental)56.9
Inkling-2-Small · SGLang (experimental)55.6
DeepSeek-V4.1-Flash · SGLang (1.8)96.5
DeepSeek-V4.1-Flash (1.1, DCP2)60.8
GLM-5.3-Flash (1.2)89.7
DeepSeek-V4-Flash (3.76.1)71.0
DeepSeek-V4-Flash-Vision (3.73)shipped67.9

One request at a time. Inkling-2-Small at temperature 1.0, the others at temperature 0.

Cold prefill, by recipetok/s · unique content · higher is better
Inkling-2-Small · 4-bit KV cache (experimental)2,840
Inkling-2-Small · SGLang (experimental)2,615
DeepSeek-V4.1-Flash · SGLang (1.8)4,892
DeepSeek-V4.1-Flash (1.0)2,143
GLM-5.3-Flash (1.2)2,070
DeepSeek-V4-Flash (3.76.1)2,200
DeepSeek-V4-Flash-Vision (3.73)shipped2,380

Prompts the server has not seen.

LayoutDecodeCold prefill of a 334K-token promptKV pool
DSpark, DCP off (as in the text-only deployment)73.8–75.2 tok/s2,170 tok/s1,769,706 tokens (4.5×)
DCP2 without speculative decoding34 tok/s2,119 tok/s4,041,732 tokens (10.3×)
DSpark + DCP2 (shipped)66–71 tok/s2,088 tok/s3,508,513 tokens (8.9×)

Three 400-token code completions at temperature 0 on 3.72-vision. (×) = full 393,216-token contexts in the pool.

04Notes

Known problems

  • An image request without the gather stops the whole engine.Pass VLLM_DSV4_CKV_ALLOW_IMAGES through the compose file into the container on every node.
  • Do not copy a .env file from one node to another.A worker with the head's file binds to the wrong address.
  • Benchmark prefill with new text every time.With prefix caching on, a repeated prompt comes from the cache.
  • Stop processes by PID file, never by pattern.pkill -f can stop its own shell.
  • A hot GPU can reset its node during a long prefill, without a trace.A clock cap at 2,176 MHz cooled one such GPU from 87–89 °C to 69 °C, at 1.2% of prefill speed.
  • Image padding differs from the reference.This port always puts 3 padding tokens before an image. The reference uses 3 − position mod 4.