DGX Spark/Guides/Long context
Models · November 2026

DGX Spark long context: how decode speed and prefill time change from 4k to 128k tokens

By Samuel Seidel · Published November 7, 2026 · Sources checked November 7, 2026

On a DGX Spark, long context costs some models almost nothing and others most of their speed. SparkBench reports Qwen3-Coder-Next decoding at 58.9 tok/s after a 4k fill and 55.0 tok/s after 100k, while Qwen3.8-27B with speculative decoding drops from 38.1 to 10.7 tok/s (vLLM and SGLang runs, July to October 2026). Prefill also slows with depth: llama.cpp processes gpt-oss-120b prompts at 2,444 tok/s on an empty context and 1,567 tok/s at 32k, so by my calculation a 100k-token prompt takes about 76 seconds before the first token. At 128k, the BF16 KV cache ranges from 1 GiB (Nemotron-3-Super-120B) to 40 GiB (Llama 3.3 70B).

Model (attention layout)Quant, engine4k50k100kSourceDate
Qwen3-Coder-Next, 80B-A3B (12 of 48 layers full attention)NVFP4, vLLM, FP8 KV58.956.355.0SparkBench2026-07-10
Gemma 4 26B-A4B (5 of 30 layers global, rest 1,024-token window)vLLM, FP8 KV23.022.021.4SparkBench2026-07-10
Qwen3.6-35B-A3B (10 of 40 full attention)NVFP4 + MTP n3, vLLM (eugr 1ea84d74b), FP8 KV86.378.831.5SparkBench2026-08-04
Qwen3.8-Flash-Next FP4-LocalFP4 + MTP, TensorFold, FP8 KV45.422.613.8SparkBench2026-10-19
Qwen3.8-27B dense (16 of 64 full attention)NVFP4 + DFlash2 n8, SGLang, FP8 KV38.119.110.7SparkBench2026-09-10
DeepSeek V4 Flash 0731EXL3 + DSpark draft, SparkInfer23.426.08.4SparkBench2026-08-23

Single-stream decode in tok/s after a fixed context fill, one GB10 node, read 7 November 2026. Layer counts are from each model's config.json (linked in the KV section). SparkBench does not explain why the DeepSeek row is faster at 50k than at 4k, and does not list engine versions for most rows. SparkBench lists no speculative draft for the Gemma row; other Gemma 4 reports on this site, with MTP, are higher.

How much does decode slow down at long context?

Between 7% and 72% from 4k to 100k in the SparkBench rows above. The pattern I see, which is my reading and not SparkBench's: the two rows without a speculative draft barely move, and every row with MTP, DFlash or DSpark loses half or more of its speed by 100k.

The mechanism behind the plain rows is bandwidth. Each new token reads the active weights once and then the entire KV cache, so the cache adds bytes to every step. llama.cpp's own DGX Spark llama-bench results (build 7941, February 2026) show it with full-attention and sliding-window models:

Model (llama.cpp, build 7941)tg32 at 0at 8kat 16kat 32kDrop at 32k
gpt-oss-120b, MXFP458.7252.8749.4542.7627%
gpt-oss-20b, MXFP483.4375.2270.3661.6526%
Qwen3-Coder-30B-A3B, Q8_061.0648.0240.2330.2151%
GLM-4.7-Flash, Q8_048.6842.5938.7232.6533%

Token generation in tok/s at each context depth, from the llama.cpp repository's DGX Spark page (system info dated 5 February 2026). Drop percentages are my arithmetic.

A worked check. gpt-oss-120b reads about 3 GB of weights per token (about 5B active parameters at MXFP4, per the decode arithmetic on the benchmarks page). Its KV cache costs 36 KiB per token (18 full-attention layers x 8 KV heads x 64 dims x 2 for K and V x 2 bytes), so at 32,768 tokens it is 1.2 GB. Reads per token rise from 3 GB to 4.2 GB, predicting 58.72 x 3 / 4.2 = 41.9 tok/s. llama.cpp measured 42.76. Qwen3-Coder-30B-A3B keeps 96 KiB per token in all 48 layers, so its F16 cache at 32k is 3.2 GB, about the same as its roughly 3 to 3.5 GB of Q8_0 active weights. The prediction is a near halving, 29 to 32 tok/s; measured, 30.21.

Speculative rows break this arithmetic because they verify several drafted tokens per weight read. My guess, untested, is that both the draft acceptance rate and the attention cost per verified token get worse deep in a long context, which removes most of the gain. If you run long contexts, benchmark with speculation on and off at your real fill.

