[Engine] SYCL: the lane-cell prompt attention default is for Battlemage (Xe2) cards only

On an Arc A750 the lane-cell score phase read a 4,106-token prompt 0.7% slower than the unchanged kernel (three
interleaved runs against the published 0.1.52 engine; with STRATA_ATTN_LANECELL=0 the branch matched it), while it is
+5% on the Arc Pro B65.  The default now follows strata::intel_gpu_gen(): the runtime's architecture enum first, the
device name only as a fallback.  STRATA_ATTN_LANECELL=1/0 still forces either way on any device.
This commit is contained in:
Niko1221 committed 2026-10-29 12:47:50 +01:00
1 parent 6124c35e39
commit f2bf7a3ce3
1 file changed
+8 -2
+8 -2
View File
@@ -668,12 +668,18 @@ void qsa_decode_attn_batch(const float* q, const QsaAttnPools& pools, const int3
// S25: the score phase one cell per thread (bit-identical scores, no shuffle reductions). Prompt batches take
// it by default: on 2x Arc Pro B65 it reads a 4,106-token prompt 5.2% faster, 8,191 tokens 5.2% and 16,380
// tokens 4.8%, with the same tokens; the decode window's few queries per call are 1.4% slower with it (56.6-57.0
// against 55.9-56.3 tok/s), so the choice follows the query count. STRATA_ATTN_LANECELL=1/0 forces either way.
// against 55.9-56.3 tok/s), so the choice follows the query count. It is a Battlemage (Xe2) default only: on an Arc
// A750 (Alchemist) the same switch reads a 4,106-token prompt 0.7% slower (three interleaved runs, 4 of 5 pairs
// faster with it off), so the generation comes from the device's architecture id (strata::intel_gpu_gen: the
// runtime's architecture enum first, the name only as a fallback), never from the name alone.
// STRATA_ATTN_LANECELL=1/0 forces either way on any device.
static const int lane_cell_env = [] {
const char* v = std::getenv("STRATA_ATTN_LANECELL");
return v != nullptr && v[0] != '\0' ? std::atoi(v) : -1;
}();
const bool lane_cell = lane_cell_env >= 0 ? lane_cell_env != 0 : n_q >= 16;
const bool lane_cell = lane_cell_env >= 0
? lane_cell_env != 0
: (n_q >= 16 && strata::intel_gpu_gen(st->get_device()) == strata::IntelGpuGen::Battlemage);
#define STRATA_ATTN_LC(M) \
{ \
auto exp_props = sycl::ext::oneapi::experimental::properties{ \