Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
qsa_select (#337 follow-up): the gfx12 WMMA block scorer is opt-in (STRATA_SELECT_WMMA=1) - it selects slightly differently from the warp kernel; the top-k dispatch by active blocks (the same ids) stays on; docs
Niko12215a826638b446
diff --git a/docs/AMD_HIP.md b/docs/AMD_HIP.mdindex 816608e05..23294c3aa 100644--- a/docs/AMD_HIP.md+++ b/docs/AMD_HIP.md@@ -193,6 +193,10 @@ an RX 9070 XT 16 GB and a Radeon AI PRO R9700 32 GB (both gfx1201), a Ryzen 9 39prompts fell to 718 tok/s; with 96 they gain (1,017 -> 1,211; 16K 1,518 -> 2,032). PR #329(bsorensen110) contributed an equivalent gfx12 WMMA kernel of the same speed (within 1%); this one also masks KVpages that KV streaming has not made resident, as the decode kernel does.+ - The prompt path's QSA top-k picks its kernel by the blocks a query actually has, not the cache's capacity (#337,+ bsorensen110): the same ids, so it is on everywhere. `STRATA_SELECT_WMMA=1` (opt-in, gfx12) adds #337's+ matrix-core block scorer; it selects slightly differently (254 of 256 queries the same) and gained +1.5% on 16K+ prompts at a 262K context on the R9700.- **Known:** rarely (about 1 start in 10) a HIP run's greedy output differs from another start's at some token, onone card or two and on engine 0.1.29 as well; not yet explained.- **Not validated:** images, long contexts beyond 16K, answer-quality benchmarks.diff --git a/src/kernels/cuda/qsa_select.cu b/src/kernels/cuda/qsa_select.cuindex a4dd6c8b4..525184002 100644--- a/src/kernels/cuda/qsa_select.cu+++ b/src/kernels/cuda/qsa_select.cu@@ -675,8 +675,13 @@ bool qsa_block_scores_tc(const float* pooled, const float* dead, const float* q_if (nq <= 0) return true;if (s.idx_dim != IDX_DIM || s.idx_n_head != IDX_HEADS || s.idx_block != R || nq > 65535 * TC_QT) return false;#if defined(__HIPCC__)- // AMD: the gfx12 (RDNA4) WMMA scorer; every other target keeps the warp kernel (false)- if (!sel_gfx12_device()) return false;+ // AMD: the gfx12 (RDNA4) WMMA scorer, opt-in (STRATA_SELECT_WMMA=1): it selects slightly differently from the warp+ // kernel (254/256 queries the same), so the default keeps the warp kernel; every other target keeps it too (false)+ static const bool wmma_on = [] {+ const char* v = std::getenv("STRATA_SELECT_WMMA");+ return v != nullptr && v[0] != '\0' && v[0] != '0';+ }();+ if (!wmma_on || !sel_gfx12_device()) return false;{const int64_t reach = active_blocks > 0 && active_blocks < max_blocks ? active_blocks : max_blocks;const int64_t per = (int64_t) 4 * WITER * 16;