Archived
libxe2, arch/common: the 28 Oct pending set, the bf16 cast fused, the vectorized norm, a draft-vocab prefix
- gdn_kkt_solve on DPAS (~0.4 ms at 2048 tokens against 7.7), the int8 head's DPAS forms at 9-16 rows (verify past depth 7), the plain block norm (RadBuildCtx::plain_norm, set on the SYCL backend: `add` + `rmsnorm` where no reader takes the E4M3 codes) with the fast rmsnorm rows. - rmsnorm's bf16 rows up to 8192 wide: a work-item eight elements by one 16-byte load (the generic form walked 20 dependent loads a work-item): 24.7 -> 3.3 us a decode norm, ~3.5 ms a round. - w4a16: a bf16 activation narrowed to fp16 at the kernel's own load (the separate cast launch before every GEMM is gone), bit for bit the same. - RADIANCE_MTP_DRAFT_VOCAB=N: the 2-bit draft head over the vocabulary's first N ids (a prefix shortlist, GRIMOIRE's idea); the u2 layout hook takes an op N below the weight's rows. 131072: greedy acceptance identical on the decode proxy, draft head 650 -> 351 us a pass. KL against the exact-kernel reference (2002 positions): 0.002386, top-1 97.30% (was 0.002376 / 96.80%). Decode proxy (greedy, depth 5, mtp4): 72.0 -> 74.3 tok/s with the prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7580ec3d17
commit
726e532114
18 files changed
+472
-54
No files matched your search
+10
-3
@@ -74,7 +74,9 @@ const RadKernelInfo kKernels[] = {
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::grid_embed },
|
||||
|
||||
{ .name = "xe2_rmsnorm", .op = "rmsnorm", .family = "norm",
|
||||
.computes = "RMS norm, one work-group a row, f32 work-group reduction",
|
||||
.computes = "RMS norm, a sub-group a row up to 512 wide, else a work-group, squares by a tree "
|
||||
"reduction (not libref's order: rmsnorm's tolerance). XE2_EXACT=1 runs libref's "
|
||||
"ordered sum",
|
||||
.shape = "any n; rows may be padded",
|
||||
.dtypes = "float x, gain and y (bf16 in the recipes), f32 arithmetic",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::rmsnorm },
|
||||
@@ -393,12 +395,17 @@ const RadKernelInfo kKernels[] = {
|
||||
.dtypes = "any float dtype; integer cu, slots and counts",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::gdn_conv_update },
|
||||
{ .name = "xe2_gdn_kkt_solve", .op = "gdn_kkt_solve", .family = "gdn",
|
||||
.computes = "(I + strict_lower(beta K K^T e^{g_i-g_j}))^-1 per chunk and v head, forward substitution; libref's arithmetic",
|
||||
.computes = "(I + strict_lower(beta K K^T e^{g_i-g_j}))^-1 per chunk and v head: K K^T on DPAS, the "
|
||||
"inverse by 16-row blocks in f32 (not libref's order: its tolerance) for head_k 128, "
|
||||
"bf16 k and A; else forward substitution, libref's arithmetic. XE2_EXACT=1 runs the "
|
||||
"exact kernel",
|
||||
.shape = "q, k, v as [T, heads, width]; conv width <= 17",
|
||||
.dtypes = "any float dtype; integer cu, slots and counts",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::gdn_kkt_solve },
|
||||
{ .name = "xe2_gdn_chunk_scan", .op = "gdn_chunk_scan", .family = "gdn",
|
||||
.computes = "the chunked delta-rule scan over a prefill chunk, state in and out; libref's arithmetic",
|
||||
.computes = "the chunked delta-rule scan over a prefill chunk, state in and out: on DPAS with bf16 "
|
||||
"operands for head_k = head_v = 128, chunk 64 and bf16/f32 operands (not libref's "
|
||||
"order: its tolerance); else libref's arithmetic. XE2_EXACT=1 runs the exact kernel",
|
||||
.shape = "q, k, v as [T, heads, width]; conv width <= 17",
|
||||
.dtypes = "any float dtype; integer cu, slots and counts",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::gdn_chunk_scan },
|
||||
|
||||
Reference in new issue
Block a user