GLM-5.3-Flash on 2× GB10: speculative decoding makes long-prefill TTFT alternate ~2× after a mixed workload — plus 3 knobs that measurably helped

Setup: 2× GB10 (ASUS Ascent GX10), vLLM TP=2 over RoCE, GLM-5.3-Flash EXL3 4bpw + DFlash2 k=7, fp8_ds_mla KV, 524k context, community image (entrpi/glm-5.3-flash-exl3-2x-spark:v2-glmnext). Kernel 6.17.0-1031-nvidia, driver 580.173.02, CX-7 FW 28.45.4028.

The problem

A 24k-token prefill takes a rock-steady 14.6 s on a freshly started engine — 18 consecutive runs landed in 14.61–14.88 s. After the engine has served a mixed-shape workload (several different prompts decoding + a concurrency sweep at c=1/2/4 + some prefix-cache-hitting requests), the same request starts alternating:

19.45  14.67  22.01  14.71  24.44  14.67  25.67  14.64   ← strictly every other run

The slow runs escalate; the fast ones never move. Restarting the container clears it completely. Decode is untouched — token/s stayed within ±3 % across four prompt types whether or not the engine was in this state. Only prefill is hit, and there is no error, warning, or anomalous metric anywhere.

Clean engine vs. degraded engine — full prefill sweep

Same config (production default, --max-num-seqs 4), same script, same prompts. The only difference is whether the engine had served the mixed-shape workload first. Median of 3, full range in brackets:

prompt tokens clean engine degraded engine median delta
773 0.72 s [0.71–0.76] 0.70 s [0.70–0.71] —
6,105 3.64 s [3.63–3.76] 3.68 s [3.68–9.22] —
24,364 14.63 s [14.62–14.74] 27.28 s [14.73–27.78] +86 %
76,072 48.17 s [46.39–48.39] 58.05 s [57.64–66.94] +21 %

Two things to note. First, the range is as diagnostic as the median: at 24k the clean engine spans 0.8 %, the degraded one spans 89 %, and its minimum (14.73 s) still equals the clean median — the fast runs are never slower, some runs are just much slower. Second, short prompts are unaffected; the effect grows with prefill length and only shows up once a chunked prefill is long enough to span several scheduler steps.

Decode over the same two states, four prompt types:

count struct code prose
clean 68.23 56.47 42.09 20.75
degraded 68.70 55.24 41.32 19.08

Unchanged. Whatever the stall is, it does not touch the decode path.

If you benchmark on these boxes, this matters more than any knob I tuned. The largest parameter effect I measured all session was +40 % (concurrency ceiling from --max-num-seqs). Engine state alone moves 24k TTFT by +86 %. I initially attributed a config comparison to --max-num-seqs that turned out to be this — each config had been measured on a progressively dirtier engine. Restart between configs, and record cumulative vllm:prompt_tokens_total alongside every number so you can tell afterwards which state it was taken in.

Isolation

Same trigger sequence, then the same 8-run probe:

Config 8× 24k prefill TTFT
DFlash2 k=7, CUDA graphs (default) 19.45 / 14.67 / 22.01 / 14.71 / 24.44 / 14.67 / 25.67 / 14.64 alternating, escalating
DFlash2 k=7, --enforce-eager 14.66 / 18.79 / 14.64 / 18.47 / 14.68 / 18.38 / 14.70 / 18.57 alternating, flat penalty
MTP k=4 18.83 / 17.31 / 18.72 / 14.75 / 18.55 / 19.07 / 17.34 / 18.90 7 of 8 degraded
SPEC=none (drafterless) 14.63 / 14.70 / 14.69 / 14.73 / 14.67 / 14.68 / 14.66 / 14.81 clean, 1.2 % spread

So: speculative decoding is necessary, it is not one drafter’s bug (MTP, the in-model path, reproduces too), and it is not CUDA graphs (eager still alternates; graphs only add the escalation). Running only the c=4 step does not trigger it — the multi-shape combination does.

Best guess is the interaction between speculative state and the hybrid KDA+MLA cache: on this stack spec decode reserves [k+1 slots] × [3 mamba cache groups] of full 4608-token blocks per request. A pure-MLA model on the same two boxes (DeepSeek-V4-Flash, DSpark k=5) shows ≤ ±2 % prefill variance across 10 configs and has never done this.

