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++
prefill: the register top-k from 16K cells of context on gfx1151 (STRATA_TOPK_REG_MIN_BLOCKS, gfx1151's table sets 4096)
libratechwb6ccf873b8b6
diff --git a/CMakeLists.txt b/CMakeLists.txtindex 714c60e2c..235fc7f90 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -1047,6 +1047,9 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP)target_include_directories(qsa_topk_parity PRIVATE ${_strata_gpu_include_directories})target_link_libraries(qsa_topk_parity PRIVATE strata_kernels ${_strata_gpu_runtime_target})add_test(NAME qsa_topk_parity COMMAND qsa_topk_parity --selftest)+ # the register kernel from the smallest prompt batch (the line gfx1151 moves to 4096 blocks): same ids at every case+ add_test(NAME qsa_topk_parity_reg_always COMMAND qsa_topk_parity --selftest)+ set_tests_properties(qsa_topk_parity_reg_always PROPERTIES ENVIRONMENT "STRATA_TOPK_REG_MIN_BLOCKS=0")# ---- P2.S4: the PLE n-gram hash, the IQ4_NL table read, and the PLE block ----# `ngram.cpp` is host-only but lives in `strata_kernels` because `ple.cu` shares its geometry constants, anddiff --git a/docs/STRIX_HALO.md b/docs/STRIX_HALO.mdindex a28df535d..75b642a20 100644--- a/docs/STRIX_HALO.md+++ b/docs/STRIX_HALO.md@@ -92,6 +92,7 @@ they change speed, not answers. Nothing here applies to CUDA or to another AMD a| `STRATA_GDN_HEAD`, `STRATA_GDN_PP=2`, `STRATA_GDN_CONVL2`, `STRATA_GDN_NOY` | the prompt's gated-delta-net recurrence: four lanes per column, two columns per lane, the convolution and the norms fused || `STRATA_HCD_EXACT` | the hyper-connection down projection (N 320, K 10240) in a WMMA kernel that reproduces hipBLASLt solution 1176 / 1177's summation order (`hip_prefill_hcd_exact_parity` checks it bit for bit); it runs only where the table makes hipBLASLt pick one of those two, and says once if it cannot || `STRATA_CVEC_FUSE`, `STRATA_PF_PAD` | a steered layer's write, control vector and next norm in one pass; padded GEMM row strides |+| `STRATA_TOPK_REG_MIN_BLOCKS=4096` | the prompt's QSA top-k uses the register kernel from 16K cells of context instead of 28K (the original kernel is slower there; the selected cells are identical, `qsa_topk_parity` checks it) || `STRATA_Q8_PACKED`, `STRATA_Q6_PACKED`, `STRATA_MMVF_ROWS`, `STRATA_ATTN_LANECELL` | decode layouts and kernels (packed Q8_0 / Q6_K weights, 4-row BF16 GEMV, one-cell-per-thread attention scores) || `STRATA_EXPERT_V2`, `STRATA_TSUM`, `STRATA_LFUSE` | the grouped decode experts (IQ3_S / IQ4_NL), single-butterfly warp sums, fewer launches around the shared expert and the KV append || `STRATA_GDN_SPLIT`, `STRATA_QFUSE`, `STRATA_PLE_BATCH` | the GDN step over four blocks per head, activation images written by their producers, the PLE key / value projections of a verify window at once |diff --git a/src/core/arch_defaults.cpp b/src/core/arch_defaults.cppindex e8ca7c9b7..4cf36dafe 100644--- a/src/core/arch_defaults.cpp+++ b/src/core/arch_defaults.cpp@@ -42,6 +42,7 @@ std::vector<std::pair<std::string, std::string>> arch_default_env(const char* gc{"STRATA_CVEC_FUSE", "1"}, // a steered layer's write, control vector and next norm in one pass (S23){"STRATA_HCD_EXACT", "1"}, // the HC down GEMM in hipBLASLt solution 1176's k order: 64K +1.8% (stream S){"STRATA_PF_PAD", "1"}, // padded GEMM row strides (acts with STRATA_PF_GEMM; inert without it) (S23)+ {"STRATA_TOPK_REG_MIN_BLOCKS", "4096"}, // the register top-k from 16K cells, not 28K: same ids; per 2,048 queries the ref takes 1.0 / 2.4 / 3.9 ms at 16K / 20K / 24K cells, the scan 0.87 / 0.93 / 1.00// decode{"STRATA_Q8_PACKED", "1"}, // the packed Q8_0 decode layout: +2.3% (S26){"STRATA_Q6_PACKED", "1"}, // the packed Q6_K heads (S26)diff --git a/src/kernels/cuda/qsa_select.cu b/src/kernels/cuda/qsa_select.cuindex 22fd0e481..8995937d9 100644--- a/src/kernels/cuda/qsa_select.cu+++ b/src/kernels/cuda/qsa_select.cu@@ -1439,7 +1439,12 @@ void qsa_block_topk(const float* scores, const int32_t* steps, int64_t nq, int64const int64_t reach = counted && active_blocks < max_blocks ? active_blocks : max_blocks;const int64_t fit = (int64_t) TK_T * (counted ? TK_PER_MAX : TK_PER);#if defined(__HIPCC__)- constexpr int64_t kRegMinBlocks = 7168; // gfx1201: below ~28K cells the 1,024-thread kernel's fixed cost loses to the ref+ // gfx1201: below ~28K cells (7,168 blocks) the 1,024-thread kernel's fixed cost loses to the ref. STRATA_TOPK_REG_MIN_BLOCKS+ // moves the line (0: the register kernel always); gfx1151's table sets 4096, the crossover with the cooperative scan+ static const int64_t kRegMinBlocks = [] {+ const char* v = std::getenv("STRATA_TOPK_REG_MIN_BLOCKS");+ return v != nullptr ? (int64_t) std::atoll(v) : (int64_t) 7168;+ }();const bool too_small = counted && reach < kRegMinBlocks;if (old || too_small || reach > fit) {#else