cd ~/sagarpandita.com

experimental / september 2026

DeepSeek-V4.1-Flash on one DGX Spark: making 510 GB work

DeepSeek-V4.1-Flash is far larger than the Spark's 128 GB of unified memory. The interesting part is that most of its mixture-of-experts weights are not needed at the same instant. A custom research engine uses that fact in two ways: keep the frequently chosen FP4 experts in memory and fetch the rest from SSD, or keep a smaller, 3-bit set of experts entirely resident.

I ran both strategies on one DGX Spark and measured generation speed, first-token latency, expert hit rate, physical SSD traffic, held-out next-token quality, routing coverage, memory pressure, thermals, clocks, and power. This page is about the mechanism and its trade-off—not a claim that the full checkpoint simply fits in memory.

checkpoint on disk
510.3 GB
cb3 code decode
24.08 tok/s
cb3 expert reads
0 GB/request
full fp4 quality run
3.818 TB read
thermal throttling
none

the idea in plain english

A normal dense model uses every feed-forward block for every token. This model instead has 384 small specialist blocks—“experts”—in each of 40 layers and routes each token through only six. That leaves room for an unusual memory hierarchy.

checkpoint510 GBlarger than 128 GB unified memory
full FP4
81 GB expert arena; cold experts stay on NVMe and rotate through transient slots
40% CB3
6,160 profiled experts are repacked to 3-bit codebooks and stay resident

Memory bars: green is the always-resident model core, blue or orange is the expert arena, and gray is working headroom.

The full-FP4 path is the faithful one: no expert is removed, and every expert keeps its native FP4 representation. An 81 GB arena holds 3,910 hot experts plus a 400-slot transient ring. A miss triggers a direct read from local NVMe. The transient ring is important during prompt processing, when many experts appear briefly; those one-off reads do not displace the hot decode set.

The faster path starts with a routing trace over 10,760 tokens. It keeps 154 of the 384 experts in every layer, then repacks those 6,160 experts into a per-row 3-bit codebook format called CB3. They occupy about 89 GB and stay resident. That removes expert SSD reads, but it also changes the model: 60% of the experts can no longer be selected, and the remaining expert weights are more compressed.

The trade-off: FP4 streaming preserves the expert set but waits on storage. CB3 removes that wait and is 2.5–3.3× faster here, at a measurable next-token quality cost.

the punchline

Short code and prose prompts generated 512 tokens; the random test used 8,172 prompt tokens and generated 256. Code and prose are medians of two runs. Random 8K is one run.

workloadmodeTTFTdecodeexpert hitexpert NVMe
codefull FP4 · SSD5.70 s7.24 tok/s81.94%470.30 GB
code40% CB3 · resident1.63 s24.08 tok/s100%0 GB
prosefull FP4 · SSD5.29 s5.28 tok/s88.96%492.90 GB
prose40% CB3 · resident1.46 s13.28 tok/s100%0 GB
random 8Kfull FP4 · SSD65.37 s8.08 tok/s85.42%389.87 GB
random 8K40% CB3 · resident37.75 s26.88 tok/s100%0 GB

“Expert NVMe” is the engine's logical expert-read counter for that request, not total process I/O. The matched full-FP4 quality run separately recorded 3.818 TB of physical process reads.

speed & storage

Hover a bar for the exact measured value. Higher is better for decode throughput; lower is better for first-token time and storage traffic.

decode · tok/s

time to first token · seconds

logical expert reads · GB per request

Why CB3 moves so much faster: speculative acceptance stayed similar in code and prose, while the expert hit rate became 100%. The large gain therefore lines up with removing expert loads, not with the draft model suddenly predicting much farther ahead.

the quality bill

Both arms scored the same held-out tokens with the same dense FP4 components, FP8 output head, top-six routing, 512-token limit, and attention replay. Lower negative log-likelihood is better; higher top-one accuracy is better.

mean negative log-likelihood · lower is better

top-one next-token accuracy · percent