How long does prefill take for a 100k-token prompt?

About 45 seconds to 4 minutes on one Spark for the models llama.cpp benchmarked, by my calculation below. Long prompts hurt more than long answers here, because prefill rate falls as the context grows.

llama.cpp's results give prefill (pp2048) at five depths. Per-token time rises almost linearly with depth, since each new token attends to all the tokens before it. Fitting t(d) = a + b x d through the 0 and 32k points (it predicts the 16k point within 3%) and summing over the prompt gives total time T(N) = a x N + b x N² / 2.

Modelpp2048 at 0at 32k100k prompt (calc)131,072 prompt (calc)
gpt-oss-20b, MXFP44,5062,68945 s68 s
gpt-oss-120b, MXFP42,4441,56776 s114 s
Qwen3-Coder-30B-A3B, Q8_02,9871,34896 s151 s
GLM-4.7-Flash, Q8_02,364567247 s407 s

Measured columns in tok/s from llama.cpp's DGX Spark page, build 7941. Calculated columns are my extrapolation beyond the measured 32k, single request, no prefix cache. For gpt-oss-120b, a = 1/2,444 s and b = 7.0 x 10^-9 s per token per token.

The extrapolation holds up against a longer measured run. On the same model family in vLLM 0.27.1, the GPUwerk benchmarks page records Qwen3-Coder-30B-A3B (AWQ) filling its full 262,144-token context in 447 seconds, an average of 586 tok/s. The llama.cpp fit predicts 514 seconds for that length at Q8_0. Same order, and vLLM a little faster.

Two multi-node reports for scale. DeepSeek-V4-Flash on two Sparks with vLLM 0.21.1 and FP8 KV took 2.4 minutes to the first token at a 240K fill and 16.6 minutes at 980K, while decode held 39.4 and 30.4 tok/s (NVIDIA forum, 4 June 2026; more on that model in the DeepSeek-V4-Flash notes). On an eight-Spark DeepSeek V4.1 Flash cluster, jameslacroix reports that with 100K coding contexts, going from 4 to 8 concurrent requests raised median time to first token from 64 to 114 seconds: long prefills block other users even when slots are free.

How much KV cache memory does each model need at 128k?

From 1 GiB to 40 GiB at BF16 for one 131,072-token sequence, depending on how many layers keep a full-length cache. The formula is bytes per token = 2 (K and V) x full-attention layers x KV heads x head dimension x bytes per value. Hybrid models keep a cache only on their attention layers; their linear-attention layers hold a fixed-size state instead.

ModelCached layers x KV heads x head dimPer token, BF16128k, BF16128k, FP8config.json
Llama 3.3 70B80 x 8 x 128320 KiB40.0 GiB20.0 GiBlink
Qwen3-Coder-30B-A3B48 x 4 x 12896 KiB12.0 GiB6.0 GiBlink
Qwen3.8-27B16 of 64 x 4 x 25664 KiB8.0 GiB4.0 GiBlink
gpt-oss-120b18 of 36 x 8 x 64 (others: 128-token window)36 KiB4.5 GiB2.25 GiBlink
Qwen3-Coder-Next12 of 48 x 2 x 25624 KiB3.0 GiB1.5 GiBlink
Qwen3.6-35B-A3B10 of 40 x 2 x 25620 KiB2.5 GiB1.25 GiBlink
Gemma 4 26B-A4B5 of 30 x 2 x 512 (others: 1,024-token window)20 KiB2.5 GiB + 200 MiB window1.25 GiB + windowlink
Nemotron-3-Super-120B-A12B8 of 88 x 2 x 128 (rest Mamba-2 and MoE)8 KiB1.0 GiB0.5 GiBlink

My calculation from the config.json values, per sequence; 128k = 131,072 tokens. Gemma 4's config sets attention_k_eq_v, which may let an engine store one tensor instead of two on global layers; I counted both, so treat its row as an upper bound. The sliding-window caches are fixed in size: about 4.5 MiB for gpt-oss-120b and 200 MiB for Gemma at BF16. Qwen3.6-35B-A3B's 30 linear-attention layers hold about 31 MB of BF16 state per sequence regardless of length (30 x 32 value heads x 128 x 128 x 2 bytes, my estimate). gpt-oss-120b's native maximum is 131,072 tokens.

Against 128 GB of unified memory, none of these is a capacity problem for one user; Llama 3.3 70B at 40 GiB plus about 40 GB of 4-bit weights is the only one that takes a large share. The cache matters for concurrency (multiply by users) and, as shown above, for decode speed. The memory calculator does the same sum for other models and context lengths, and the KV cache size guide covers MLA models and the quality effect of 8-bit and 4-bit caches.

