Repository navigation
Description
AREA: [Engine] (speed, kernels, models, the server and API)
TERMINAL OR SOURCE: Source (START-HERE.bat / release folder)
REPRODUCTION STATUS: Reproduced locally
POLYSTRATA VERSION:
- Reported build: PolyStrata 0.2.20-poly.4-hotfix (engine 0.1.66); also tested 0.2.20-poly.1 and 0.2.20-poly.2
- Baseline build: PolyStrata 0.1.45-poly.10 (engine 0.1.45)
GRAPHICS CARD, MEMORY AND SYSTEM:
AMD Radeon RX 6600 8 GB (RDNA2, gfx1032) | Ryzen 7 5700X3D | 32 GB DDR4-3600 | Windows 10 (10.0.19044)
MODEL, SIZE AND SETTINGS:
Tiel Coder 35B-A3B UD-Q4_K_XL (MoE, 10496 routed experts) | 128K context (--max-context 131072) | --expert-profile --kv-whole | backend hip | thinking on and off. All settings identical in both builds; the only variable is the PolyStrata/engine version.
WHAT HAPPENED
Problem: on this gfx1032 card, the 0.2.20 engine reads prompts 1.5-2.5x slower than 0.1.45 at every prompt size, and writes ~16% slower, with identical flags on the same machine. 0.2.20-poly.1 additionally oscillated the expert cache around every request, collapsing prefill to 73-85 tok/s on some rounds; poly.2 fixed that oscillation, but the prefill/decode gap versus 0.1.45 remains in poly.2 and poly.4-hotfix.
Expected: docs/OLDER_GPUS.md lists older Radeon as supported ("built, not tested on a real RX 6600"), and the community benchmark table shows comparable AMD cards at much higher prefill (RX 7800 XT gfx1101: 885 tok/s at 4K, 873 at 16K; RX 7600 gfx1102: 481). My own 0.1.45-poly.10 runs on this same card reach 497-585 tok/s prefill, so 0.2.20 reaching only 214-275 looks like a regression rather than a hardware limit.
Actual: see tables. All numbers are medians of 3 rounds; individual rounds are shown to preserve variability.
Endpoint harness (custom: prefill = max_tokens=1 with a fresh random filler prompt each round so nothing is prompt-cached; decode = 400-token generations; temperature 0; median tok/s; actual prompt sizes ~1.8k / 7k / 14k / 29k tokens):
| Build | 1.8k | 7k | 14k | 29k | decode (thinking on) | decode (thinking off) |
|---|---|---|---|---|---|---|
| 0.1.45-poly.10 | 365 | 497 | 478 | 408 | 59.0 | 59.4 |
| 0.2.20-poly.1 | 73.7 | 85.6 | 223.6 | 79.3 | 56.6 | 57.3 |
| 0.2.20-poly.2 | 217.1 | 267.5 | 262.6 | 240.7 | 50.7 | 49.2 |
| 0.2.20-poly.4-hotfix | 214.7 | 265.7 | 261.0 | 239.0 | 49.7 | 49.8 |
The project's own suite (tools/strata_bench.py, standard protocol, x3 runs), 0.1.45-poly.10 vs 0.2.20-poly.1:
| Metric | 0.1.45-poly.10 | 0.2.20-poly.1 |
|---|---|---|
| 4K prompt tok/s | 570.1 (rounds 562-571) | 224.6 (rounds 98.9-262.0 - bimodal) |
| 16K prompt tok/s | 583.9 (582-585) | 274.7 (274.6-275.0) |
| 4K first token | 7.05 s | 17.9 s |
| 16K first token | 27.5 s | 58.5 s |
| chat decode | 48.3 | 45.9 |
| agent decode (6-turn session) | 43.2 | 40.0 |
| agent turn first token, median of 15 turns | 9.12 s | 19.49 s |
| agent cache hit | 70% | 70% |
Both suites ran on the same machine on the same day. Note: the 0.1.45 build's bench tool misdetected the GPU as "RX 6900 XT 16 GiB" in its generated README; this host has only an RX 6600, and the engine's own "this card's 8176 MiB" line (below) confirms the actual card in both runs.
SMALLEST STEPS OR COMMAND THAT REPRODUCE IT
- Host Tiel Coder 35B-A3B UD-Q4_K_XL with --max-context 131072 --expert-profile --kv-whole (default chunk settings in both builds).
- Run the project's own benchmark on each build: 0.2.20 folder -> BENCH.bat (tools/strata_bench.py); 0.1.45 folder -> tools/strata_bench.py --compare <0.2.20 report dir>. Compare the 4K/16K prompt rows and first-token times in the two generated READMEs.
- Or drive the API directly: POST /v1/chat/completions with temperature 0, max_tokens=1 and a fresh random filler prompt (~1.8k-29k tokens), 3 rounds per size; prefill tok/s = prompt_tokens / elapsed. 0.1.45: 365-497; 0.2.20-poly.4-hotfix: 214-266.
Reproduced on every round of every size, in both harnesses, across poly.1/poly.2/poly.4-hotfix.
LOGS (sanitized excerpts from strata-tiel-ud-q4_k_xl.log)
0.1.45-poly.10 - static cache, no resize lines during any run:
strata: Windows budgets 7280 of this card's 8176 MiB for this process; free VRAM is counted within that (STRATA_WDDM_BUDGET=0: off)
strata-poly: loaded in 8.7 s; 470 of 10496 routed experts in VRAM (0.8 GiB), 11 CPU threads
0.2.20-poly.1 - cache resizes around every request (prefill speed tracks cache size: rounds starting at ~456-539 experts ran 183-229 tok/s, rounds starting at the shrunk 316 ran 70-85):
strata-poly: the expert cache 512 -> 557 experts (0.99 GiB) for the VRAM free now, 515 MiB left
strata-poly: the expert cache 697 -> 512 experts (0.91 GiB) for the VRAM free now, 599 MiB left
strata-poly: the expert cache 750 -> 441 experts (0.79 GiB) for the VRAM free now, 680 MiB left
0.2.20-poly.2 and poly.4-hotfix - oscillation gone (zero resize lines during the full benchmark; round-to-round spread <1%), new lazy residency at load:
strata-poly: loaded in 8.3 s; 0 of 10496 routed experts in VRAM
strata serve: prompt 13921 tokens = 0 reused + 13921 read in 53315 ms (261.1 tok/s), 1 generated in 1 ms (964.9 tok/s)
Suspected path (the claim of this report is the observed measurements above; the code reading is supporting context, not an unconfirmed static-analysis claim): 0.2.20 adds Engine::lend_prompt()/Engine::take_prompt() (kStageRows = 32, so every prompt >= 32 tokens triggers it) - prompt/work-buffer VRAM is lent to the expert cache between requests and taken back at each prompt start via a shrink that evicts the least-used experts; mind_vram() then grows the cache again. That explains poly.1's oscillation. It does not explain why poly.2/poly.4-hotfix, with a stable cache, still read at ~215-266 tok/s where 0.1.45 reads at 365-585 on the same card: the remaining gap appears to be in the 0.2.20 prefill compute path itself on gfx1032 (no matrix cores; the engine prints "STRATA_GDN_MMA: unchanged (needs a CUDA build)", so the MMA path is inactive here).
WHAT I TRIED AND WHERE I AM STUCK
- STRATA_FREEZE_EXPERTS=1 on 0.2.20-poly.1: oscillation disappears (zero resize lines), prefill becomes fully stable at 187/232/228/211 tok/s (1.8k/7k/14k/29k), but decode drops to 42.6/41.2 (-25%) because the split is pinned to the load-time profile hot set. A stability/quality tradeoff, not a fix.
- Chunk defaults (--prompt-batch, --stage-mib) are identical in both builds; I found no documented setting that recovers 0.1.45-level prefill on this card.
Questions:
- Is the prefill gap versus 0.1.45-poly.10 on RDNA2 (gfx1032) known/expected, or a regression worth chasing?
- Is there a recommended setting for an 8 GB RDNA2 card (--expert-cache N pinning, --vram-reserve-mib, STRATA_DEFAULTS=026), or a way to opt back into the 0.1.45 prefill path?
- Should the lazy "0 experts in VRAM at load" strategy warm the hot set before the first request? Cold reads are noticeably slower than 0.1.45 (e.g. 145 tokens: 970 ms vs 1295 ms; 44 tokens: 518 ms vs 1804 ms).
Searched first: #148 (request to port chunked prefill - different topic), #195 and #281 (gfx1102 deadlock / decode collapse - different GPU and symptom). No open or closed thread covers a gfx1032 prefill regression between 0.1.45-poly.10 and 0.2.20.
Activity
JuggyBob commentedon Nov 24, 2026
Related crash report on a different RDNA card: #305 — 0.2.20-poly.2 on gfx1102 (RX 7600 XT) faults in
amdhip64_7.dll(0xC0000005 at offset0x2d874a) on the first request after a dynamic expert-cache growth line (5452 -> 5504 experts). Reproduced 6 times across 2 attempts. YourSTRATA_FREEZE_EXPERTS=1observation is the leading hypothesis there too; I am testing it now and will append the result to #305.giorgiorossi commentedon Nov 24, 2026
Same regression on gfx1101 (RX 7800 XT), and it is not the config: putting the 0.1.45-poly.10 env/args back into the 0.2.20 engine does not recover it.
Hardware: RX 7800 XT 16 GB (gfx1101), Ryzen 9 7900, 32 GB, Windows 11, ROCm 10.2.0a20260930 (TheRock), hipBLASLt 100500.
Builds: 0.1.45-poly.10 (engine 0.1.45) vs 0.2.20-poly.2 (engine 0.1.66), both local HIP builds for gfx1101, same GGUF files in both.
Method: one fixed 48,000-character text (~18.7k prompt tokens), temperature 0,
max_tokens=1, a fresh random marker at the start of each prompt, one server per build, second run reported. The same API harness on both builds.The old config copied into the new engine was exactly the 0.1.45 one:
env
STRATA_POLY_STAGED_TILES=8,16,32,STRATA_HIP_PREFILL_FP32=2,STRATA_HIP_SPLIT_ATTEND=1;args
--vram-pool --kv q8_0 --cache-bias 1.0 --tail-skip 6 --threads 16 --vram-reserve-mib 768/1024 --prompt-batch 1024/2048 --stage-mib 512 --stage-ahead 2048.The new tuning differs only by dropping the staged tiles/stage args (it was faster on an 839-token prompt). Neither recovers long-prompt prefill.
Two more data points:
This matches #289: it is the 0.1.66 long-prompt HIP path, not the flags. It reproduces with poly.4-hotfix as reported there (same engine 0.1.66).
Is this on the roadmap? The only candidate I see is #292 (opt-in AMD int8 prompt kernel), but it is not merged and was measured on Inkling/i-quant; we have not tested it on Qwen35 K-quants or Tiel IQ3_XXS.
poly: the int8 prompt kernel for every type it takes on AMD, STRATA_P…
okada-shogo commentedon Nov 24, 2026
Thanks for the detailed report and the second data point on the 7800 XT.
Cause. Since 0.2.20, the default HIP build no longer uses llama.cpp's MMQ kernels for prompt products. It uses Strata's own kernels instead (a94e923, a PolyStrata change, not from upstream Strata). On AMD, any matrix that the FP16 tiles can't take falls back to a slow loop: dequantize each expert's matrix to FP16, then call rocBLAS once per expert. That covers every K-quant on RDNA3 and everything on RDNA2. The flags and the Strata 2 rebase are not the cause. The same 0.2.20 source built with -DSTRATA_POLY_MMQ=ON is as fast as 0.1.45.
RX 7800 XT (gfx1101), Linux, ROCm 7.2.4, Qwen3.6-35B-A3B UD-Q3_K_M. Prompt tok/s, mean of 2 runs:
Fix. Prompt products now go to our own int8 kernel by default on RDNA3 and RDNA4 (branch port/hip-int8-auto, on top of #292). On RDNA2 they go to a dot4 version of the same kernel (port/hip-int8-rdna2). The activations are int8 with one scale per 32 values. That is the same rounding class as llama.cpp's MMQ, which 0.1.45 used: against the old FP16 path, KL is 0.0035 for the fix and 0.0030 for the MMQ build. STRATA_POLY_HIP_INT8=0 brings back the 0.2.20 path.
RX 6600 (gfx1032). The RDNA2 version produces bit-identical results to the RDNA3/CUDA kernel in our tests, but we have no RDNA2 card, and on a stand-in it is still slower than 0.1.45's MMQ there; we are working on its speed. Once the PR is up, could you build it for gfx1032 and run your 4K/16K prompt bench against 0.1.45 again? Also note ROCm 10 adds its own slowdown on top of this, which is tracked separately.
The expert-cache oscillation from poly.1 was fixed in poly.2, as you saw.
poly: the int8 prompt kernel is the default on AMD's RDNA3 / RDNA4 (i…
kernels: the int8 prompt kernel on RDNA2 by the signed dot4 (gfx1030-…
VecSzn commentedon Nov 25, 2026
@okada-shogo Please open PR for port/hip-int8-auto and port/hip-win-no-lend.
okada-shogo commentedon Nov 25, 2026
@VecSzn Both are open now: #330 (int8 by default on AMD, after #292) and #334 (the Windows crash fix for #305).