Consumer GPU inference optimisation

How far can a pair of 24 GB RTX 3090 GPUs be pushed as a serving platform for a 26B-parameter mixture-of-experts model? The first Labs study runs an open model on the SGLang engine, ports the SM90+ assumptions in its kernels to Ampere, and measures every change.

Contents

Objectives and method

  • Characterise what two 24 GB Ampere GPUs can serve for a 26B-parameter mixture-of-experts model, with every configuration and measurement published.
  • Close the gaps between engines written for newer GPUs and Ampere (SM86), and publish each change as a reviewable patch with a numerical-equivalence check.
  • Measure cost and energy per token on affordable hardware so that the economics can be checked rather than asserted.

Method. Warm, closed-loop serving benchmarks with fixed seeds and fully recorded software and hardware configurations; a numerical-equivalence gate for every kernel-level change; and a rule that nothing is called a result until a harness and an archived raw output stand behind it. Results are preliminary until each point has at least three repeats, complete host metadata and archived artifacts.

Started 27 November 2026.

Experiments

Every experiment is listed, including those not yet run, withdrawn or blocked.
CodeExperimentStatus
E01

First boot on two RTX 3090 GPUs

The model boots with tensor parallelism 2 and answers correctly. Smoke test only; no benchmark claim.

Preliminary results
B01

Baseline concurrency sweep without warm-up

Ran straight after server start, so lazily compiled kernels inflated first-token latency and depressed the higher concurrency levels. Withdrawn in the notebook; its numbers are not published. Warm runs replace it.

Superseded
P02

Where prefill time goes

Uncached prefill is flat at about 3.1 to 3.2 thousand tokens per second and dominated by all-reduce traffic. Notebook record; raw profile not archived.

Preliminary results
H01

Interconnect characterisation

No peer-to-peer between the GPUs; NCCL traffic goes through host memory at about 5.1 GB/s. Notebook record; measurement harness not archived.

Preliminary results
E02

bf16 all-reduce for the MoE combine

Halving the bytes of the combine all-reduce raises aggregate throughput by about 16% at 16 concurrent requests and 5.5% at 64 on a random-token workload. Quality gate is weak.

Preliminary results
E03

DSpark speculative decoding on SM86

Speculation helps a single stream (+19%) and hurts aggregate throughput at four or more concurrent requests on these GPUs, measured with the default decode CUDA-graph cap (see E04).

Preliminary results
S01

Soak test for an intermittent launch error

One start-up crash at a PDL launch was seen once and not reproduced. A patch removes the launch attribute below sm_90; a soak test is needed before calling it fixed.

Planned
E04

KV pool sizing and the fall in throughput at 64 concurrent requests

Tripling the sliding-window KV pool left throughput at 64 concurrent requests at 395 to 404 tokens per second, so pool size is not the cause. Decode CUDA graphs were captured only up to batch size 48, so 64-request decode batches ran eagerly. Raising the cap is reported to roughly double throughput at 64 requests; that follow-up is a notebook record whose raw output is not archived.

Preliminary results
G01

Re-run E02 and E03 with decode CUDA graphs covering the tested batch sizes

E02 and E03 used the default cap of 48. Repeat both with a cap above the largest tested batch to see whether the bf16 all-reduce gain and the speculative-decoding trade-off change at 64 concurrent requests.

Planned
Q01

Task-level quality evaluation against a reference engine

Compare outputs and a task evaluation on the same weights against a reference engine, and add a refusal-behaviour sanity check.

Planned
P03

Reducing prefill cost

Cut all-reduce bytes in attention, fuse the attn_res fallback and tune Marlin experts.

Planned
K01

KV cache options and context length

FP8 KV with software conversion, page size, prefix caching and hierarchical cache, and context length toward the model's maximum.

Planned
T01

Harness extensions

Long-context, shared-prefix and sampled-power workloads, plus repeats and a recorded host description for every run.

Planned
I01

NVLink bridge versus PCIe only

Quantify what an NVLink bridge changes for tensor-parallel decode and prefill.

Blocked by: Needs a host with an NVLink bridge fitted; the rented host has none.

Planned
W01

Power limits, energy per token and cost

Sample power during load, sweep power limits and compute energy and cost per million tokens with the published economics model.

Planned

Status

