Archived
libxe2: the verify GEMM's e_max in the prepass launch -- down 156 -> 142 us at M=8
The per-column largest exponent was a kernel of its own for split-K shapes (7.8 us a launch, 260 a round) and an in-kernel scan otherwise; extra work-groups of the activation prepass now form it and the ESIMD kernel gathers it. rad-kbench against libref 50/50; greedy output identical. 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
ef6c6e13fa
commit
36b8941096
2 files changed
+25
-27
No files matched your search
@@ -55,17 +55,8 @@ int launch(sycl::queue& q, const half* ae, const uint8_t* codes0, const uint8_t*
|
||||
const simd<uint32_t, 16> coff = (col - (uint32_t)n0) * (uint32_t)(K / 2);
|
||||
const simd<uint32_t, 16> eoff = col * (uint32_t)brs;
|
||||
const simd<uint32_t, 16> moff = col * (uint32_t)kg;
|
||||
/* the column's largest exponent: read here when this thread has the whole K, else the
|
||||
* caller's emax pass */
|
||||
simd<int32_t, 16> mx = 0;
|
||||
if (splits == 1) {
|
||||
for (int64_t g = 0; g < kg; g += 4) {
|
||||
const simd<uint32_t, 16> e = gather<uint32_t, 16>((const uint32_t*)(expe0 + g), eoff);
|
||||
_Pragma("unroll") for (int b = 0; b < 4; ++b) mx = max(mx, simd<int32_t, 16>((e >> (8 * b)) & 0xFF));
|
||||
}
|
||||
} else {
|
||||
mx = gather<int32_t, 16>(emax, col * 4u);
|
||||
}
|
||||
/* the column's largest exponent, from the caller's prepass */
|
||||
const simd<int32_t, 16> mx = gather<int32_t, 16>(emax, col * 4u);
|
||||
simd<float, 128> c[MT];
|
||||
_Pragma("unroll") for (int i = 0; i < MT; ++i) c[i] = 0.0f;
|
||||
for (int64_t g0 = g0s; g0 < g1s; g0 += kKs) {
|
||||
|
||||
Reference in new issue
Block a user