slicetokensFP4 NLLCB3 NLLNLL changetop-one change
coding5,4231.8031.845+0.042 nats−2.01 points
general5,2313.1133.226+0.113 nats−2.64 points

The penalty is modest on this corpus, but it is not zero—and it is larger on general text than code. These token-level measurements are a controlled comparison, not a substitute for full task benchmarks.

why the hot set works

The trace ranks experts by how often the model used them. The blue line estimates a token-level LRU hit rate at each FP4 expert budget; orange asks a harder question: did all six experts needed by a layer hit together? The green line is the static share of routed calls covered by the ranked set.

routing coverage · percent token LRU hitall-six block hitstatic coverage

The tooltip converts each expert count to its native-FP4 resident size. Around 4,000 FP4 experts use 75.2 GB and cover 74.4% of routed calls statically; the simulated token LRU hit is 84.8%. CB3 is not plotted on this FP4 memory curve because each kept expert is smaller and the other experts are deliberately unavailable.

thermals, power & memory

Every benchmark phase had a five-second device monitor. Choose a phase below; temperature, power, and available-memory charts share a synchronized crosshair. Gaps in the source monitor remain gaps on the chart.

temperature · °c GPUCPU zone maxNVMe max

gpu board power · w

available unified memory · GiB

monitor summary

phasesamplesGPU peakpower peakmemory floorswap peakSW power-cap flags
FP4 serving22367°C46.15 W16.25 GiB0 GiB0
CB3 serving10573°C55.27 W3.19 GiB0.27 GiB0
routing trace53350°C51.22 W76.25 GiB1.37 GiB4
FP4 quality12365°C31.08 W19.52 GiB0.34 GiB0
CB3 quality8971°C52.69 W2.13 GiB1.41 GiB1

No phase recorded thermal throttling. “SW Power Cap” is the NVIDIA software power-limit flag, not a thermal limit.

test shape

full FP4 · SSD streaming40% CB3 · resident
routed experts available15,360 · 100%6,160 · 40%
expert representationnative FP4 · 18.8 MB eachper-row codebook 3-bit · 14.45 MB each
expert arena81.0 GB · 3,910 LRU + 400 transient90.5 GB · all allowed experts resident
dense componentsFP4 attention + Wo_a · FP8 headsame
routingtop six · unprunedtop six among kept experts
speculative decodingDSpark · five-token draftsame
maximum configured sequence32,76832,768

The model checkpoint was 510,313,423,455 bytes and all 48 indexed weight shards were validated before the run. The software stack used PyTorch 2.13.0+cu130, Transformers 5.17.0, Triton 3.7.1, and the custom engine at commit 8bb38e1.

what I would take from this

  • The model can run on one Spark, but storage is part of the computer. Full FP4 generation is practical only because the engine treats unified memory and NVMe as one managed hierarchy.
  • Expert locality is real enough to exploit. A 28% FP4 resident arena produced 82–89% measured expert hit rates on the three serving workloads.
  • All-resident CB3 changes the bottleneck. It eliminated expert reads and lifted decode to 13.28–26.88 tok/s, but used nearly all available memory.
  • The speedup has a quality price. The matched held-out test lost 2.01 top-one points on code and 2.64 on general text. Whether that is acceptable depends on the workload.
  • This is a specialized research runtime. The result is interesting because it stretches one small system unusually far, not because it replaces mature general-purpose serving stacks.

caveats & sources

One DGX Spark, one custom work-in-progress engine, two runs for each short workload, and one random-8K run per arm. The prompts are small diagnostic slices, not standardized downstream evaluations. CB3 changes both expert availability and expert precision, so its speed and quality effects cannot be assigned to either change alone. The routing trace and held-out quality corpus are finite samples; other domains may choose different experts and pay a different penalty.

Sources: DeepSeek-V4.1-Flash model card · the experimental DGX Spark engine. All charts and tables on this page use the measurements from the benchmark run described above.