This is the first Labs programme and its results are preliminary. The runs in the dataset are single repeats on one rented host whose CPU, memory, PCIe link width and driver version were not recorded. A run only becomes validated after at least three repeats, archived raw output and complete host metadata. Until then, read every number as a measurement of one configuration on one day.

The study evaluates a third-party derivative model. Openference Labs did not train, fine-tune or edit it; see the model page for the full lineage.

Hardware and software under test

Two GeForce RTX 3090 cards (24 GB each, Ampere, compute capability 8.6) on a rented single node with no NVLink bridge and no peer-to-peer support between the GPUs. The engine is SGLang at a pinned commit plus a Labs patch series on a branch called ofl-sm8x. The model is loaded as released: expert weights in NVFP4 and MXFP8, everything else in BF16 and FP32. Ampere has no native FP4 or FP8 tensor-core path, so experts are executed through Marlin weight-only dequantisation with BF16 activations.

What the engine assumes, and what changed for SM86

The engine’s Inkling 2 support targets newer GPUs. Each assumption below needed a replacement before the model would run correctly on Ampere.

Upstream assumptionReplacement on SM86
Native NVFP4 GEMM and scale swizzling (SM100 and later)Experts through Marlin weight-only dequantisation with BF16 activations
Hardware FP32 to E4M3 conversion (SM89 and later)Software round-to-nearest-even in Triton, bit-exact against torch.float8_e4m3fn over about 4.8 million values
Triton gdc_* programmatic dependent launchNo-op shim
CuTe RMSNorm using griddepcontrolGated on SM8x
FA4 attentionTriton attention backend with a relative-bias score modifier and log-sum-exp output
Raw griddepcontrol assembly in six JIT headersCompiled out below sm_90 (drops overlap only)
CuTe TMA attn_res kernelTorch fallback
NVLink multicast all-reduce and all-gatherThe SM120 NCCL path without multicast
Prefill CUDA graphDisabled (capture fails with the Triton backend)

The patch series will be published under the open-source programme; the correctness of the attn_res fallbacks has only been checked against a double-precision reimplementation of the formula, which verifies transcription but not equivalence with the original kernel.

Experiment log

E01: first boot (smoke test)

Configuration: tensor parallelism 2, no expert parallelism, Triton attention, page size 128, 32,768-token context, no speculative decoding. Weights take about 9.25 GB per GPU. The full-attention KV pool holds 289,408 tokens in BF16 and the sliding-window pool 28,928 tokens; about 17.9 GB per GPU was in use after boot. Three temperature-0 prompts returned correct, coherent answers. A single stream decoded at about 71 to 72 tokens per second, including prefill and HTTP overhead on 200-token generations.

This is a smoke test. It does not establish correctness against the reference kernels, task quality, aggregate throughput or long-context behaviour.

B01: withdrawn baseline

The first concurrency sweep ran immediately after server start without a warm-up. Triton and JIT kernels compile lazily on first use of each shape, which inflated first-token latency and depressed the higher concurrency levels. The notebook marks it superseded and says not to quote it, so these numbers are not published here. The harness now runs an unrecorded warm-up pass before every measurement.

P02: where prefill time goes

Uncached prefill, measured with unique random token ids so that the prefix cache cannot help, runs at about 3.1 to 3.2 thousand tokens per second from 1,000 to 16,000 tokens, with the GPU 97.6% busy, so it is not launch-bound. A profile of one 2,048-token forward pass (638 ms of GPU time) shows:

ShareKernel
27.6%NCCL all-reduce in fp32 (MoE combine), 48 calls
14.0%NCCL all-reduce in bf16 (attention output), 49 calls
17.0%Marlin MoE
about 9%attn_res torch fallback
6.9%cuBLAS GEMM
5.2%Triton attention

Source: notebook record. The raw profile trace was not archived, so this is shown here and not in the dataset.

H01: interconnect

nvidia-smi topo -p2p r reports the chipset does not support peer-to-peer and the topology is NODE. NCCL therefore runs over host shared memory at about 5.1 GB/s algorithm bandwidth: a 12.6 MB bf16 all-reduce takes 2.45 ms and a 25.2 MB fp32 all-reduce 4.85 ms. Setting NCCL_P2P_LEVEL=SYS, NCCL_SHM_USE_CUDA_MEMCPY, NCCL_PROTO=Simple, a different NCCL_BUFFSIZE, more channels or NCCL_ALGO=Tree did not help; more channels was 12% worse. Cost is proportional to bytes moved, so the lever is moving fewer bytes.

