mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3926] [Engine] qwen35moe on gfx1030: turn STRATA_DENSE_MMQ on in setup's config (prompts +47-67% on an RX 6900 XT, KL 0.0033) #1679
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#1679
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 @schmittcn on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3926
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
On an RX 6800 / 6900 the Qwen3.6 path (GGUF architecture qwen35moe) runs the prompt's dense GGUF projections as
dequantize + rocBLAS. The opt-in
STRATA_DENSE_MMQ=1(#820) runs them through the int8 MMQ kernels instead. On theQwen3.6 path this reads prompts 47-67% faster on an RX 6900 XT, so an agent turn waits about a third less. Only users
who read docs/AMD_HIP.md turn it on today.
Measured
Hardware and software:
7ddc17a3. Its local changes are insrc/qwen35and only add options this rundoes not use.
Qwen3.6-35B-A3B UD-Q4_K_XL (the family's default file). Setup's arguments:
--native ... --max-context 131072 --prefill auto --mtp 2, f32 KV. EnvSTRATA_HIP_PROMPT_F16=1. (That switch turned out to have no effect on this path: re-measured without it on stock9f7d977d, the dumps with and without it are byte-identical and the MMQ gain is the same, see this comment.)tools/strata_bench.py(the community suite), oneserver per arm, median over its runs:
STRATA_DENSE_MMQ=1Quality. The prompt was 30,050 tokens plus 200 tokens the default generates greedily, teacher-forced in both arms
(
strata-q36 --tokens/--force,--dump-full-logits,STRATA_HIP_PROMPT_F16=1in both). Against the default theswitch gives:
As #820 says, greedy text diverges after a while (the q8_1 activation rounding).
A second model. An Ornith-1.5-35B-A3B i1-IQ4_XS (a qwen35moe fine-tune) gave 4K 1375 -> 2419 and 16K 1088 -> 1651
tok/s (the speed run used a modified variant of that model, the KL check the original file), and mean KL 0.0134 / top-1 97.5% on the same
kind of check.
Proposed behavior
install_own_pathwrites"env": {"STRATA_DENSE_MMQ": "1"}into the config when the card is gfx1030. Nothing elsechanges:
The branch is https://github.com/schmittcn/Strata/tree/pr/hip-dense-mmq-qwen36: 6 lines in
setup.py, a setup test(gfx1030 gets the entry; gfx1031, gfx1100 and non-HIP do not), and the AMD_HIP.md paragraph. I would open it as a PR
once the scope is agreed.
Tradeoffs and open points
+47-67% prompt speed on this card?
did not check whether the q36 path's expert swaps carry the same risk. I saw no hang in a day of use with the switch
on, plus the benchmark runs.
What do you do today instead?
Set
"STRATA_DENSE_MMQ": "1"in the config's"env"by hand.@mkw432 commented on GitHub (Nov 3, 2026):
Confirmation on a different RDNA2 card (RX 6700 XT 12 GB, gfx1031), engine 0.1.56, built from source.
MMQ alone was not enough. With
STRATA_DENSE_MMQ=1and--prefill 512: 4K prompt 710.4 → 713.8 tok/s (+0.5%), 16K 606.6 → 696.2 (+14.8%).The combination reproduces the claim. Same model and context with
STRATA_HIP_PROMPT_F16=1and--prefill auto:So the gain is in the combination, not in MMQ at a fixed prefill chunk.
Configuration: Qwen3.6-35B-A3B UD-Q4_K_XL,
--max-context 24576 --mtp 0, FP32 KV,--pool-workers 5 --expert-vram 3.25, RX 6700 XT 12 GB / Ryzen 5 5600X / 31 GiB RAM, in-kernel amdgpu, one engine at a time.Quality: as you noted, the switch changes outputs (q8_1 activation rounding). On four held-out coding tasks (single-shot generation, hidden checks executed in a bwrap sandbox) this configuration passed 4/4, including 8/8 checks on the hard one. Small sample, so I would keep it opt-in, but there were no failures.
Suggestion: this is a large enough prompt gain on gfx103x that setup or
strata launchcould offer it with a one-line quality note, rather than leaving it to docs-only discovery.@schmittcn commented on GitHub (Nov 6, 2026):
Thanks for the gfx1031 numbers. They made me check whether my measurement depended on
STRATA_HIP_PROMPT_F16=1, which I had set in both arms. It doesn't: that switch has no effect on the Qwen3.6 path.Why. AMD_HIP.md, RDNA2 explains the gfx1030 problem: rocBLAS has tuned kernels only for FP16-in / FP16-out, and FP16-in / FP32-out runs generic kernels about 6.6x slower.
STRATA_HIP_PROMPT_F16=1moves the generic prefill path onto the tuned route (f16_io_, set insrc/prefill/prefill.cpp). The q36 path never sets it: its dense projections goGemm::native→ dequantize to FP16 →Gemm::f16, FP32 out, i.e. the slow kernels. So on qwen35moe neither the F16 switch nor the rocBLAS table helps, and the engine log shows no F16 line (not even the gfx103x tip).STRATA_DENSE_MMQ=1skips rocBLAS for these products, which is why it is the lever here. #820 measured the same shapes about 7x faster through MMQ on RDNA2.Re-measured on stock
upstream/main(9f7d977d), RX 6900 XT, same file and setup args (131072,--prefill auto,--mtp 2, f32 KV), four arms:Teacher-forced full-logit dumps (29,750-token prompt + 200 tokens): F16 vs default and MMQ+F16 vs MMQ are byte-identical. MMQ vs default: mean KL 0.0029, p99 0.029, max 0.055, top-1 99.0%.
So the gain is MMQ alone, and the proposal (only
STRATA_DENSE_MMQ=1) is the measured configuration. On your card I'd expect the gap between your two runs to come from--prefill 512vsauto: with 512-token chunks the dense GEMMs are small, so MMQ has little to win. Setup already writes--prefill auto. gfx1031 should have the same rocBLAS limitation as gfx1030. If you have the time, MMQ on/off with--prefill auto(F16 doesn't matter) would show whether to include it.Other cards stay out of the proposal on purpose: RDNA3 and RDNA4 have hipBLASLt tables and WMMA, so their dequantize + BLAS route isn't the slow path, and I have no measurement there.
Developed with an AI coding assistant.