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:
aneinanderandClaude Opus 5.5 committed 2026-11-08 14:15:31 +01:00
1 parent e1e21935cc
commit ff4b7c9fb4
4 files changed
+147 -3

No files matched your search

+2 -2
View File
@@ -24,7 +24,7 @@ namespace xe2 {
namespace {
constexpr int kMaxHalf = 128; /* head_dim up to 256 */
constexpr int kMaxHalf = 256; /* head_dim up to 512 (Gemma 4's global heads, proportional rope) */
/* libref's row_stride: fold trailing axes until they span `cols`; the next axis out carries the
* row. */
@@ -47,7 +47,7 @@ enum { kNeox = 0, kGptj = 1, kMrope = 2, kImrope = 3, kAxial = 4 };
struct Freqs {
float inv[kMaxHalf];
int comp[kMaxHalf];
int8_t comp[kMaxHalf]; /* a component index, < 8: int8 keeps the by-value table at 1.25 KB */
};
/* "11 11 10" -> {11, 11, 10}; absent is none, -1 a non-positive entry (libref's rope_sections). */