Source: notebook record. The measurement harness was not archived.

E02: bf16 all-reduce for the MoE combine

Per-rank partial sums are cast to bf16 for the all-reduce when more than 512 tokens are in flight, then back to fp32. In the warm A/B below the benchmark is identical and only the combine precision differs. Inter-token latency is unchanged because decode all-reduces are tiny.

Experiment E02, concurrency sweep. Host: 2x GeForce RTX 3090 24 GB, PCIe only (no NVLink bridge), rented host A. Method: SGLang serving benchmark, random tokens 512 in / 256 out, closed loop. baseline: fp32 MoE-combine all-reduce. treatment: bf16 MoE-combine all-reduce.Each point is a single run (1 repeat).
ConcurrencyOutput tok/s
baseline
Output tok/s
treatment
Change
treatment vs baseline
Total tok/s
baseline
Total tok/s
treatment
TTFT mean ms
baseline
TTFT mean ms
treatment
ITL mean ms
baseline
ITL mean ms
treatment
Requests
173.073.2+0.3%219.0219.623922012.913.016
4214.4213.8−0.3%643.2641.332532717.617.616
16393.8458.6+16.5%1,181.51,375.83,2981,82428.128.164
64493.5520.4+5.5%1,480.41,561.313,89712,81469.567.1256
MeasuredPreliminaryClick a throughput figure for the full run, its limitations and its raw output.
Equivalence check: Prompt-logprob equivalence gate, 3 fixed prompts. Run details.
MeasureValueUnit
Prompt 1: prompt tokens2,061tokens
Prompt 1: mean absolute prompt-logprob difference0.053nats
Prompt 1: maximum absolute prompt-logprob difference1.444nats
Prompt 1: top-1 token agreement0.980fraction
Prompt 1: perplexity, fp32 combine2.499ppl
Prompt 1: perplexity, bf16 combine2.486ppl
Prompt 1: greedy continuation identical (1 = yes)0bool
Prompt 2: prompt tokens1,794tokens
Prompt 2: mean absolute prompt-logprob difference0.062nats
Prompt 2: maximum absolute prompt-logprob difference1.898nats
Prompt 2: top-1 token agreement0.966fraction
Prompt 2: perplexity, fp32 combine2.240ppl
Prompt 2: perplexity, bf16 combine2.247ppl
Prompt 2: greedy continuation identical (1 = yes)1bool
Prompt 3: prompt tokens607tokens
Prompt 3: mean absolute prompt-logprob difference0.010nats
Prompt 3: maximum absolute prompt-logprob difference0.522nats
Prompt 3: top-1 token agreement1fraction
Prompt 3: perplexity, fp32 combine1.171ppl
Prompt 3: perplexity, bf16 combine1.172ppl
Prompt 3: greedy continuation identical (1 = yes)1bool

On the uncached prefill measurement, throughput rose from about 3.17 to about 3.6 thousand tokens per second (+14%; notebook record, raw output not archived).

Quality gate. Three fixed texts (about 4.4 thousand prompt tokens) were run through both servers. Mean absolute prompt-logprob difference was 0.01 to 0.06 nats and top-1 token agreement 96.6% to 100%; one of three greedy continuations differs. Prompt perplexity moved from 2.499 to 2.486, 2.240 to 2.247 and 1.171 to 1.172, which is symmetric rather than a degradation. A repeat of the bf16 server gave bit-identical output, so these differences are real effects and not noise. This is a weak gate: three short texts and no task evaluation. It does not yet show that bf16 combine is free.

E03: DSpark speculative decoding

The model checkpoint ships a speculative drafter. The stock speculative worker insists on FA4 for the draft, so one experimental patch lets it use Triton on SM8x. Eight draft tokens is fixed by the checkpoint; four is rejected at start-up and that run failed to start. Workload is ShareGPT chat prompts (natural text), because random tokens give nothing to predict.

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

Mean accept length was 2.41 tokens per verification step. On these GPUs speculation is a single-stream latency tool: with four or more concurrent requests, verifying eight tokens per request makes the batch compute-bound and aggregate throughput drops. That reading is provisional: these runs used the default decode CUDA-graph cap, which E04 later showed matters at large batches, and G01 will repeat them with graphs enabled.

