mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4194] [Benchmark] 2x Radeon AI PRO R9700 (gfx1201, TRX40 PCIe 4.0 x16): DSpark auto-disable policy misfires on 2-GPU TP=2 systems — --dspark on gives +35/+44/+52% decode #1844
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1844
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dolphin-creator on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4194
Setup
current_link_speed=16.0 GT/s,current_link_width=16; the bridge/GPU silicon advertises up to 32.0 GT/s i.e. Gen5-capable hardware, the internal switch→die links inside each card run at Gen5 x16; host link is platform-limited to Gen4 x16 as designed)strata-dsv41 0.1.49.2 build d2d198a49, Linux source build; weights: DeepSeek-V4.1-Flash GSQ-RCO IST 2.00bpw (IQ2_XXS mixed set, 256.8 GB pack, zero-copy recipe from docs/DEEPSEEK41.md)Protocol
One-shot engine launch per run, fixed ids file (same prompt across runs), 128 tokens generated, temperature 0. Per context length: 1 warm-up + 3 measurement runs. Decode/prefill rates taken from the engine's own
decode:/prefill:output lines. 12+12 runs, all rc=0. The OFF arm uses the default--dspark auto(which the engine resolved to "disabled" here — see counters below); the ON arm uses--dspark on. Weights (256.8 GB) stay on NVMe; the "pack" is the zero-copy metadata pack (~9 MB) pointing at them in place, per docs/DEEPSEEK41.md.Results (median, spread in parentheses)
--dspark auto(DSpark disabled)--dspark onVRAM is identical in both arms: max 31.61/31.63 GiB per card (native placement, never OOM). Engine VmHWM 44.7 → 44.3 GiB. Prefill is unaffected by the drafter in principle; the 1K delta reflects warm-up, the 8K −4% is within run-to-run noise/cache state.
DSpark was silently off with
--dspark auto— native countersWith
--dspark auto(default), all 12 runs show:plus the engine's own message:
With
--dspark on, same protocol:Across lengths: 43–47 rounds per 128 tokens, 67–71% of draft positions accepted, 2.72–2.98 tokens per forward pass of the main model.
The problem
The
autorule (ds4_model.cu, ~L1998-2005) compares routed-expert bytes against free VRAM aggregated across all TP devices (per-devicefree0minus the configured reserve): 132.1 GB of routed experts vs 67 GB of aggregate free VRAM, threshold 1.5x → 132.1 > 100.5 → drafter disabled. On this 2-GPU TP=2 box the empirical outcome is the opposite of the "gain nothing" prediction: forcing the drafter is strictly better at every length, with the gain growing with context (+52% at 8K), and peak VRAM unchanged (the native memory manager absorbs the 7.98 GB Q8_0 drafter without increasing peak VRAM usage or causing OOM in our measurements; we deliberately do not claim identical expert residency, which identical peaks do not prove).Note this also differs from the docs framing that DSpark only pays off at 4xR9700: on this 2xR9700 box it already pays off heavily — it just never gets a chance because the heuristic disables it.
Suggestion
The static bytes-ratio seems to be the wrong axis, not just its scale: with the offload store active, the verify rounds read the routed experts through the same streaming path that already services ordinary decode steps, so "expert bytes vs free VRAM" overestimates the verify cost. Concretely:
--dspark-auto-threshold N); on this box the effective ratio is 1.97 (132.1/67) and the outcome at that ratio was +52%, so the working range for offloaded-weights setups is above the hard-coded 1.5,autoon the observed economics: run a short verify round and disable the drafter only if measured acceptance/verify cost says so,autodisables the drafter, print that--dspark onis worth measuring on this class of system (offloaded experts, TP>=2), since hereautois a silent 30-50% performance cliff.Also worth reconciling with #4123 (Maya streams the DSpark windows) — if the verify-cost model changes, this heuristic likely needs the same revisit.
Happy to provide raw bench.tsv, engine logs and sampler CSVs (VRAM/RAM/page-faults, 120 samples per run) if useful.
@dolphin-creator commented on GitHub (Oct 26, 2026):
Second data point on this heuristic, same box and engine build (
d2d198a49): the IQ2_XS GSQ-RCO build (2.13 bpw, mixed IQ2_XXS/IQ2_S/IQ2_XS/IQ3_XXS per the shipped allocation file; ~155 GB routed experts) vs our IQ2_XXS (2.00 bpw, ~132 GB). 12 runs per arm (1 warm-up + 3 measured per length, 128 tokens generated), medians:--dspark autodecode 1K/4K/8K--dspark onThe native per-run counters explain the split. With
--dspark on, on XXS the drafter offered 113–132 drafts per 38–51 rounds (~2.4–2.9 drafts per round, 67–75 % accepted, 2.5–3.4 accepted tokens per round). On XS it offered only 22–35 drafts per 92–106 rounds (~0.3 drafts per round) — and its per-draft acceptance rate is actually higher (90–100 %): the loss is entirely in draft productivity, not in verification acceptance.So a binary expert-bytes vs aggregate-free-VRAM threshold cannot separate "huge win" from "marginal": on this box both builds exceed 1.5x aggregate free VRAM (~67 GB across 2x R9700), yet one gains 35–52 % and the other 4–7 %. The engine already logs exactly the quantity that matters (drafts offered per round). Suggestion: gate the auto-disable on measured draft productivity (offered-per-round), or default to
onwith a documented opt-out — and the "gain nothing" log line should probably only fire when drafts really stop being offered/accepted, not from the static size rule alone.@dolphin-creator commented on GitHub (Oct 27, 2026):
Follow-up on #4194 — root cause found on our side: wrong
dspark_noise_token_idin our IQ2_XS pack (+ full before/after numbers)TL;DR: We hit the same IQ2_XS + DSpark underperformance described in #4194. The root cause was in our own GGUF pack metadata, not in the engine:
tokenizer.ggml.dspark.noise_token_idwas0(BOS) instead of128799(<|System|>). After fixing that single value in a copy of the pack and using the same benchmark protocol as our historical runs, decode throughput goes +23.6% / +13.5% / +32.1% at 1K/4K/8K and draft acceptance stops being degenerate. We think the loader could surface this class of metadata mistake more loudly — concrete suggestion at the end.The finding
Our IQ2_XS (GSQ-RCO mixed, ~2.13 bpw) pack of DeepSeek-V4.1-Flash carried:
dspark.noise_token_id = 0→ that's the BOS token128799→<|System|>in this tokenizerpack_gguf.py(L220) defaultsnoise_token_idto0, and our packing command simply never passed the--dspark-noise-tokenflag, so the default silently shipped in the GGUF. To be explicit: this is a bug in our packing pipeline, not a Strata engine bug — the engine faithfully consumed the metadata it was given. We are reporting it because the failure mode is silent: everything "works", the drafter just barely contributes, which looks like the model/GPU being slow.Evidence 1 — isolated A/B, single variable (27/10)
Same engine binary, same pack, same prompt ids (ids_1024, n=128, conf 0.5), only
ds4.txtline 39 changed0 → 128799:The 97% "acceptance" on the broken pack is an artifact: with ~0.4 offers/round, whatever tiny thing gets proposed is trivially accepted. Pack identity across the two arms is established by the single-line
ds4.txtdiff and matching pack file SHAs (the copy differs in nothing else); the first-divergence-at-index-51 observation is a downstream consequence of the fix — the corrected drafter changes the generated sequence — not the identity check itself.Evidence 2 — full campaign, frozen hashes (27/10, one window)
Protocol: same engine + drafter + prompt ids as our historical reference runs, 3 contexts × (1 warmup + 3 measured) = 12 runs, all rc=0, medians of 3 measured runs. Frozen SHAs: engine exe
d0e16cfd…(Strata 0.1.49.2, build idd2d198a49), broken packds4.txtf7a188aa…, fixed packds4.txt064526dc…. Hardware: 2× 32 GB AMD GPUs (gfx1201), TP=2.Decode (tok/s, DSpark ON, medians):
Drafting counters (last measured run per context):
The signature of the fix is identical across all three contexts: ~2.2–2.5 offers/round (vs ~0.41 on the broken pack) and 60–71% acceptance — squarely in the normal band.
Annex — for scale, our IQ2_XXS pack on the same engine/drafter (frozen reference, different pack): 38.40 / 44.99 / 49.06 tok/s at 1K/4K/8K DSpark ON. The fixed XS pack lands within −5.4% / −11.4% / −3.3% of XXS, which is what we'd expect for a mixed build at ~2.13 bpw.
Prefill medians on the fixed pack: 125.4 / 235.4 / 317.2 tok/s (unchanged in character — this metadata only affects draft dynamics, not prefill).
Minimal repro
ds4.txt, line 39:0→128799(the<|System|>vocab id for this tokenizer).The drafting counters (offers/round, acceptance) visibly shift on the very first run.
Suggestion (constructive, engine side)
We found no evidence of an engine-side computation bug in this investigation, but this failure mode is completely silent. Two cheap guards could turn a week of perf-chasing into a one-line warning:
--dspark-noise-tokenis not provided and the default (0 / BOS) is used, emit a warning, or refuse when BOS ≠ the intended noise token for the vocabulary.noise_token_id == bos_token_id, print a one-line warning ("noise_token_id equals BOS — did you pack this with the right --dspark-noise-token?").Happy to PR the check if useful, tell us where you'd rather see it.
Honest caveats
--dspark-confflag) — same as our historical references; the explicit conf 0.5 was only used in the isolated A/B.We hope this saves anyone else who packs DSpark-enabled GGUFs from the same silent footgun. Thanks for the engine!
@Niko1221 commented on GitHub (Oct 29, 2026):
Thank you for measuring this and writing it up. We are building a Strata website with a page for community benchmarks, and results like these will be added there when it launches, so we are closing this here. If your numbers change with a new version, you are welcome to post them again.