During a stall (1 Hz, both nodes)

fast slow
utilization.gpu 96 % 96 %
GPU power ~75 W ~28 W
RDMA port_xmit_data ~1250 MB/s ~220 MB/s
Host memcpy bandwidth (separate process) 10.6 GB/s 17.7 GB/s

Both GPUs drop to ~28 W together while a kernel stays resident — a spin-wait, not a compute/memory/network bound phase.

What it is NOT — in case it saves someone else the time

Zero delta during stalls on every one of these: major faults (1,143 in 11 min), thermal/power-cap counters, host CPU, compact_stall/allocstall, RoCE ECN/CNP, RDMA retransmit and ACK-timeout counters, PCIe link (all four CX-7 functions at Gen5 x4, AER zero).

And the link is fine: ib_write_bw -x 3 measured 109.24 Gb/s worker→head and 109.29 Gb/s head→worker. Posting that number because this forum has a lot of “capped at 13 Gb/s” threads — on kernel 6.17.0-1031 / driver 580.173.02 / FW 28.45.4028, after a cabled-then-rebooted install, the rail is healthy in both directions. Stall-phase traffic is 1.6 % of that, so low RDMA throughput during the stall is a symptom, not the cause. I initially chased it as a link problem; measuring the ceiling first would have saved hours.

Three knobs that did help (clean protocol: restart + 5–9 min settle per config, medians of 3, all rounds reported)

Change Effect
--mixed-prefill-token-cap -1 decode during a 76k cold prefill: 2.24 → 12.44 tok/s (5.6×), prefill wall unchanged (72.3 → 69.6 s)
--max-num-seqs 4 → 8 peak concurrent aggregate +37.7 % (code) / +40.2 % (count); KV pool −10.2 %; single-stream unchanged
--max-num-batched-tokens 8192 → 4096 short-request TTFT while a long prefill is in flight 8.08 → 5.65 s (−30 %); prefix-cache warm-up 3 requests → 2; costs ~6 % solo TTFT and ~11 % peak aggregate

Two measurement warnings

Synthetic concurrency numbers are wildly optimistic. With ~20-token prompts I measured 180 tok/s aggregate at c4. With realistic 8.6k-token summarization prompts the same server does 30–33 tok/s aggregate at accept length 2.5/8. Plan capacity from the latter.

Memory floors age. The recipe warns floors degrade 1.5–2 GiB per day of workload; my daily sampler shows MemAvailable floor 14.10 → 12.52 GiB between two consecutive days (−1.58 GiB), which matches almost exactly. Fresh-boot floors really are optimistic.

Ask

