Archived
libxe2: attention value rows 16 bytes at a time at head_dim 256 -- 2.72 -> 0.88 s a 27B prefill
The lane-per-key attention read bf16 value rows with 16-byte loads only at head_dim 128; at 256
(Qwen3.8's full attention, 16 dims a lane) every element went through the generic loader. Two
16-byte loads a lane now. rad-kbench 138/138 on the fixture and 33/33 on the 27B (worst rel_l2
1.5e-4). SYCL_PROGRESS records the first 27B BetterBench run (5720a95): decode median 19.1 tok/s,
prefill 113.4 tok/s at 2000.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
This commit is contained in:
1 parent
68db6023fd
commit
f49aee84f0
2 files changed
+10
No files matched your search
@@ -215,6 +215,13 @@ int attn_paged_fast(const RadArgs* a, RadStream st) {
|
||||
const sycl::vec<uint16_t, 8> vv = *(const sycl::vec<uint16_t, 8>*)(
|
||||
(const uint16_t*)cb + kbj + head_dim + lane * 8);
|
||||
for (int e = 0; e < 8; ++e) acc[e] += wj * (rad_bf16_to_f32(vv[e]) * vds);
|
||||
} else if (vec_kv && per == 16) {
|
||||
/* head_dim 256 (Qwen3.8's full attention): two 16-byte loads a lane */
|
||||
const uint16_t* vr = (const uint16_t*)cb + kbj + head_dim + lane * 16;
|
||||
const sycl::vec<uint16_t, 8> v0 = *(const sycl::vec<uint16_t, 8>*)vr;
|
||||
const sycl::vec<uint16_t, 8> v1 = *(const sycl::vec<uint16_t, 8>*)(vr + 8);
|
||||
for (int e = 0; e < 8; ++e) acc[e] += wj * (rad_bf16_to_f32(v0[e]) * vds);
|
||||
for (int e = 0; e < 8; ++e) acc[8 + e] += wj * (rad_bf16_to_f32(v1[e]) * vds);
|
||||
} else {
|
||||
for (int e = 0; e < per; ++e)
|
||||
acc[e] += wj * (rad_load_f32(cb, cdt, kbj + (head_dim + lane * per + e) * sd) * vds);
|
||||
|
||||
Reference in new issue
Block a user