sycl: the ESIMD dense GEMM on by default on Battlemage builds (STRATA_DENSE_GEMM_ESIMD=0 turns it off); 16 x 32 tile

Standalone bench, Arc Pro B70, bf16 in / fp32 out, 4096 tokens: the ESIMD kernel (2D block loads straight from global memory, the weights
as transposed 32-bit words = the VNNI-packed B operand, no SLM, no barriers) reaches 64-72 TFLOP/s on the GDN / QSA projection and
square shapes (2.4 ms for N=8192 K=2560, 71 TFLOP/s) against 29-31 for the packed-B SLM kernel and 22-25 with large-GRF mode; max
relative error against a double reference below 1e-5 on every shape. The tile is 16 rows x 32 columns per hardware thread (a 32 x 32 tile
is slower: register pressure); the prefetch two K steps ahead is kept. Shapes it does not take (N < 16, T < 32, K % 16 != 0, bases not
64-byte aligned, ldy % 4 != 0) fall back to the packed-B kernel. The register entry for STRATA_DENSE_GEMM_ESIMD moves to rollback.
This commit is contained in:
Niko1221 committed 2026-12-03 02:12:12 +01:00
1 parent aa7379dac8
commit 1109ad7b3e
3 files changed
+9 -9

No files matched your search

+3 -3
View File
@@ -10,7 +10,7 @@ debugging and are kept in `terminal/data/settings-register.json`.
A number or a word is set like any environment variable, for example `STRATA_KVA=1`. In the Terminal, `strata launch --set NAME=value`
puts it in the model's run configuration.
## Switches you can turn on (457)
## Switches you can turn on (456)
Off unless you set them. The last column says where each one is described.
@@ -51,7 +51,6 @@ Off unless you set them. The last column says where each one is described.
| `STRATA_CUDA_PEER_PINNED` | number | NVIDIA and AMD | - |
| `STRATA_DBG_GDN` | on / off | NVIDIA and AMD | [BATCHING.md](BATCHING.md) |
| `STRATA_DENSE_F32` | number | NVIDIA | [COMMUNITY_BENCHMARKS.md](COMMUNITY_BENCHMARKS.md), [OLDER_GPUS.md](OLDER_GPUS.md), [README.md](bench-results/2026-10-12-p40-sm61-kernels/README.md) |
| `STRATA_DENSE_GEMM_ESIMD` | on / off | Intel Arc | - |
| `STRATA_DENSE_I8_TC` | number | NVIDIA and AMD | - |
| `STRATA_DENSE_MMQ` | on / off | NVIDIA and AMD, Intel Arc | [AMD_HIP.md](AMD_HIP.md), [DETAILS.md](DETAILS.md), [prefill-ab.md](bench-results/2026-10-05-community-gfx1151/prefill-ab.md) |
| `STRATA_DENSE_XMX` | on / off | Intel Arc | - |
@@ -474,7 +473,7 @@ Off unless you set them. The last column says where each one is described.
| `STRATA_WATCHDOG_S` | text | NVIDIA and AMD, Intel Arc | [DETAILS.md](DETAILS.md) |
| `STRATA_WDDM_BUDGET` | number | AMD, Intel Arc | [AMD_HIP.md](AMD_HIP.md) |
## Switches that go back to earlier behaviour (143)
## Switches that go back to earlier behaviour (144)
These behaviours are on by default. Setting the switch returns the earlier behaviour; the notes in the register say which
version made it the default.
@@ -488,6 +487,7 @@ version made it the default.
| `STRATA_BATCH_MTP_SERIAL` | on / off | NVIDIA and AMD | v0.2.16 | [BATCHING.md](BATCHING.md) |
| `STRATA_CONVERT_THREADS` | number | NVIDIA and AMD | v0.2.17 | - |
| `STRATA_DEFAULTS` | on / off | NVIDIA and AMD | v0.2.16 | [AMD_HIP.md](AMD_HIP.md), [BATCHING.md](BATCHING.md), [DETAILS.md](DETAILS.md) |
| `STRATA_DENSE_GEMM_ESIMD` | on / off | Intel Arc | - | - |
| `STRATA_DENSE_GEMM_PK` | on / off | Intel Arc | - | - |
| `STRATA_DEQUANT_WIDE` | number | NVIDIA and AMD | v0.2.16 | [DETAILS.md](DETAILS.md), [OLDER_GPUS.md](OLDER_GPUS.md), [release-notes-0.2.7.md](release-notes-0.2.7.md) |
| `STRATA_DF2_ATTN_TC` | on / off | NVIDIA and AMD | v0.2.19 | - |
@@ -254,7 +254,7 @@ class k_pk_f16; class k_pk_bf16;
// the VNNI-2 packed B operand (a dword = two consecutive K of one column), so there is no repacking at all. Out-of-range rows and columns
// read as zero and out-of-range stores are dropped by the block unit. K % 16 == 0, 64-byte aligned bases, pitches multiple of 16 bytes.
#ifndef STRATA_ES_MT
#define STRATA_ES_MT 4
#define STRATA_ES_MT 2
#endif
#ifndef STRATA_ES_NT
#define STRATA_ES_NT 2
@@ -392,8 +392,8 @@ bool gemm_tn(sycl::queue& q, Elem e, const uint16_t* W, int64_t lda, const uint1
const bool xmx_ok = false;
#endif
#ifdef STRATA_XMX_SG16
// opt-in until it has run in the engine (bench numbers pending): STRATA_DENSE_GEMM_ESIMD=1
static const bool es_on = [] { const char* v = std::getenv("STRATA_DENSE_GEMM_ESIMD"); return v && v[0] == '1'; }();
// the ESIMD kernel (about 70 TFLOP/s against 31 for the SLM one in the standalone bench); STRATA_DENSE_GEMM_ESIMD=0 turns it off
static const bool es_on = [] { const char* v = std::getenv("STRATA_DENSE_GEMM_ESIMD"); return !(v && v[0] == '0'); }();
if (xmx_ok && es_on && T >= 32 && K % 16 == 0 && ldy % 4 == 0 && (reinterpret_cast<uintptr_t>(W) & 63u) == 0 &&
(reinterpret_cast<uintptr_t>(X) & 63u) == 0 && (reinterpret_cast<uintptr_t>(Y) & 63u) == 0 && N >= 16) {
if (e == Elem::f16) launch_esimd<false, k_es_f16>(q, W, (int) lda, X, (int) ldx, Y, (int) ldy, (int) N, (int) T, (int) K, alpha, beta);
+3 -3
View File
@@ -5523,7 +5523,7 @@
}
],
"parse": "flag",
"default_state": "off",
"default_state": "on",
"code_default": null,
"engine_sets": [],
"engine_defaults": [],
@@ -5536,9 +5536,9 @@
"since": null,
"last_commit": "486402e1b2",
"last_date": "2026-12-03",
"status": "opt-in",
"status": "rollback",
"owner": "sycl/prefill",
"note": "[reviewed] Battlemage (SG16) builds: =1 takes the ESIMD dense GEMM (2D block loads, no SLM); off until it has run in the engine. [engine/sycl/src/prefill/xmx_dense_gemm.dp.cpp]",
"note": "[reviewed] Battlemage (SG16) builds: on by default (ESIMD dense GEMM, 2D block loads, no SLM, ~70 TFLOP/s on the B70); =0 takes the packed-B SLM kernel (same bits). [engine/sycl/src/prefill/xmx_dense_gemm.dp.cpp]",
"retire_after": "",
"retired_in": ""
},