Skip to content

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++

sycl: STRATA_DUMP_SEL (the prompt path's selected cells); INTEL.md - XMX v2 in the full matrix, selection overlap

maxfridbe6b5761d34a8c
diff --git a/docs/INTEL.md b/docs/INTEL.md
index 8b2a64290..ccb55d64d 100644
--- a/docs/INTEL.md
+++ b/docs/INTEL.md
@@ -311,6 +311,14 @@ chunk, INT8, 32K context). This attention is gather-bound: each query position s
the K/V fetch dominates and only 12 of the 16 matrix rows are real heads. Opt-in: `STRATA_PROMPT_ATTN_XMX=1`
(64-cell chunks, 120 KB of local memory) or `=32`.
+**XMX v2 in the full matrix, and why a grouped kernel is not next (2026-09-30).** With `STRATA_PROMPT_ATTN_XMX=1`
+(stage timing on, ~8-10% overhead) the long prompts run 23-33% slower than with the FP32 attention: 128K int8 666 vs
+960 tok/s, k8v4 596 vs 983; 256K k8v4 506 vs 752, int8 536 vs 718 (q4_0 does not use the XMX kernel). The obvious
+fix, gathering the union of neighbouring positions' cells once, depends on how much their selections overlap.
+Measured on the last chunk of an 80K prompt (first QSA layer, `STRATA_DUMP_SEL=<file>`): the union of 8 consecutive
+positions is 3.3x one position's 2,051 cells (16: 5.1x), and only 12% of a selection is shared by all 8. Grouping
+would cut the K/V gather to ~40% but multiply the arithmetic by 3-5x: at best 5-8 s of an 80K prompt. Not built.
+
**Keeping up with upstream.** A merge of upstream `main` into `b70` leaves the copies in `sycl/` behind
wherever upstream touched a file they mirror. They are refreshed by re-migration, not by hand (done for
0.1.25-0.1.27, 2026-09-30):
diff --git a/sycl/src/prefill/prefill.cpp b/sycl/src/prefill/prefill.cpp
index 20cd88444..348167925 100644
--- a/sycl/src/prefill/prefill.cpp
+++ b/sycl/src/prefill/prefill.cpp
@@ -1762,6 +1762,25 @@ bool Prefill::run(const int64_t *tokens, int64_t n, int64_t pos0,
// decode kernel, 32 queries at a time (K8V4 runs the tensor kernel's mode 3: INT8 K,
// V dequantized from its q4_0 blocks to fp16 at gather)
static const bool old_attn = std::getenv("STRATA_PROMPT_ATTN_OLD") != nullptr;
+ // STRATA_DUMP_SEL=<file>: the selected cells of every prompt position of the first QSA layer of the
+ // last chunk (int32 T, cap, then T*cap ids and T widths) - the input to the grouped-gather study
+ if (static const char* dsel = std::getenv("STRATA_DUMP_SEL"); dsel && c0 + T >= n && qsa_index == 0) {
+ m.cs->wait();
+ std::vector<int32_t> ids_h((size_t) T * m.cap), st_h((size_t) T * strata::kernels::kStepCount);
+ m.cs->memcpy(ids_h.data(), m.sel_ids, ids_h.size() * 4).wait();
+ m.cs->memcpy(st_h.data(), m.steps_dev, st_h.size() * 4).wait();
+ if (FILE* f = std::fopen(dsel, "wb")) {
+ const int32_t hdr[2] = {(int32_t) T, (int32_t) m.cap};
+ std::fwrite(hdr, 4, 2, f);
+ std::fwrite(ids_h.data(), 4, ids_h.size(), f);
+ for (int64_t t = 0; t < T; ++t) {
+ const int32_t w = st_h[(size_t) t * strata::kernels::kStepCount + strata::kernels::kStepWidth];
+ std::fwrite(&w, 4, 1, f);
+ }
+ std::fclose(f);
+ std::fprintf(stderr, "strata: selection of %lld positions dumped to %s\n", (long long) T, dsel);
+ }
+ }
if (old_attn || !strata::kernels::qsa_prompt_attn_batch(m.q, pools, m.sel_ids, m.steps_dev, m.cap, s,
m.attn, T, m.cs))
for (int64_t t0 = 0; t0 < T; t0 += m.attn_batch) {