DeepSeek-V4-Flash on 2× DGX Spark: intermittent token corruption with MTP + CUDA Graphs

I ran into an intermittent generation-corruption problem while serving DeepSeek-V4-Flash across two DGX Sparks under sustained agentic load. After building a reproducer and working through the likely causes, this appears to be a vLLM CUDA graph / sparse-attention issue rather than a problem with the model weights, KV-cache blocks, or the DGX Spark hardware.

I’m posting the details here so other people running similar configurations don’t have to repeat the investigation.

Setup

The configuration where I observed this:

  • 2× NVIDIA DGX Spark / GB10, TP=2
  • DeepSeek-V4-Flash
  • vLLM 0.26.1rc0 from August 11th
  • MTP speculative decoding, MTP=5
  • prefix caching enabled
  • FULL_AND_PIECEWISE CUDA graphs
  • sustained concurrent/agentic workloads, specifically IronCurtain vulnerability discovery workflow

NB: vLLM 0.27.1 predates all three fixes discussed below and is also affected.

This is related to the dual-Spark setup discussed in: DeepSeek-V4-Flash running across 2x DGX Spark

I ran into the problem while executing my IronCurtain vulnerability-discovery workflows against the local model.

These are long-running agentic investigations rather than simple chat or benchmark requests. They create large, evolving contexts, repeated prefix reuse, and long generations over many hours. Under that workload, the server could behave perfectly normally for a long period and then enter a short window where generations suddenly degraded, e.g. token salad, bad tool calls, etc.

Using Fable and GPT-5.6 Sol, I spent three days debugging this because it was challenging to reproduce. Fortunately, both IronCurtain and LiteLLM allow me to capture token trajectories for replay. The agents helped me build a reproducer that continuously exercises the server and characterizes the failure independently of IronCurtain itself.

Symptoms

The failure was intermittent and during a bad window vLLM would produce:

  • foreign-character insertions
  • word salad / semantically destroyed output
  • corruption beginning partway through an otherwise normal generation
  • a sharp drop in speculative-token acceptance
  • normal generations again outside the affected window

For example, on the unpatched server, I would run into a window with a 46% degeneration rate, while getting no corruption for 668 generations outside the window.

The speculative-acceptance rate was a good debug signal. Acceptance would drop about 24% relative to the healthy baseline and began moving roughly 30 seconds before obvious text corruption. Once the server entered one of these windows, the problem affected fresh decodes as well as prefix-cache hits.

What was ruled out

I initially considered bad KV blocks, memory instability, thermals, and possibly marginal hardware. KV-cache bookkeeping was ruled out by looking at the block hashing, allocation, eviction, reuse, and copy-on-write paths. The corruption also appeared at positions inconsistent with fixed bad cache blocks. Both GPU-path CUDA memory testing and CPU-path memory testing passed on both DGX Sparks. I initially had the two Sparks vertically stacked, which caused substantial thermal throttling on the lower unit. Adding spacers eliminated the thermal throttling, but the corruption continued with both units thermally stable. Lesson learned: don’t stack them without spacers. They get really hot. Restarting the server often appeared to fix the problem, probably because it reset the relevant batch/graph state.

Potential Root cause

The failure appears to be capture-time state baked into CUDA graphs disagreeing with runtime sparse-attention metadata. It seems that the CUDA graph can capture assumptions about metadata layout that are no longer valid for the current batch geometry. The sparse-attention kernels then consume stale or incorrectly positioned metadata and attend to the wrong context slices. The model itself is fine, but receives the wrong attention context and its output distribution turns into garbage.

Three upstream vLLM fixes landed around the same time and touch independent problems in this area. I have not done any ablation because each run takes hours to reproduce or rule out garbled generation. Below is ordered by most likely culprit first.

vLLM #51318: Revert adaptive C128A metadata packing

The C128A metadata builder was using a batch-dependent row width while the FULL CUDA graph consumer retained the row stride from capture time. Row 0 remained correct, while later rows could be read at stale offsets. That matched the MTP measurements: during corruption, speculative position 0 degraded by roughly 10%, while positions 1 through 4 degraded by roughly 39-44%. Each draft position is effectively another decode-batch row, so this matches what one would expect from a row-stride problem.

Upstream vLLM PR #51318 fixes this by restoring a capture-stable C128A metadata layout. It also closes upstream issue #52448, which reported DeepSeek-V4-Flash degeneration under concurrency with FULL_AND_PIECEWISE.

