Archived
gemma3 + libr4d: the fused all-reduce junction on the lossy wire, for rows of whole 64-element groups
Under --tp-wire wht6 a TranslateGemma step of 2-3 sequences (16-24 rows) sent its junction as three launches (the standalone lossy all_reduce, rmsnorm, rmsnorm_quant_fp8): the fused ar_rmsnorm_post_quant_fp8 sent the exact wire only, and the compressed fused form needed a row of whole 512-element chunks, which Gemma 3 27B's 5376 is not (10.5). - r4d_fused_quant_fp8.hip: a row of whole 64-element groups that is not whole chunks ends in a partial chunk whose missing groups go out as zeros and are not stored back. Every real group is the same 64 elements as in the flat message, so its bytes and the sum are the standalone wire's. The (row, chunk) mapping is a template parameter (PAD, wire 6 only), so a row of whole chunks (Qwen3.8's 5120) runs exactly the code it ran before; as a runtime branch it cost a Qwen3.8 x4 step 1.3-1.6 %. POST (the sandwich post-norm) on either wire. - r4d_ar_entry.hip: K % 64 instead of K % 512 for wire 6, a size check of the padded message against the slot and the local pack, and the local pack's scale region a sixteenth of the slot instead of a thirty-second (padding adds up to 7 groups a row: a 2048-row prefill chunk would have overrun the old size). - gemma3: the junction declares its lossy twin (op_ar6) and takes it up to kAr6MaxRows (24); a taller step keeps the standalone all-reduce, which spread over more blocks wins there (the fused kernel gives a block one row). TranslateGemma-27B MXFP4 + DFlash2, 2x R9700, --tp-wire wht6 --draft-short-from 8, greedy, aggregate tok/s, two rounds, junction limit never / 24 / any: 2 streams (16 rows) 350.7 346.2 / 370.4 367.0 / 357.7 356.0 3 streams (24 rows) 455.8 451.2 / 462.8 460.6 / 437.3 436.8 4 streams (32 rows) 553.7 553.6 / 553.9 560.2 / 521.0 523.0 8 streams (32 rows) 717.4 718.0 / 716.7 720.8 / 662.4 661.9 So 2 streams +6 %, 3 +2 %, 4 and 8 unchanged. Bit identity: with --tp-wire-min-kb 1 (one stream's steps go out lossy) the fused path gives the unfused one's greedy top-5 logprobs, 300 of 300 tokens, max |d| 0, on two pieces (x1 there 197.6 -> 212.6 tok/s). Qwen3.8-27B MXFP4: 300 of 300 identical on two prompts, speed unchanged. Tests: arch_test (the lossy-wire junction test now also expects a 24-row step to fuse through the twin, other op instances than the 8-row step's, and the 64-row prefill to stay unfused). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9497bf9061
commit
812cdeceb0
6 files changed
+156
-45
No files matched your search
+2
-2
@@ -791,8 +791,8 @@ int r4d_gate_quant_fp8(long g, long x, long y, long q, long s, int M, int n, in
|
||||
// on the norm's load. IPC arguments are r4d_ar_oneshot_2rank_exact's; `nblocks` is clamped to M
|
||||
// because a block owns whole rows, and `x` takes no pitch because it is also the message. Like the
|
||||
// int8 twin r4d_ar_ln_had_quant_i8 it has two wires: `wire` 0 is the exact bf16 payload, 6 the
|
||||
// rotated 6-bit one. Wire 6 needs `n` to be a multiple of r4d_ar_rmsnorm_quant_fp8_chunk_elems()
|
||||
// so a chunk never straddles a row.
|
||||
// rotated 6-bit one. Wire 6 needs `n` to be a multiple of 64 (a group never straddles a row); a
|
||||
// row that is not whole r4d_ar_rmsnorm_quant_fp8_chunk_elems() chunks pads its last one with zeros.
|
||||
int r4d_ar_rmsnorm_quant_fp8(long peer_scratch, long my_scratch, long peer_flags, long my_flags,
|
||||
long seq_ctrs, long slot_stride16,
|
||||
long x, long res, long w, long y, long q, long s,
|
||||
|
||||
+14
-5
@@ -351,11 +351,13 @@ int build(ArInst* in, int rank, int world, long long max_numel, int dtype_code,
|
||||
sq = r4d_ar_ipc_alloc(kSeqWords(maxb) * 4, 0, handle, &hlen));
|
||||
|
||||
/* This rank's own packed copy, for the rotated 6-bit wire only: the reduce must fold exactly
|
||||
* the bytes it sent. The 6-bit payload is 3/8 of the bf16 message and the scales 1/64, so half
|
||||
* the message plus a thirty-second plus a page is ample. */
|
||||
* the bytes it sent. The 6-bit payload is 3/8 of the bf16 message and the f32 scales 1/32 of
|
||||
* it, laid out from half the slot; a row padded to whole 512-element chunks
|
||||
* (ar_rmsnorm_quant_fp8) adds up to 7 groups' scales a row, so the scales get a sixteenth
|
||||
* (enough for any row of 512 or more) plus a page. ar_rmsnorm_quant checks the fit. */
|
||||
if (in->dtype != 2) {
|
||||
R4D_TRY("ar_ipc_alloc(locpack)",
|
||||
lp = r4d_ar_ipc_alloc(in->slot_bytes / 2 + in->slot_bytes / 32 + 4096, 0,
|
||||
lp = r4d_ar_ipc_alloc(in->slot_bytes / 2 + in->slot_bytes / 16 + 4096, 0,
|
||||
handle, &hlen));
|
||||
}
|
||||
|
||||
@@ -1353,11 +1355,18 @@ static int rad_ar_rmsnorm_quant(const RadArgs* a, RadStream s, bool hi8) {
|
||||
if (wire != 0 && wire != 6) return RAD_E_INVAL;
|
||||
if (wire == 6) {
|
||||
const int ce = r4d_ar_rmsnorm_quant_fp8_chunk_elems();
|
||||
if (ce <= 0 || K % ce) return RAD_E_SHAPE;
|
||||
/* Whole 64-element groups a row; the last 512-element chunk may be partial (padded). */
|
||||
if (ce <= 0 || K % 64) return RAD_E_SHAPE;
|
||||
/* This rank's packed-half side buffer exists for every bf16 instance; missing means a
|
||||
* broken init. */
|
||||
if (!in->locpack) return RAD_E_STATE;
|
||||
if (wpo) return RAD_E_UNSUPPORTED; // the post-norm is the exact wire's only
|
||||
/* The padded message must fit: payload (3/4 byte an element) in the peer slot's half and
|
||||
* in locpack's, the bf16 scales in the slot's other half, the f32 ones in locpack after
|
||||
* half the slot (its allocation: a sixteenth of the slot plus a page). */
|
||||
const long long chunks = M * ((K + ce - 1) / ce), groups = chunks * (ce / 64);
|
||||
if (chunks * (ce * 6 / 8) > in->slot_bytes / 2 || groups * 2 > in->slot_bytes / 2 ||
|
||||
groups * 4 > in->slot_bytes / 16 + 4096)
|
||||
return RAD_E_SHAPE;
|
||||
}
|
||||
|
||||
R4dArCfg cfgv;
|
||||
|
||||
@@ -310,6 +310,10 @@ __global__ __launch_bounds__(1024) void gate_quant_fp8_kernel(
|
||||
// Rotation and amax close over a 64-element group, so the bytes are identical; the chunk size only
|
||||
// sets ownership. A chunk may not straddle a row (both ranks must agree on a block's bytes), and a
|
||||
// wave owns a whole chunk, so a smaller chunk employs more waves (see r4d_ar_ln_had_quant_i8.hip).
|
||||
// A row of whole 64-element groups that is not whole chunks (TranslateGemma's 5376 = 10.5 chunks)
|
||||
// ends in a partial chunk: its missing groups go out as zeros and are not stored back. Every real
|
||||
// group is the same 64 elements as in the flat message, so its bytes, and the sum, are the
|
||||
// standalone wire's; with whole chunks the mapping is the flat one.
|
||||
//
|
||||
// The reduced row goes back to global `x`, not LDS: unlike the int8 twin this norm needs no
|
||||
// in-place rotation, and pass two re-reads the row L1-hot as the standalone norm does.
|
||||
@@ -372,11 +376,16 @@ __device__ __forceinline__ unsigned int arq_load_acq(const unsigned int* p) {
|
||||
|
||||
// POST: a sandwich-norm junction (Gemma 3): the reduced sum is post-normed against `wp` before the
|
||||
// residual add, `v = bf16(sum * s1 * (wp + wadd))` with s1 the sum's own rms, as rmsnorm_quant_i8's
|
||||
// POST computes it. `x` still receives the reduced sum. Exact wire and a residual only.
|
||||
// POST computes it. `x` still receives the reduced sum. Either wire (the compressed one has already
|
||||
// stored the sum into `x`); a residual only.
|
||||
//
|
||||
// HI8: ar_rmsnorm_had_quant_i8g, pass two in norm_quant_row's rotated int8 form. The reduction and
|
||||
// the norm are untouched, so `x`, the residual and `y` are ar_rmsnorm_quant_fp8's bytes.
|
||||
template <bool WF32, bool RES, uint32_t THR, int WIRE, bool POST = false, bool HI8 = false>
|
||||
// PAD (wire 6 only): the row is whole 64-element groups but not whole chunks, so its last chunk is
|
||||
// padded and a chunk's elements are found by (row, chunk in row). Without it the flat index is the
|
||||
// element offset, the code a row of whole chunks has always run.
|
||||
template <bool WF32, bool RES, uint32_t THR, int WIRE, bool POST = false, bool HI8 = false,
|
||||
bool PAD = false>
|
||||
__global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
uint16_t* __restrict__ x, uint16_t* __restrict__ res, const void* __restrict__ w,
|
||||
const void* __restrict__ wp,
|
||||
@@ -393,7 +402,9 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
const int r0 = (int)(((long)b * M) / nb), r1 = (int)(((long)(b + 1) * M) / nb);
|
||||
/* Chunks per row and this block's window into the global chunk numbering, derived identically
|
||||
* on both ranks from (M, nb, n). */
|
||||
const int cpr = WIRE ? (int)(n / ARQ_CE) : 0;
|
||||
const int cpr = WIRE ? (int)(PAD ? (n + ARQ_CE - 1) / ARQ_CE : n / ARQ_CE) : 0;
|
||||
const int gpr = (int)(n / ARQ_GROUP); /* the real groups a row has; the rest of its last chunk pads */
|
||||
(void)gpr;
|
||||
const int c00 = r0 * cpr, cpb = (r1 - r0) * cpr;
|
||||
const uint32_t lane = tid & (ARQ_WV - 1), wave = tid / ARQ_WV;
|
||||
const int lig = (int)(lane & (ARQ_LPG - 1)), gw = (int)(lane / ARQ_LPG);
|
||||
@@ -430,8 +441,8 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
} else {
|
||||
/* Rotate, amax, quantise and pack straight into the peer's slot. A wave owns whole chunks,
|
||||
* so every lane emits ARQ_NWORD dwords per chunk and the flush is lane-uniform. No group is
|
||||
* partial (n is whole chunks, a block owns whole rows), so the standalone kernel's `live`
|
||||
* guard is unnecessary and every cross-lane stage is fully active. */
|
||||
* partial (n is whole groups, a block owns whole rows), so every cross-lane stage is fully
|
||||
* active; a group past the row's end (a partial last chunk) packs zeros. */
|
||||
for (int ci = (int)wave; ci < cpb; ci += (int)(THR / ARQ_WV)) {
|
||||
const int c = c00 + ci;
|
||||
unsigned int acc[ARQ_NWORD];
|
||||
@@ -440,10 +451,18 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
#pragma unroll
|
||||
for (int t = 0; t < ARQ_ITERS; ++t) {
|
||||
const int g = c * ARQ_CG + t * ARQ_GPW + gw;
|
||||
const long off = (long)g * ARQ_GROUP + (long)lig * ARQ_EPL;
|
||||
float v[ARQ_EPL];
|
||||
if constexpr (PAD) {
|
||||
const int cr = c / cpr, gr = (c - cr * cpr) * ARQ_CG + t * ARQ_GPW + gw;
|
||||
const bool live = gr < gpr;
|
||||
const long off = (long)cr * n + (long)gr * ARQ_GROUP + (long)lig * ARQ_EPL;
|
||||
#pragma unroll
|
||||
for (int i = 0; i < ARQ_EPL; ++i) v[i] = bf2f(x[off + i]);
|
||||
for (int i = 0; i < ARQ_EPL; ++i) v[i] = live ? bf2f(x[off + i]) : 0.0f;
|
||||
} else {
|
||||
const long off = (long)g * ARQ_GROUP + (long)lig * ARQ_EPL;
|
||||
#pragma unroll
|
||||
for (int i = 0; i < ARQ_EPL; ++i) v[i] = bf2f(x[off + i]);
|
||||
}
|
||||
arq_wht(v, lig);
|
||||
float a = 0.0f;
|
||||
#pragma unroll
|
||||
@@ -590,9 +609,18 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
+ (float)((int)(lsy & ARQ_MASK) + ARQ_QMIN) * lsc;
|
||||
}
|
||||
arq_wht(v, lig);
|
||||
const long off = (long)g * ARQ_GROUP + (long)lig * ARQ_EPL;
|
||||
if constexpr (PAD) {
|
||||
const int cr = c / cpr, gr = (c - cr * cpr) * ARQ_CG + gl;
|
||||
if (gr < gpr) {
|
||||
const long off = (long)cr * n + (long)gr * ARQ_GROUP + (long)lig * ARQ_EPL;
|
||||
#pragma unroll
|
||||
for (int i = 0; i < ARQ_EPL; ++i) x[off + i] = f2bf(v[i]);
|
||||
for (int i = 0; i < ARQ_EPL; ++i) x[off + i] = f2bf(v[i]);
|
||||
}
|
||||
} else {
|
||||
const long off = (long)g * ARQ_GROUP + (long)lig * ARQ_EPL;
|
||||
#pragma unroll
|
||||
for (int i = 0; i < ARQ_EPL; ++i) x[off + i] = f2bf(v[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Pass two reads all of `x`'s row; each wave wrote only its own chunks. */
|
||||
@@ -610,13 +638,14 @@ __global__ __launch_bounds__(THR) void ar_rmsnorm_quant_fp8_kernel(
|
||||
|
||||
(void)pr;
|
||||
float ss = 0.0f;
|
||||
if constexpr (POST && WIRE == 0 && RES) {
|
||||
if constexpr (POST && RES) {
|
||||
/* Pass one reduces and takes the sum's sum of squares; pass two post-norms it, adds it
|
||||
* into the stream and takes the stream's. Each thread reads back only its own columns. */
|
||||
float s1s = 0.0f;
|
||||
for (uint32_t i = tid; i < n; i += THR) {
|
||||
const uint16_t a = f2bf(bf2f(xr[i]) + bf2f(pr[i]));
|
||||
xr[i] = a;
|
||||
uint16_t a;
|
||||
if constexpr (WIRE == 0) { a = f2bf(bf2f(xr[i]) + bf2f(pr[i])); xr[i] = a; }
|
||||
else { a = xr[i]; }
|
||||
const float av = bf2f(a);
|
||||
s1s += av * av;
|
||||
}
|
||||
@@ -862,7 +891,7 @@ static int ar_rmsnorm_quant_launch(long peer_scratch, long my_scratch, long peer
|
||||
int nblocks, int nthreads, int drain, int acq, int wire,
|
||||
long loc_pack, long loc_scale_off, long wp, bool hi8) {
|
||||
if (!x || !w || !q || !s) return -1;
|
||||
if (wp && (!res || wire != 0)) return -10; // a post-norm needs the stream and the exact wire
|
||||
if (wp && !res) return -10; // a post-norm needs the stream
|
||||
if (hi8 && wp) return -11;
|
||||
if (hi8 && (n % (int)kGroup)) return -12;
|
||||
if (!peer_scratch || !my_scratch || !peer_flags || !my_flags || !seq_ctrs) return -1;
|
||||
@@ -871,8 +900,9 @@ static int ar_rmsnorm_quant_launch(long peer_scratch, long my_scratch, long peer
|
||||
// four columns (see norm_quant_row).
|
||||
if (n % 8) return -5;
|
||||
if (wire != 0 && wire != 6) return -7;
|
||||
// A chunk may not straddle a row, or the ranks would disagree about a block's bytes.
|
||||
if (wire == 6 && (n % ARQ_CE)) return -8;
|
||||
// A group may not straddle a row, or the ranks would disagree about a block's bytes; a row's
|
||||
// last chunk may be partial (its missing groups go out as zeros).
|
||||
if (wire == 6 && (n % ARQ_GROUP)) return -8;
|
||||
if (wire == 6 && (!loc_pack || loc_scale_off <= 0)) return -9;
|
||||
if (!r_ld) r_ld = n;
|
||||
if (!y_ld) y_ld = n;
|
||||
@@ -887,8 +917,9 @@ static int ar_rmsnorm_quant_launch(long peer_scratch, long my_scratch, long peer
|
||||
// The width must be r4d_act_threads', as for the standalone norm (it fixes the summation order).
|
||||
const int thr = nthreads ? nthreads : r4d_act_threads(M, n);
|
||||
if (thr != 256 && thr != 512 && thr != 1024) return -6;
|
||||
#define R4D_ARQ_H(wf, rs, T, W, PO, H) \
|
||||
hipLaunchKernelGGL((ar_rmsnorm_quant_fp8_kernel<wf, rs, T, W, PO, H>), dim3((uint32_t)nb), \
|
||||
const bool pad = wire == 6 && (n % ARQ_CE) != 0;
|
||||
#define R4D_ARQ_HP(wf, rs, T, W, PO, H, PD) \
|
||||
hipLaunchKernelGGL((ar_rmsnorm_quant_fp8_kernel<wf, rs, T, W, PO, H, PD>), dim3((uint32_t)nb), \
|
||||
dim3(T), 0, \
|
||||
(hipStream_t)stream, (uint16_t*)x, (uint16_t*)res, (const void*)w, \
|
||||
(const void*)wp, \
|
||||
@@ -898,12 +929,16 @@ static int ar_rmsnorm_quant_launch(long peer_scratch, long my_scratch, long peer
|
||||
(long)loc_scale_off, M, (uint32_t)n, \
|
||||
(uint32_t)nkb, eps, wadd, (uint32_t)r_ld, (uint32_t)y_ld, (uint32_t)q_ld, \
|
||||
(uint32_t)s_ld, (int)slot_stride16, drain, acq, (unsigned)nbw)
|
||||
#define R4D_ARQ_H(wf, rs, T, W, PO, H) \
|
||||
do { if (pad) R4D_ARQ_HP(wf, rs, T, W, PO, H, (W == 6)); \
|
||||
else R4D_ARQ_HP(wf, rs, T, W, PO, H, false); } while (0)
|
||||
#define R4D_ARQ_P(wf, rs, T, W, PO) R4D_ARQ_H(wf, rs, T, W, PO, false)
|
||||
#define R4D_ARQ_T(wf, rs, T, W) \
|
||||
do { if (hi8) R4D_ARQ_H(wf, rs, T, W, false, true); \
|
||||
else R4D_ARQ_P(wf, rs, T, W, false); } while (0)
|
||||
#define R4D_ARQ_W(wf, rs, T) \
|
||||
do { if (wire == 6) R4D_ARQ_T(wf, rs, T, 6); \
|
||||
do { if (wire == 6 && rs && wp) R4D_ARQ_P(wf, rs, T, 6, true); \
|
||||
else if (wire == 6) R4D_ARQ_T(wf, rs, T, 6); \
|
||||
else if (rs && wp) R4D_ARQ_P(wf, rs, T, 0, true); \
|
||||
else R4D_ARQ_T(wf, rs, T, 0); } while (0)
|
||||
#define R4D_ARQ(wf, rs) \
|
||||
@@ -917,6 +952,7 @@ static int ar_rmsnorm_quant_launch(long peer_scratch, long my_scratch, long peer
|
||||
#undef R4D_ARQ_T
|
||||
#undef R4D_ARQ_P
|
||||
#undef R4D_ARQ_H
|
||||
#undef R4D_ARQ_HP
|
||||
return hipGetLastError() == hipSuccess ? 0 : -4;
|
||||
}
|
||||
|
||||
|
||||
+7
-6
@@ -1448,7 +1448,7 @@ static const RadOperandSpec oArRmsNormQuantFp8[] = {
|
||||
};
|
||||
|
||||
/* ar_rmsnorm_post_quant_fp8: the same with a sandwich post-norm of the reduced sum before the add
|
||||
* (Gemma 3's junction, arch/gemma3), exact wire only. Its own op: an optional seventh operand on
|
||||
* (Gemma 3's junction, arch/gemma3), on either wire. Its own op: an optional seventh operand on
|
||||
* ar_rmsnorm_quant_fp8 would break every plugin that issues that op's six. */
|
||||
static const RadOperandSpec oArRmsNormPostQuantFp8[] = {
|
||||
{ "x", RAD_OPD_INOUT, 0 },
|
||||
@@ -3529,7 +3529,7 @@ static const RadOpSchema kSchemas[] = {
|
||||
|
||||
SCHEMA("ar_rmsnorm_post_quant_fp8", pArRmsNormQuantFp8, oArRmsNormPostQuantFp8,
|
||||
"ar_rmsnorm_quant_fp8 with a post-norm of the reduced sum against w_post before the "
|
||||
"residual add (a sandwich-norm junction), exact wire only, byte-identical to all_reduce, "
|
||||
"residual add (a sandwich-norm junction), either wire, byte-identical to all_reduce, "
|
||||
"rmsnorm, rmsnorm_quant_fp8."),
|
||||
SCHEMA("ar_rmsnorm_quant_fp8", pArRmsNormQuantFp8, oArRmsNormQuantFp8,
|
||||
"the two-rank all-reduce and the residual add, RMS norm and block-scaled fp8 "
|
||||
@@ -8756,7 +8756,7 @@ R4D_WIN_PAIR(512, 1) R4D_WIN_PAIR(512, 2) R4D_WIN_PAIR(512, 4) R4D_WIN_PAIR(512,
|
||||
"exactly 2 ranks; n a multiple of 8 and x unpitched, because x is the message and a block pushes "
|
||||
"its rows as 16B words; group 128; a block owns whole ROWS, so the block count is clamped to M; "
|
||||
"either wire, chosen by `wire` -- the rotated 6-bit payload additionally needs n to be a "
|
||||
"multiple of 512, so that a chunk never straddles a row; residual and out_bf16 may be null",
|
||||
"multiple of 64, so that a group never straddles a row (a row's last 512-element chunk may be partial); residual and out_bf16 may be null",
|
||||
"bf16 in, E4M3 out with an f32 scale per (row, 128 columns) and an optional bf16 out; codes "
|
||||
"taken over the BF16-ROUNDED norm output, and the reduced sum rounded to bf16 exactly as the "
|
||||
"standalone all-reduce of the SAME wire stores it -- byte-identical to the pair it replaces",
|
||||
@@ -8773,7 +8773,7 @@ R4D_WIN_PAIR(512, 1) R4D_WIN_PAIR(512, 2) R4D_WIN_PAIR(512, 4) R4D_WIN_PAIR(512,
|
||||
"back",
|
||||
"exactly 2 ranks; n a multiple of 128 (a rotation block cannot straddle a row) and x unpitched; "
|
||||
"group 128; a block owns whole ROWS, so the block count is clamped to M; either wire, chosen by "
|
||||
"`wire` -- the rotated 6-bit payload additionally needs n to be a multiple of 512; residual and "
|
||||
"`wire` -- the rotated 6-bit payload pads a row's partial last 512-element chunk; residual and "
|
||||
"out_bf16 may be null",
|
||||
"bf16 in, int8 out with an f32 scale per (row, 128 columns) and an optional bf16 out of the "
|
||||
"UNROTATED norm output; x and the residual are ar_rmsnorm_quant_fp8's bytes, and the codes "
|
||||
@@ -8786,8 +8786,9 @@ R4D_WIN_PAIR(512, 1) R4D_WIN_PAIR(512, 2) R4D_WIN_PAIR(512, 4) R4D_WIN_PAIR(512,
|
||||
{ "ar_rmsnorm_post_quant_fp8", "ar_rmsnorm_post_quant_fp8", "quant",
|
||||
"the two-rank all-reduce, a post-norm of the reduced sum, the residual add, RMS norm and "
|
||||
"block-scaled fp8 quantisation in one kernel: a sandwich-norm junction (Gemma 3)",
|
||||
"exactly 2 ranks, the exact wire; n a multiple of 8 and x unpitched; group 128; a block owns whole "
|
||||
"rows; the residual is required",
|
||||
"exactly 2 ranks, either wire chosen by `wire` (the rotated 6-bit payload needs n a multiple of 64; "
|
||||
"a row's last 512-element chunk may be partial); n a multiple of 8 and x unpitched; group 128; a "
|
||||
"block owns whole rows; the residual is required",
|
||||
"bf16 in, E4M3 out with an f32 scale per (row, 128 columns); x receives the reduced sum",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ONLY,
|
||||
ROW(cArRmsNormQuantFp8), ROW(tAr), nullptr,
|
||||
|
||||
Reference in new issue
Block a user