Speculative decoding on two RTX 3090s: +19% for one user, slower for a batch

DSpark speculative decoding boots on Ampere with one experimental patch. On a chat workload it raised single-stream throughput by 19% and lowered aggregate throughput at four or more concurrent requests.

Openference Labs2 min readOFL-001

Contents

The model we study ships with a speculative drafter. Speculative decoding spends extra compute to propose several tokens at once and verifies them in one pass, which helps when a GPU is waiting on memory and hurts when it is already busy. Two RTX 3090 cards are an interesting test, because Ampere has plenty of compute headroom for one request and very little for sixty-four.

Getting it to run

The engine’s speculative worker requires a Hopper-generation attention kernel for the draft model. One experimental patch lets it use the Triton attention backend on SM8x instead. With that, the server starts with these flags, in addition to the four environment variables from the official recipe:

--speculative-algorithm DSPARK \
--speculative-num-draft-tokens 8 \
--speculative-draft-attention-backend triton

The draft length of eight is fixed by the checkpoint. We tried four and the server refused to start. The patch ignores one option that only applies beyond a 1,024-token window, which does not matter for short chats but is a known gap for long-context speculation.

The workload matters

Random token ids give a drafter nothing to predict, so a speculative benchmark on random text is meaningless. We used natural-text ShareGPT prompts with a 256-token output cap, closed-loop concurrency, a warm server and one run per point.

Experiment E03, concurrency sweep. Host: 2x GeForce RTX 3090 24 GB, PCIe only (no NVLink bridge), rented host A. Method: SGLang serving benchmark, ShareGPT chat prompts, 256 new tokens cap, closed loop. baseline: no speculation. treatment: DSpark speculative decoding with 8 draft tokens.Each point is a single run (1 repeat).
ConcurrencyOutput tok/s
baseline
Output tok/s
treatment
Change
treatment vs baseline
TTFT mean ms
baseline
TTFT mean ms
treatment
ITL mean ms
baseline
ITL mean ms
treatment
Requests
175.089.2+19.0%19821112.710.716
4214.9187.3−12.9%32831617.619.416
16482.6300.8−37.7%1,42457728.049.664
64383.8323.7−15.7%6,22329,001135.966.8256
MeasuredPreliminaryClick a throughput figure for the full run, its limitations and its raw output.
Equivalence check: Greedy continuation agreement, 6 prompts x 256 tokens. Run details.
MeasureValueUnit
Continuations identical to the non-speculative run (of 6, 256 tokens each)2prompts
Prompt 1: first divergence1token index
Prompt 1: top-1 minus top-2 margin at divergence, non-speculative0.028nats
Prompt 1: top-1 minus top-2 margin at divergence, speculative0.200nats
Prompt 2: first divergence11token index
Prompt 2: top-1 minus top-2 margin at divergence, non-speculative0.044nats
Prompt 2: top-1 minus top-2 margin at divergence, speculative0.085nats
Prompt 3: first divergence1token index
Prompt 3: top-1 minus top-2 margin at divergence, non-speculative0.107nats
Prompt 3: top-1 minus top-2 margin at divergence, speculative0.044nats
Prompt 5: first divergence166token index
Prompt 5: top-1 minus top-2 margin at divergence, non-speculative0.078nats
Prompt 5: top-1 minus top-2 margin at divergence, speculative0.139nats
Maximum prompt-logprob difference, speculative server vs non-speculative server (3 prompts)0nats

What happened

For a single stream, throughput went from 75.0 to 89.2 tokens per second, a 19% gain, and mean inter-token latency fell from 12.7 ms to 10.7 ms. The mean accept length was 2.41 tokens per verification step, averaged over the whole server run rather than per concurrency level.

From four concurrent requests upward aggregate throughput was lower with speculation: 214.9 to 187.3 tokens per second at 4, 482.6 to 300.8 at 16, and 383.8 to 323.7 at 64. A plausible reading is that verifying eight tokens for each request in the batch turns a memory-bound step into a compute-bound one, so on these GPUs speculation helps latency for one user and costs throughput for many.

How far to trust that reading

  • It is a reading, not a measurement of the cause. We have not profiled the speculative path.
  • The graph cap. These runs used the default decode CUDA-graph cap of 48. A later experiment found that the cap makes decode at 64 concurrent requests run eagerly. Whether it also affected the speculative runs at four or more requests has not been measured; the re-run is planned.
  • Correctness. Over six prompts of 256 greedy tokens, two continuations were identical to the non-speculative server. The other four diverged at tokens where the top two candidates were within 0.03 to 0.2 nats of each other in both runs, which is what numerical near-ties between the verify and decode kernels look like. Prompt log-probabilities were bit-identical, because the prefill path is untouched. That is consistent with lossless verification, but it is not proof, and six prompts is a small sample. A task-level evaluation is planned.
  • One run per point on one rented host.

The experiment log has the configuration and the correctness table, and every run page links its raw output.