Archived
libxe2: rmsnorm_p, relu, logit_softcap, rel_sinusoid, pool_rows rows; rope to head_dim 512
Gemma 4 E2B did not start on Intel: five weightless ops had no device row (rmsnorm_p, the bare value norm, in 15 bands; relu; logit_softcap; rel_sinusoid; pool_rows), and xe2_rope was selected for its global layers (head_dim 512, proportional rope widened to the full head) and refused them at launch: the frequency table held head_dim <= 256. It now holds 512, its component index as int8 so the by-value table stays at 1.25 KB. rmsnorm_p is xe2_rmsnorm with the gain absent; the others are libref's chains (tanh, exp, sin, cos in double rounded once; pool_rows' f32 sum in row order, rounded, times mult, rounded). rad-kbench on the Gemma 4 E2B container: rmsnorm_p 20, relu 20, logit_softcap 4, rel_sinusoid 5, pool_rows 6 cases ok, rope 300/300; default fixture rope 162/162. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1e21935cc
commit
ff4b7c9fb4
4 files changed
+147
-3
No files matched your search
+21
-1
@@ -100,6 +100,26 @@ const RadKernelInfo kKernels[] = {
|
||||
.computes = "y = gelu_tanh(gate_up[i]) * gate_up[n + i], the gate first, tanh in double",
|
||||
.shape = "rows of 2n in, n out", .dtypes = "any float dtype",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::gelu_mul },
|
||||
{ .name = "xe2_rmsnorm_p", .op = "rmsnorm_p", .family = "elem",
|
||||
.computes = "rmsnorm with no gain: xe2_rmsnorm with its gain operand absent",
|
||||
.shape = "as xe2_rmsnorm", .dtypes = "as xe2_rmsnorm",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::rmsnorm_p },
|
||||
{ .name = "xe2_relu", .op = "relu", .family = "elem",
|
||||
.computes = "y = max(x, 0)",
|
||||
.shape = "rows of n, uniform row pitch", .dtypes = "any float dtype",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::relu },
|
||||
{ .name = "xe2_logit_softcap", .op = "logit_softcap", .family = "elem",
|
||||
.computes = "y = cap tanh(x / cap), tanh in double rounded once",
|
||||
.shape = "any element count; any strides", .dtypes = "any float dtype",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::logit_softcap },
|
||||
{ .name = "xe2_rel_sinusoid", .op = "rel_sinusoid", .family = "elem",
|
||||
.computes = "row d: sin then cos of d inv[i], exp, sin and cos in double rounded once, as libref's",
|
||||
.shape = "rows of n, n even", .dtypes = "any float y",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::rel_sinusoid },
|
||||
{ .name = "xe2_pool_rows", .op = "pool_rows", .family = "elem",
|
||||
.computes = "the mean of k consecutive rows, f32 in order, rounded, times mult, rounded",
|
||||
.shape = "rows of n, M a multiple of k", .dtypes = "any float dtype",
|
||||
.domain = RAD_DOMAIN_DEVICE, .launch = xe2::pool_rows },
|
||||
{ .name = "xe2_scatter_rows", .op = "scatter_rows", .family = "gather",
|
||||
.computes = "row m of v to row idx[m] of x; a negative index skipped, one past x refused",
|
||||
.shape = "any n and row counts; rows may be padded, the last axis dense",
|
||||
@@ -167,7 +187,7 @@ const RadKernelInfo kKernels[] = {
|
||||
{ .name = "xe2_rope", .op = "rope", .family = "rope",
|
||||
.computes = "rotary embedding in place over q and k heads; frequency ladder (YaRN, llama3) "
|
||||
"on the host as libref builds it, cos/sin in double",
|
||||
.shape = "neox, gptj, mrope, imrope, axial; [M] or [C, M] positions, rotary_dim <= 256",
|
||||
.shape = "neox, gptj, mrope, imrope, axial; [M] or [C, M] positions, rotary_dim <= 512",
|
||||
.dtypes = "bf16 qkv (any float), integer or float positions",
|
||||
.domain = RAD_DOMAIN_DEVICE, .constraints = cRopeModes, .n_constraints = 1,
|
||||
.launch = xe2::rope },
|
||||
|
||||
Reference in new issue
Block a user