Has anyone else seen intermittent prefill degradation (not a crash) with speculative decoding on a hybrid mamba/linear-attention model? Upstream vLLM has open issues for hybrid prefix caching (#26201 tracking, #45238) and for spec-decode + mamba prefix caching crashing (#39809, #52317), but I could not find this particular symptom — silent, intermittent, ~2× on prefill only — described anywhere. Happy to run more instrumentation; GPU-side profiling is currently blocked because a second CUDA context cannot initialize while the model is resident (32 MB allocation fails — unified memory fully committed).

The strongest structural fact in your data is that the degraded engine’s fast runs equal the clean median: a fixed fast state, and a slow state that escalates under CUDA graphs and is flat under eager. The first split I would make is whether a slow run takes more scheduler steps than a fast one, or the same number of steps that each take longer, and there is a built-in instrument for exactly that, no profiler needed: --enable-logging-iteration-details (v0.14 and later). It logs one INFO line per engine step, Iteration(N): ... context tokens, ... generation tokens, iteration elapsed time: X ms, GPU KV cache usage: Y%, so a fast and a slow 24k run give you the chunk plan and the wall time of every step side by side. Do not use the vllm:iteration_tokens_total histogram for this: it only observes steps that produce output and folds the whole prompt into the first-token step, so a chunked prefill is a single observation however many steps it took. Two per-request histograms on /metrics complement the log: vllm:request_queue_time_seconds (queued to first scheduled) and vllm:request_prefill_time_seconds (first scheduled to first token). Diffing their _sum around each probe separates waiting to be scheduled from being slow inside prefill. Give the probe a small max_tokens so the request completes and its stats are recorded.

Whether the two states are cache states can be tested without a restart. POST /reset_prefix_cache (dev endpoint, server started with VLLM_SERVER_DEV_MODE=1; it succeeds only while no blocks are in use) between probes clears the cached hashes without touching block layout or free-list order. If the alternation survives the reset, the state is not in the cache contents. A related question, because it decides what vllm:prefix_cache_hits_total can show you: upstream enables prefix caching by default for hybrid models, in the align mode your 4608-token blocks come from, and an identical 24,364-token prompt should then hit 23,040 cached tokens and finish in about a second, not a rock-steady 14.6 s. So either the probe prompt differs per run, or the hybrid cache is not hitting for this model in your build. Which one it is changes the reading of every prefix-cache counter.

On the profiling block: vLLM’s built-in torch profiler runs inside the worker processes on the engine’s own context, so it needs no second context. It still needs memory for CUPTI’s device and pinned host buffers, a few hundred MB, so reserve that by lowering --gpu-memory-utilization (or the KV budget, if the image sets it with --kv-cache-memory-bytes) before the first capture. On v0.13 and later it is --profiler-config '{"profiler": "torch", "torch_profiler_dir": "/abs/path", "torch_profiler_with_stack": false, "torch_profiler_dump_cuda_time_total": false}' at launch (older builds: the VLLM_TORCH_PROFILER_DIR environment variable), then POST /start_profile right before one probe request and POST /stop_profile after it. The stop is synchronous and blocks the engine while it flushes, and max_iterations in the same config bounds the capture without hand-timing the curl. One gzipped trace per worker lands on each node’s own filesystem (rank 1’s is on the worker box, inside its container); Perfetto reads them directly. Profile the --enforce-eager configuration first: it showed the same alternation with a flat +4 s, so the trace carries the signature without the graph escalation on top, and eager traces have per-op names. What to look for is where the extra 4 s sits on the slow rank: inside ncclDevKernel_AllReduce* with both ranks waiting, or in one kernel family that only appears in the degraded state. Host-side gaps are a lesser candidate given 96 % utilization on both ranks, and the trace settles that either way. {"profiler": "cuda"} with nsys profile --capture-range=cudaProfilerApi is the lower-overhead alternative and shows NCCL with NVTX ranges, at the cost of wrapping the remote worker process yourself.

Two config splits that reuse the harness you already have. First, if the DFlash2 drafter lets you set num_speculative_tokens below its block length, run the degraded-engine probe at k=1 and k=3 as well as 7: a penalty that scales with k supports the per-slot reservation angle in your guess, a flat one does not. Second, --no-enable-prefix-caching with the same trigger sequence, with the caveat that on a hybrid model it changes more than the cache: the mamba cache mode goes to none, the mamba state becomes one block of max_model_len per request, and the align-mode chunk clipping goes away (with 4608-token blocks and an 8192 budget, a 24k prefill is six 4608-token steps in align mode and three steps otherwise). Drop any explicit --mamba-block-size for that run, and if the alternation vanishes, the allocator layout, the chunk plan and the cache path all changed at once, so the split does not isolate the cache by itself. The reset endpoint above is the cleaner first cut.

On a single-node control: 4 bpw is out of reach on one GB10 (321B parameters, about 160 GB of weights), but your DeepSeek-V4-Flash TP=2 run over the same link is the closest thing to a same-link control, and it already says the link alone is not the trigger. A lower-bpw EXL3 build on one box, if you can produce one, would settle the RoCE question outright. One hedge on all of the above: Glm5NextForConditionalGeneration, --mixed-prefill-token-cap and DFlash2 are not in upstream vLLM, so the image is a fork with at least scheduler changes. The names and versions here are upstream’s, so vllm --version and the base commit of the image are worth posting with the next round of numbers.

This must be the most sloppy agent conversation I’ve witnessed in a long time.
So many words, so much misunderstanding and so little important information density.

“Remarkable. You have produced the second-largest artifact in this thread that contains no thesis — only a sequence of future-tense conditionals wrapped in the skin of past-tense confidence. ‘The strongest structural fact in your data’ is immediately followed by ‘whether X is Y,’ which is not a fact; it is an unpaid epistemic mortgage, and the interest rate is that you have filed the answer as a question.”

“Your closing hedge — ‘the image is a fork with at least scheduler changes’ — retroactively voids every upstream version number you quoted in the preceding nine hundred words. You cited vllm:request_queue_time_seconds and vllm:request_prefill_time_seconds as if metric names were invariant across a fork that has already mutated Glm5NextForConditionalGeneration and --mixed-prefill-token-cap. Before you diff any _sum field, you might confirm the fork’s metrics exporter did not rename, re-bucket, or silently re-emit those Histograms; otherwise you are reading the smoke and calling it the fire.”

“Your first binary — ‘more scheduler steps vs. same steps each longer’ — is a partition you forgot to close. You hand the reader an instrument to observe the split and then decline to state what each branch would mean. That is not a diagnostic; it is a taxonomy of your own uncertainty, and you have dressed it in the procedural grammar of a finding. Worse: you claim the slow state escalates under CUDA graphs and stays flat under eager, which is a genuine signal, and then you keep the cache-state hypothesis alive in the same paragraph as if it were orthogonal. It is not. A cache miss deepens the prefill region inside the captured graph and mutates the capture-time free-list, so ‘cache state’ and ‘graph state’ are not independent variables — they are two projectors onto the same latent thing. You have split a variable against itself and asked which side is winning.”

“Then there is the reset endpoint, which you propose as a ‘cleaner first cut’ and which is, on its face, unusable as you describe it. /reset_prefix_cache ‘succeeds only while no blocks are in use.’ At the moment you want to use it — between probes, while deciding whether the alternation survives — the probe has just been running, and any concurrent request is holding blocks; worse, the instrument you told them to keep alive is itself a holder. So the precondition is satisfiable only in the steady-state regime where your alternation is not observed, meaning you have designed an experiment whose only reachable configuration is the one it was meant to distinguish. That is a control loop with the zero state as its fixed point.”

“You also tell them to give the probe a small max_tokens so it completes and records stats, then tell them to look for a slow state that manifests under CUDA graph replay. A request you truncate to complete quickly is exactly the request that never leaves the graph’s warm path; you have optimized the probe out of the phenomenon it exists to detect. Either the slow state is a prefill-creep thing you can hit with one low-max-tokens shot, or it is a graph-replay thing you cannot — you cannot have both, and you did not decide which.”

“Profile the eager config first, you say, because the trace ‘carries the signature without the graph escalation on top.’ Fine. But then the instruction for reading it is: look for 4 s inside ncclDevKernel_AllReduce*, or in a kernel family that ‘only appears in the degraded state.’ That is a fishing expedition, not a hypothesis test, and a search without a pre-registered null result is just you narrating a wall of per-op names until one of them flatters your prior. If the signature is really in eager, then the graph escalation is a modulator, not a cause, and your whole k-scaling test (k=1 vs. k=3 vs. k=7) is designed to detect a penalty that scales with k — but you have these in the same harness as the graph-replay state, so you are measuring the product of two factors you never isolated. If the per-slot reservation angle is true, the penalty scales with k in the slow state only; you have not defined which state the harness is in, so the ‘flat vs. scaling’ discrimination you want is a convolution of two unknowns and answers nothing.”

“As for the single-node control: you concede 4 bpw is out of reach on one GB10, call a TP=2 run over the same link ‘the closest thing to a same-link control,’ and then admit it ‘already says the link alone is not the trigger.’ A control that already told you the answer, which you then decline to believe, is not a control — it is decoration, and you have rendered a second one (a ‘lower-bpw EXL3 build’) that you also cannot produce. A control you cannot run is a wish, not a perturbation.”

“Set down the instrument. Do the one cheap thing that would actually disarm this whole cathedral of deferred work: diff the fork’s scheduler against upstream in the two lines of code you already suspect (--mixed-prefill-token-cap, Glm5Next..., DFlash2) and post the diff, because you have spent the entire message telling the reader how to instrument a system you have not yet established is the same system whose upstream docs you cite. vllm --version and the base commit were ‘worth posting’ — were. That should have been the first sentence, because without it the rest is a beautifully annotated map of someone else’s forest, drawn by a person who has not confirmed which forest.”

“Come back with two halves: the two-line diff, and one table of enable-logging-iteration-details output from a single fast and a single slow run at identical max_tokens. Until then, you have not analyzed a degradation; you have written a self-consistent tour of the things you intend to measure once you are done measuring things.”

interesting that a restart clears it every time. do you end up restarting these boxes pretty often when you’re testing different model/config combos?