Which settings help with long context?

An FP8 KV cache, chunked prefill, prefix caching and a context limit sized to the job. None changes the attention arithmetic; each removes waste around it.

# vLLM: one long-context user, FP8 KV, prefix cache on
vllm serve /workspace/models/qwen3-coder-next-nvfp4 \
  --max-model-len 131072 \
  --kv-cache-dtype fp8 \
  --enable-prefix-caching \
  --max-num-batched-tokens 8192 \
  --gpu-memory-utilization 0.85

# llama.cpp: one slot with the full 128k, 8-bit KV
llama-server -m model.gguf -c 131072 -np 1 -fa on -ctk q8_0 -ctv q8_0

Container and build steps are in the vLLM guide and the llama.cpp guide.

Which model should you pick for long documents?

A hybrid-attention mixture-of-experts model, without speculative decoding if the context is very long. On one Spark I would start with Qwen3-Coder-Next for code and long technical documents (55 tok/s at 100k in SparkBench, 3 GiB of BF16 cache at 128k) and with Nemotron-3-Super-120B for contract review and extraction, where its 1 GiB cache leaves room for several long sequences at once. I would avoid dense full-attention models for this job: Llama 3.3 70B needs 40 GiB of cache at 128k and, being dense, decodes slowly before the cache adds anything.

Budget the wait honestly. Even a favorable model spends one to two minutes on a fresh 100k prompt on one Spark, so long-context work suits batch review and repeated questions over a cached document better than interactive chat with new documents each time. If one Spark's 128 GB is too small for the model itself, the guide to large MoE models on several Sparks covers the memory math.

FAQ

How fast is a DGX Spark at 100k context?

It depends on the model's attention design. SparkBench reports Qwen3-Coder-Next (NVFP4, vLLM) at 55.0 tok/s decode after a 100k fill, down from 58.9 at 4k, and Gemma 4 26B-A4B at 21.4 against 23.0. Qwen3.8-27B with speculative decoding falls from 38.1 to 10.7 tok/s, and Qwen3.6-35B-A3B from 86.3 to 31.5 (runs from July to October 2026).

How long does a DGX Spark take to process a 100k-token prompt?

Roughly 45 seconds to 4 minutes on one Spark, by my calculation from llama.cpp's published depth benchmarks: about 45 s for gpt-oss-20b, 76 s for gpt-oss-120b, 96 s for Qwen3-Coder-30B-A3B at Q8_0 and 247 s for GLM-4.7-Flash. Prefill slows as the context grows because attention work per token rises with every token already in the cache.

How much memory does a 128k context need on a DGX Spark?

At BF16, the KV cache for one 131,072-token sequence ranges from 1 GiB for Nemotron-3-Super-120B (8 attention layers) to 40 GiB for Llama 3.3 70B (80 layers with 8 KV heads), by calculation from each model's config.json. FP8 KV halves those numbers. Hybrid models such as Qwen3.6-35B-A3B need about 2.5 GiB because only 10 of their 40 layers keep a KV cache.

Does FP8 KV cache help long-context speed on a Spark?

Yes, for decode. Each generated token reads the whole KV cache, so halving its bytes cuts the per-token read. For Qwen3-Coder-30B-A3B at 32k, the BF16 cache is about 3.2 GB against about 3.5 GB of Q8_0 weights, and llama.cpp's benchmark shows decode falling from 61.1 to 30.2 tok/s between empty and 32k context. vLLM enables it with --kv-cache-dtype fp8.

Which model is best for long documents on one DGX Spark?

A hybrid-attention mixture-of-experts model. Qwen3-Coder-Next loses only 7% of its decode speed between 4k and 100k context on SparkBench, and Nemotron-3-Super-120B keeps a KV cache of about 1 GiB at 128k because only 8 of its 88 layers use attention. Dense full-attention models such as Llama 3.3 70B need 40 GiB of BF16 cache at 128k and decode slowly from the start.

Sources

Every figure above is attributed to its source in the sentence or table where it appears. Pages were read on 7 November 2026 unless a date says otherwise.

First top-up: pay $20, get $30 in credit

Time your own 100k-token prompt.

Rent a DGX Spark at $0.79 per hour, billed by the minute, load your longest document and measure prefill and decode at the context you actually use.

A dedicated DGX Spark in the EU, $0.79/hour, billed per minute. $30 of credit is about 37 hours of compute.

Create account See the DGX Spark benchmarks