mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1008] Title: 0.1.39 decode is ~15–23% slower than 0.1.38 on AMD (gfx1201/HIP, 2× R9700); prefill unchanged #440
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#440
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 @uptou888 on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1008
Environment: same box, same model, same config for both versions. Linux + AMD HIP (ROCm from host),
2× Radeon AI PRO R9700 32GB (gfx1201), 3970x, 128 GB RAM. Model Qwen3.8-Flash-Next IQ3_S (local pack) + MTP.
Args: --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --max-context 262144 --kv int8 --kv-resident 32768,
STRATA_HIP_WMMA=1 STRATA_SELECT_WMMA=1, "parallel": 1.
decode (128-token runs, 30K/60K/120K/239K prompts):
0.1.39: 63.7 / 53.0 / 54.3 / 49.9 t/s 0.1.38: 72.3 / 64.3 / 67.1 / 58.5 t/s (-15% … -23%)
prefill (same prompts):
0.1.39: 3290 / 3882 / 4289 / 4264 t/s 0.1.38: 3282 / 3872 / 4276 / 4251 t/s (identical)
chat: reason 54.2 → 60.6 t/s, creative 52.1 → 55.7 t/s, repeat 95.7 → 97.6 t/s.
Draft acceptance unchanged (88/60/59% vs 90/61/61%) ⇒ not a speculation effect.
Cross-check: a second machine (same GPUs, 0.1.38) reproduces 72.9 / 64.4 / 67.1 / 58.4 ⇒ the regression is version-specific.
Your notes say the zero-doorbell verify runs only when every expert of a layer is in VRAM and that big cards were
not measured; here every expert is in VRAM (2×32 GB) and the AMD path is untested by you ⇒ looks like a regression there.
Also, with "parallel": 2 the engine exits 1 on the same box:
[strata] the engine stopped unexpectedly (exit code 1). Its last log line: strata verify: captured the batch window over slots 0,1 …
(Can split into a separate issue if you prefer.)
Happy to run variants (STRATA_RING_BYTES=0 / --resident-budget-gib instead of --kv-resident / a debug build) — box available.
@marat-365 commented on GitHub (Oct 6, 2026):
yep I asked claude to run the benchmark as per community guidelines and also compare 0.1.38 and 0.1.39 and I have same findings below
Community benchmark: RX 7900 XTX (Windows, HIP), Ryzen 7 7700, 64 GB RAM
Measured on 2026-10-05 and 2026-10-06 by marat365 on Windows 11. This tests four
models (the original Flash-Next IQ2_XS and Q2_0, the Coder IQ1_M and Swift 1.5 IQ2_XS) in the low-RAM resident mode
with a fixed RAM budget per model, one GPU, and a 131,072-token context limit. It compares the ready-made AMD
engines 0.1.39 and 0.1.38, both run by the same 0.1.39 server and scripts (commit
6f32ec0) with the sameconfiguration per model; only the engine binary differs.
Median decode throughput at 4,096, 32,768 and 128,000 prompt tokens:
So engine 0.1.39 decoded 9-24% slower than 0.1.38 on this machine for every model and prompt length. Prompt
throughput differed by at most 9% between the engines, in both directions, for three models; for the Coder, 0.1.39 read prompts
22-31% slower (243-315 against 353-435 tok/s). Every model found all six needles at 32K and 128K with both engines.
These are the synthetic code-explanation requests of the
RTX 5090 report with greedy decoding and a 256-token output cap;
they do not establish general answer quality or performance on other workloads.
Hardware and software
the process (engine log). Power settings at the AMD Software (Adrenalin) defaults; clocks not fixed. The engine's
startup transfer probe reported 28.1-28.2 GB/s host-to-device; the PCIe link generation and width were not read.
RX 7900 XTX (
"gpu": 1in the configuration).The page file is system-managed on two drives.
X AX V2.
6f32ec070f23ced9f50e704d854d775da52591ab(v0.1.39 plus later commits onmain), Python 3.13.14;packages in python-packages.txt.
strata-windows-x64-hip.zipofv0.1.39 (installed by
UPDATE.bat) andv0.1.38 (unpacked into a separate folder), both
ROCm 10.2.0a20260930, hipBLASLt 100500; see each folder's
BUILD.json. SHA-256 ofstrata.exe:0.1.39
fe616b0f61b0ce1f18f37a9bd65542f883a64e78384230ffb42db927a59a6df2,0.1.38
4479127a360b4ee156aa600553b4a0f97e8c9516c44bf81c01690f6f5ac94920.(they held a few hundred MiB of VRAM in an earlier check); nothing else was using the GPU for compute.
Model and configuration
Model:
ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF, revisioned59f92082b1e93c0e96d60a8b11aab089b52f09(setup'spinned revision):
IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf, 39,225,954,592 bytes, SHA-25692cee27ae5bbadcd732416a0f7a7f0acc092399dbbe8f5a5efa707c2ec0a49d7IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf, 28,800,138,432 bytes, SHA-256316b46f3a2dbd68c900f43136ab9449f9dcc3725dfd8c794847c204bc161e113Both hashes match the RTX 5090 report's verified hashes. The unmodified installer prepared the native pack and the
low-RAM
experts.bin(packs/iq2_xs:dense.binSHA-256d2af3d83...6b13,experts.bin35,454,976,000 bytes,SHA-256
00cfaf10284a838e15e6f95277be7edac516909860d1d19074e77a375c4939c9). The bundled expert profile was used(
data/expert-profile.bin, SHA-2568f59b4aa8873209dff11c11e37bcda9529a1335b724a1afeea37bf6388975baf). No visionencoder.
Setup chose the low-RAM resident mode for this PC (
--low-ram resident). Three settings were then changed by handto keep the engine's RAM use near 20 GB; they are identical for both engines:
--resident-experts(all free RAM less 4 GB)--resident-budget-gib 18auto(shrank to 11.5 GiB on this PC)--expert-cache 10000(10,501 slots, 14.07 GiB)STRATA_UNBUFFERED_LOAD=1pinned RAM.
STRATA_RESIDENT_PIN=0as setup wrote it); the rest are read fromexperts.binunbuffered.auto: chunks of 8,192 tokens. Engine 0.1.38 borrowed 3,146 cache slots (4.21 GiB) during a prompt;engine 0.1.39 borrowed 2,913 (3.90 GiB) and added a 96-slot streamed ring (its #583 default).
--spec 4 --spec-min-p 0.5; suffix drafting on. Experimental speed projection off; no calibration."reasoning_effort": "none"), temperature 0, 256 generated tokens per speed request.The measured configurations are engine-0.1.39/strata-iq2_xs.json and
engine-0.1.38/strata-iq2_xs.json; they differ only in
exeandlib_dirs.Each engine folder has its engine log for the speed session (
engine-speed.log) with every request's timing.(started through the generated
run-iq2_xs.bat;"open_browser": false, host 127.0.0.1, no API key).The other three models
Same setup procedure, the same three hand changes, and everything else as for IQ2_XS above; each was installed by
the unmodified installer with
--low-ram resident. Their results are in thecoder-iq1_m/,q2_0/andswift-iq2_xs/folders, oneengine-<version>/folder per engine, with the configuration (strata-<model>.json)and one engine log for the whole session (
engine-speed-needles.log).ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-Coder-GGUF5348543e0147355ac9cbcb031184a3546350988eIQ1_M/...-IQ1_M-00001-of-00002.gguf29,608,446,496 Be11083ba855e7666b48ea3f2db6a9c3a20c18751a012cc24f948de91b7087fad;-00002-28,800,138,432 B316b46f3a2dbd68c900f43136ab9449f9dcc3725dfd8c794847c204bc161e113ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUFed59f92082b1e93c0e96d60a8b11aab089b52f09Q2_0/...-Q2_0-00001-of-00002.gguf37,623,740,192 B69820c02ec7d0b45ef2ebb19d6620299db749fe2aded7f39f93c6b88b199b720;-00002-as above316b46f3...e113ukisai/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-GGUFb22d729eae29b5796f76fb70f91aef549b9fc52cSwift-...-IQ2_XS-00001-of-00002.gguf39,788,473,344 Bca3b302d3d1eb6eddce3ea4acc79854e6cc5fdc0583e374a6a8b6bb67327743b;-00002-28,363,693,824 Be4996a6de18fd49c58d9a0040fcfd73787db6407c51973f29884bee7b14c9dbbAll six hashes were computed locally and match the LFS hashes the Hugging Face API lists for those revisions.
--resident-budget-gib 12--expert-cache 5433: 7,080 slots, 13.47 GiB--resident-budget-gib 16--expert-cache 11019: 11,019 slots, 14.19 GiB--resident-budget-gib 18--expert-cache 10000: 10,501 slots, 14.07 GiBThe expert-cache values were chosen per model on the same machine so that about 0.5 GiB of VRAM stayed free after
loading with engine 0.1.38 and the default 0.1.38 prompt loan;
--expert-cache Ngrants N times the model's largestexpert blob, so the slot counts differ from N.
Method
community_run.py runs both engines in turn: it points the configuration at one engine, starts
the server, waits for
/healthto report the model loaded, runs the speed and recall measurements, stops theserver, and restores the configuration. community_check.py checks that each engine has nine
speed runs and all six needle cases.
PYTHONUTF8=1(on Windows itsread_text()calls otherwise decode the tokenizer files as cp1252 and fail). It sends one warm-up request(excluded), then three runs each at 4,096, 32,768 and 128,000 prompt tokens, serially and in that order on the
same loaded engine. Each prompt carries a different nonce before the filler, so all 18 speed requests read
their whole prompt (zero reused tokens). The expert cache was filled at startup and kept adapting between
requests; the engine was restarted between the two engines only. Loading time is excluded (0.1.38: 14.5 s,
0.1.39: 21.1 s from launch to
loaded, model files already in the OS file cache).delta, over loopback; with reasoning off it is answer text. Prompt throughput is the engine's freshly read tokens
divided by
prompt_ms; decode throughput isengine_generated / decode_ms(MTP drafts included in the engine'scount).
tools/needle_bench.py --lengths 32k,128k --depths 10,50,90. The needle cases share their filler, sothe second and third case at each length reuse much of the prompt (visible in the shorter times).
(psutil), and the card's dedicated VRAM use, GFX activity, board power and edge temperature through the AMD
display library (
atiadlxx.dll:ADL2_Adapter_DedicatedVRAMUsage_Get,ADL2_New_QueryPMLogData_Get). Theboard-power sensor index was identified by comparing idle (24 W) and load (220-316 W) readings, not from AMD
documentation. Data in each folder's
telemetry.csv.Order of the sessions: the needle runs of both engines on 2026-10-05 from 23:00, then the speed runs of both
engines from 23:52 until 00:29 on 2026-10-06, then the last 0.1.38 needle case (finished 00:34). The first, scheduled speed
attempt failed at the tokenizer encoding before sending any request (see Failures).
The other three models ran unattended on 2026-10-06 with community_night.py: Coder 01:39-03:10,
Q2_0 03:10-04:42, Swift 04:42-06:16. For each model and engine it ran the speed measurement and then the needle
cases on the same loaded engine, checked the result with
community_check.py, and would have rerun an incompleteengine (it was not needed: each was complete on the first attempt). It kept Windows from sleeping with
SetThreadExecutionState. Load times (launch toloaded): Coder 16.1 s / 14.0 s, Q2_0 21.1 s / 15.5 s,Swift 15.6 s / 14.0 s (0.1.39 / 0.1.38).
Results
Each cell is the median [minimum-maximum] of three runs. Every one of the 72 speed requests generated exactly
256 tokens (
finish_reason: length) and reused 0 prompt tokens.Flash-Next IQ2_XS (18 GiB RAM budget)
Total client latency across both engines: 4K 15.1-17.9 s, 32K 71.7-75.1 s, 128K 271.7-280.8 s (per run in each
results.json). Per-run engine timings, draft acceptance and output text are inengine-*/results.json;summary.jsonhas the medians.Decode with 0.1.39 relative to 0.1.38 (medians): -24% at 4K, -19% at 32K, -23% at 128K. The two engines'
configurations and expert placement (10,501 GPU slots, 18 GiB in RAM) were the same. Whether their output texts are
identical was not checked; they are in each
results.json.Swift 1.5 IQ2_XS (18 GiB RAM budget)
Coder IQ1_M (12 GiB RAM budget)
Flash-Next Q2_0 (16 GiB RAM budget)
The three later models read prompts slower than IQ2_XS (about 350 against 470 tok/s at 32K and 128K) and Q2_0
decoded slowest here, although Q2_0 is the smallest download. This report does not establish why; the models ran
later in the night with different RAM budgets, and Q2_0 keeps 1.45 GiB of its experts outside RAM.
An earlier, smaller A/B on the same machine (not part of this report's data; three short prompts per run) found no
engine 0.1.39 setting that restored the decode speed:
STRATA_DEC_BATCH=0,STRATA_GR_FAST=0,STRATA_PLE_BATCH=0,STRATA_MMVQ_WAVE=0,STRATA_HIP_ROUTER_FAST=1andSTRATA_RING_BYTES=0each gave55-60 tok/s against 81 tok/s with 0.1.38.
Memory and power (5 s samples over each engine's sessions, model loaded):
Units: GiB (2^30 bytes). The CSV column
strata_ram_gbholds GiB (working set / 2^30) andvram_mibMiB ofdedicated VRAM in use on the card by all processes (the desktop's share included). No paging or out-of-memory
failure occurred. The
samples include the needle sessions, whose 128K prompts dominate the time; prompt reading keeps the CPU busy
(expert misses are computed on the CPU in this mode).
Correctness and limitations
125,449-125,451), in
*/engine-*/needles*.jsonandneedles*-stdout.txt. The 0.1.38 needle session was interrupted before its last case(the process ended at 23:41 for an unknown external reason; Windows Task Scheduler reported -1); that case
(128K, depth 90) was rerun alone and found (
needles-128k-90.*). The interrupted session's engine log was notsaved;
engine-needles.login the 0.1.38 folder is the rerun's.with
UnicodeDecodeErrorinbenchmark.py'sread_text()(Windows' default cp1252); no timing came from it. Thererun with
PYTHONUTF8=1completed all 18 requests.--resident-expertsthe numbers will differ. The models were measured at different times of the night, notinterleaved, so comparisons between models are weaker than the same-session comparison between the two engines. Short-prompt decode varied most: the first 4K run was the slowest
with both engines (0.1.39: 52.4 tok/s, 0.1.38: 66.4 tok/s, against 62-64 and 81-87 in the two later runs).
explanation; no answer-quality claim is made from it.
@uptou888 commented on GitHub (Oct 6, 2026):
Follow-up after v0.1.40 — the regression is gone, and on both vendors the new version is a net win.
AMD (same box as the original report: 2× R9700 / gfx1201 / HIP, IQ3_S, 256K int8, WMMA, same scripts):
decode 30K/60K/120K/239K : 0.1.39 63.7/53.0/54.3/49.9 → 0.1.38 72.3/64.3/67.1/58.5 → 0.1.40 88.6/77.6/80.7/69.3 (+22% vs 0.1.38)
prefill (same prompts) : 0.1.38 3282/3872/4276/4251 → 0.1.40 3641/4148/4411/4341 (+9%)
chat reason / creative : 0.1.38 60.6·62.0 / 55.7·57.2 → 0.1.40 74.9·75.1 / 68.5·68.6
draft acceptance unchanged (90/62/61%) ⇒ not a speculation effect.
"parallel": 2 (the second half of my original report) now works:
both requests return 200, the engine stays up, /v1/status reports serving: 2.
(0.1.39: both 503, engine exit 1, last line "captured the batch window over slots 0,1".)
220-token requests: serial wall 6.7s vs 2-way wall 6.7s — no aggregate gain at that length, but the
second request no longer waits for the first. So the --batch-on-a-split fix (#776 / #845) lands exactly there.
NVIDIA for contrast (RTX 3080 Ti, sm_86, CUDA, same model, 262K on both sides):
prefill 32K/64K : 592/586 → 965/957 t/s (+63%)
decode 32K/64K : 38.7·45.2 / 43.5·42.5 → 42.5·46.3 / 44.3·44.3
chat repeat/reason/creative : 49.5·50.5 / 41.1·42.5 / 42.8·44.5 → 51.4·52.1 / 43.7·45.2 / 45.7·49.8
draft acceptance 90/73/76% → 96/81/80%
0.1.40 is what all our AMD and NVIDIA boxes run now. Thanks.
@Niko1221 commented on GitHub (Oct 7, 2026):
Thanks for the careful A/B. Please rerun on 0.1.40 (the shared-expert stream is off on HIP there, #826). If the gap is still there, one run each with STRATA_VERIFY_ALL_RESIDENT=0 and with STRATA_RING_BYTES=0 on the same four prompt lengths would show whether it is the all-resident path or the ring. Same ask as in #953.