Correctness. Over six prompts of 256 greedy tokens, two continuations were identical to the non-speculative server. The other four diverge where the top-1 and top-2 token margin is between 0.03 and 0.2 nats in both runs, which is a numerical near-tie between the verify and decode kernels. Prompt-logprob dumps are bit-identical because the prefill path is untouched. This is consistent with lossless verification but is not proof; it needs a task-level evaluation. The Triton draft path ignores an FA4-only window option that matters only beyond the 1,024-token window.

E04: why throughput fell from 16 to 64 concurrent requests

Without speculation, aggregate throughput on the chat workload falls from 483 to 384 tokens per second between 16 and 64 concurrent requests, while mean inter-token latency rises from 28 ms to 136 ms. The first hypothesis was that the sliding-window KV pool, 28,928 tokens against 289,408 full-attention tokens, limited how many requests could run at once. The pool-sizing A/B below tested it and refuted it: raising the memory fraction to 0.85 and widening the sliding-window share changed the pool from about 29 thousand to between 42 and 94 thousand sliding-window tokens, and throughput at 64 requests stayed at 395 to 404 tokens per second with inter-token latency near 138 ms. At 16 requests it was 470 to 471 tokens per second.

Experiment E04, 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. m85: no speculation, larger KV pool (--mem-fraction-static 0.85). m85r30: no speculation, larger KV pool (--mem-fraction-static 0.85 --swa-full-tokens-ratio 0.3). m85r60: no speculation, larger KV pool (--mem-fraction-static 0.85 --swa-full-tokens-ratio 0.6).Each point is a single run (1 repeat).
ConcurrencyOutput tok/s
m85
Output tok/s
m85r30
Output tok/s
m85r60
TTFT mean ms
m85
TTFT mean ms
m85r30
TTFT mean ms
m85r60
ITL mean ms
m85
ITL mean ms
m85r30
ITL mean ms
m85r60
Requests
16471.4471.0470.51,6111,6201,62228.128.128.164
64394.5400.9403.95,8905,9095,894137.8138.6137.5256
MeasuredPreliminaryClick a throughput figure for the full run, its limitations and its raw output.

What the log showed. The server log reported that CUDA graphs were not used for 64-request decode batches. The engine captures decode graphs only up to batch size 48 by default, so larger batches run eagerly and are launch-bound.

The follow-up (notebook record, raw output not archived). Starting the server with --cuda-graph-max-bs-decode 104, which also raised the memory fraction to 0.85, is recorded in the notebook as follows. The raw benchmark output for these runs was not archived, so they are not in the dataset and should be read as an unverified lead until they are re-run with archived output (experiment G01).

ConcurrencyThroughput before (tok/s)Throughput after (tok/s)Inter-token latency after
16482.6472.228.0 ms
64383.8828.356.2 ms
96not run863.374.4 ms

The notebook also records that the number of requests the engine will run at once is capped by its state cache (106 at a memory fraction of 0.85, about five state slots per request), and that the engine log shows the MoE layers running expert-parallel across both GPUs even though --ep 1 was passed. The dataset records launch flags exactly as passed.

Consequence for E02 and E03. Both used the default cap, so their results at 64 concurrent requests, and possibly the speculative-decoding results at four or more, were measured with decode running eagerly at the largest batch. Their limitations say so. Experiment G01 repeats them with graphs covering the tested batch sizes.

Updates

  1. DSpark speculative decoding boots on SM86 with one experimental patch (E03). Single-stream throughput is +19% on a natural-text workload; aggregate throughput falls at four or more concurrent requests.

  2. The first notebook baseline (B01) was withdrawn because it ran without warm-up. It is listed as superseded and not published.

  3. The KV pool hypothesis for the fall in throughput at 64 concurrent requests was tested and refuted (E04). Larger pools changed nothing; the engine had captured decode CUDA graphs only up to batch size 48. A follow-up that raises the cap is reported at about 2.2 times the throughput at 64 requests, but its raw output is not yet archived, so it is not in the dataset. E02 and E03 results at 64 requests were measured with the default cap and carry a limitation.

  4. Warm A/B of the bf16 MoE-combine all-reduce completed (E02). Aggregate throughput rises by about 16% at 16 concurrent requests and 5.5% at 64; single-stream is unchanged. The quality gate is three short texts and is weak.

Publications