vLLM #52836: Revert DSv4 eager workspace reuse

This removes a model-wide scratch pool that could reuse storage across layers and CUDA streams without the allocator’s normal stream/event lifetime tracking. One layer could potentially overwrite shared workspace that a previous consumer may still be using. It’s unclear whether this caused the corruption but it might be triggered under the sustained IronCurtain workflow.

vLLM #52492: Keep indexer scoring in breakable graphs

During PIECEWISE capture, short dummy metadata could cause a short-context indexer shortcut to be captured. The same graph could later replay against a much larger cached prefix, where full indexer scoring was actually required. With the large contexts produced by the workflow, this can cause the sparse-attention path to select wrong candidates.

Backport result

Backported all three fixes together:

  • #51318
  • #52836
  • #52492

After restarting the same two-Spark configuration with:

  • prefix caching ON
  • MTP=5
  • the same workload generator
  • the same corruption detector
  • the same sustained load pattern

I encountered 0 corruption windows in 6.35 hours over ~2400 generations whereas the unpatched baseline had been producing roughly one corruption window every two hours.

Speculative acceptance seems identical to the healthy baseline:

  • patched: 0.3450
  • healthy unpatched baseline outside corruption windows: 0.3464

Throughput was also unchanged: 42.9 tok/s with prefix caching and MTP still enabled.

Reproducer

The reproducer came directly from the workload shape that originally exposed the problem in IronCurtain’s vulnerability-discovery workflow. It continuously exercises combinations of:

  • sustained generation
  • concurrent requests
  • changing context widths
  • prefix-cache reuse
  • long-running server state
  • MTP verification

A surprising finding was that a fresh launch can remain completely clean for a long time. A short smoke test therefore does not establish that a build is unaffected. If there is interest in it, I can package it up. The reproducing token stream is primarily about building a test harness and is not disclosing any confirmed vulnerabilities.

Conclusion

If you are serving DeepSeek-V4-Flash on DGX Spark and occasionally see generations become nonsensical after sustained traffic, I would look at these three upstream vLLM fixes before blaming the checkpoint, KV cache, or hardware:

#51318, #52836, #52492

With the three backports applied, I have been able to leave prefix caching and MTP=5 enabled while retaining the same ~43 tok/s decode performance.

Here is the reproducer: GitHub - provos/dsv4-sm121-armed-window: Reproducer for a vLLM output-corruption bug (armed windows) on DeepSeek-V4-Flash / DGX Spark GB10 SM121 — affects v0.27.0/v0.27.1; fixed upstream by #51318/#52836/#52492 · GitHub - with a completely synthetic workload. So, no tokens from the vulnerability discovery workflow are included.

Thanks for this one, I started to investigate these strange behaviours yesterday.

I’m in progress to apply the fixes you found.

Thanks, I also encountered this bug yesterday, so I’ll give this fix a try.

That IronCurtain workload sounds like a really good real world stress test. If you’re open to sharing it, what’s the command you use to launch one of those agent runs plus the signal you use to decide it actually completed cleanly?

Here is a high-level overview of the workflow portion of IronCurtain: IronCurtain Workflows — Multi-Agent Vulnerability Discovery

Deepseek V4 Flash 0731 as a model is a little challenged by it and there is currently no officially released version of IronCurtain that works well with it. So, you will have to clone the IronCurtain repo and work from main.

Otherwise, it’s relatively straightforward: tsx src/cli.ts daemon --web-ui --no-signal --capture-trajectories - that will give you a URL to the dashboard. You go to workflows, select vuln-discovery and then point the workspace to a directory where you have checked out source code - ideally in a compiled language. As prompt you can use a variation of the following depending on what you are looking for: “find a security vulnerability in file parsing”. Ideally, the workflow then runs for a couple of days non-stop. If you get unexplained aborts that’s usually a sign that something went wrong with the model. At that point, you can look at the workflow logs or the token trajectories to see what happened.

NB: This is a workflow I built for security researchers. If you end up finding real vulnerabilities, you need to validate them yourself and then responsibly disclose them to the maintainers.

I’ve gotten this issue as well, and I tried to make a minimal fix to this:

  • #51318
  • #52492

Are all that is needed to fix this issue on the current latest vllm-b12x images. Just added those patches as a mod to my recipe and the garbage output that happens (every time) after about 10-15 minutes is gone.

Not to say the other PR is not worth to include. I hope the vllm-b12x image gets updated to the latest release (currently unreleased still) of vllm ASAP as I do hate having to patch things.