Skip to content

Commit bb4b417

Browse files
committed
inkling2 metal: exact 2-product NVFP4 decode, load validator, and GPU parity proofs
1 parent a9df5b8 commit bb4b417

12 files changed

Lines changed: 619 additions & 102 deletions

‎zig/kernels/metal/inkling2/experts.metal‎

Lines changed: 84 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,45 @@ inline uint ink2_word(device const uchar* p) {
104104
return as_type<uint>(uchar4(*(device const packed_uchar4*)p));
105105
}
106106

107-
// E2M1 times two is 0, 1, 2, 3, 4, 6, 8 or 12: one nibble of this word a code.
108-
inline float ink2_e2m1_twice(uint code) {
109-
const float v = float((0xC8643210u >> (4u * (code & 7u))) & 15u);
110-
return (code & 8u) ? -v : v;
107+
constant float ink2_e2m1_twice_lut[16] = {0, 1, 2, 3, 4, 6, 8, 12, -0.f, -1, -2, -3, -4, -6, -8, -12};
108+
109+
// Exact 2-product guard: safe normal exponent [2^-116, 2^118) and no 3-multiple BF16 tie rounding diff.
110+
inline bool ink2_nv_two_prod_safe(float phi) {
111+
if (phi == 0.0f) return true;
112+
const float ap = fabs(phi);
113+
if (!(ap >= 0x1.0p-116f && ap < 0x1.0p118f)) return false;
114+
const float np = as_type<float>((as_type<uint>(phi) & 0x7fffffu) | 0x3f800000u);
115+
const float hp = 0.5f * np;
116+
for (uint m = 1u; m < 8u; ++m)
117+
if (bfloat(3.0f * ((1.0f + float(m) * 0.125f) * hp)) != bfloat((1.5f + float(m) * 0.1875f) * np)) return false;
118+
return true;
111119
}
112120

113-
// One simdgroup a dot: lane l sums blocks l, l + 32, ... in column order, then the 32 lanes are summed.
114-
inline float ink2_dot_nv(device const uchar* w, device const uchar* scales,
115-
device const bfloat* x, float phi, uint k, uint lane) {
121+
inline float ink2_e2m1_twice(uint code) { return ink2_e2m1_twice_lut[code & 15u]; }
122+
123+
template <bool TWO_PROD>
124+
inline float ink2_dot_nv_impl(device const uchar* w, device const uchar* scales,
125+
device const bfloat* x, float arg, uint k, uint lane) {
116126
float sum = 0.0f;
117127
for (uint b = lane; b < k / 16u; b += 32u) {
118-
// ink2_nv_weight's inner product, exact in fp32 either way: (2 * e2m1) * (e4m3 / 2).
119-
const float half_scale = 0.5f * ink2_e4m3(scales[b]);
128+
const float bs = TWO_PROD ? (ink2_e4m3(scales[b]) * arg) : (0.5f * ink2_e4m3(scales[b]));
120129
const uint lo = ink2_word(w + 8u * b), hi = ink2_word(w + 8u * b + 4u);
121130
for (uint j = 0; j < 16u; ++j) {
122131
const uint code = ((j < 8u ? lo : hi) >> (4u * (j & 7u))) & 15u;
123-
const float weight = float(bfloat(ink2_e2m1_twice(code) * half_scale * phi));
124-
sum += weight * float(x[16u * b + j]);
132+
const float prod = TWO_PROD ? (ink2_e2m1_twice_lut[code] * bs) : (ink2_e2m1_twice_lut[code] * bs * arg);
133+
sum += float(bfloat(prod)) * float(x[16u * b + j]);
125134
}
126135
}
127136
return simd_sum(sum);
128137
}
129138

139+
// One simdgroup a dot: lane l sums blocks l, l + 32, ... in column order, then the 32 lanes are summed.
140+
inline float ink2_dot_nv(device const uchar* w, device const uchar* scales,
141+
device const bfloat* x, float phi, uint k, uint lane) {
142+
return ink2_nv_two_prod_safe(phi) ? ink2_dot_nv_impl<true>(w, scales, x, 0.5f * phi, k, lane)
143+
: ink2_dot_nv_impl<false>(w, scales, x, phi, k, lane);
144+
}
145+
130146
// As ink2_dot_nv over 32-column MXFP8 blocks.
131147
inline float ink2_dot_mx(device const uchar* w, device const uchar* scales,
132148
device const bfloat* x, uint k, uint lane) {
@@ -319,13 +335,14 @@ inline uint ink2_simd_match(uint raw, bool valid, uint nbits) {
319335
}
320336
}
321337

322-
// Block b of a packed NVFP4 row as its 16 BF16 weights, each as ink2_dot_nv decodes it.
323-
inline void ink2_nv_block(device const uchar* w, device const uchar* scales, float phi, uint b, thread float* out) {
324-
const float half_scale = 0.5f * ink2_e4m3(scales[b]);
338+
// Block b of a packed NVFP4 row as its 16 BF16 weights, matching ink2_dot_nv.
339+
template <bool TWO_PROD = false>
340+
inline void ink2_nv_block(device const uchar* w, device const uchar* scales, float arg, uint b, thread float* out) {
341+
const float bs = TWO_PROD ? (ink2_e4m3(scales[b]) * arg) : (0.5f * ink2_e4m3(scales[b]));
325342
const uint lo = ink2_word(w + 8u * b), hi = ink2_word(w + 8u * b + 4u);
326343
for (uint j = 0; j < 16u; ++j) {
327344
const uint code = ((j < 8u ? lo : hi) >> (4u * (j & 7u))) & 15u;
328-
out[j] = float(bfloat(ink2_e2m1_twice(code) * half_scale * phi));
345+
out[j] = float(bfloat(TWO_PROD ? (ink2_e2m1_twice_lut[code] * bs) : (ink2_e2m1_twice_lut[code] * bs * arg)));
329346
}
330347
}
331348

@@ -340,54 +357,77 @@ inline void ink2_mx_block(device const uchar* w, device const uchar* scales, uin
340357
}
341358
}
342359

343-
// Threadgroup (x, e): outputs 8x to 8x + 7 of expert e for each of its route pairs, four pairs a pass.
344-
[[kernel, max_total_threads_per_threadgroup(256)]] void tf_ink2_nvfp4_gu_grouped(
345-
device const bfloat* X [[buffer(0)]], device const uchar* W [[buffer(1)]],
346-
device const uchar* S [[buffer(2)]], device const float* amax [[buffer(3)]],
347-
device const float* denominator [[buffer(4)]], device const uint* counts [[buffer(5)]],
348-
device const uint* members [[buffer(6)]], device bfloat* Y [[buffer(7)]],
349-
constant Ink2GroupedArgs& a [[buffer(8)]],
350-
uint2 tg [[threadgroup_position_in_grid]], uint sg [[simdgroup_index_in_threadgroup]],
351-
uint lane [[thread_index_in_simdgroup]]) {
352-
const uint n = tg.x * 8u + sg, expert = tg.y;
353-
if (n >= a.n) return;
354-
const uint count = counts[expert];
355-
if (count == 0u) return;
356-
const ulong expert_w = ulong(expert) * 2u * a.n * (a.k / 2u);
357-
const ulong expert_s = ulong(expert) * 2u * a.n * (a.k / 16u);
358-
const float phi = precise::divide(float(bfloat(amax[expert])), float(bfloat(denominator[0])));
359-
device const uchar* gate_w = W + expert_w + ulong(2u * n) * (a.k / 2u);
360-
device const uchar* gate_s = S + expert_s + ulong(2u * n) * (a.k / 16u);
361-
device const uchar* up_w = gate_w + (a.k / 2u);
362-
device const uchar* up_s = gate_s + (a.k / 16u);
360+
template <bool GU, bool TWO_PROD>
361+
inline void ink2_nv_grouped_pass(device const bfloat* X, device const uchar* row_w, device const uchar* row_s,
362+
device const uint* members, device bfloat* Y, constant Ink2GroupedArgs& a,
363+
uint n, uint expert, uint count, float arg, uint lane) {
363364
for (uint first = 0u; first < count; first += INK2_PASS) {
364365
uint pair[INK2_PASS];
365366
device const bfloat* x[INK2_PASS];
366367
float g[INK2_PASS], u[INK2_PASS];
367368
for (uint j = 0u; j < INK2_PASS; ++j) {
368369
pair[j] = members[expert * a.cap + min(first + j, count - 1u)];
369-
x[j] = X + ulong(pair[j] / a.topk) * a.k;
370-
g[j] = 0.0f;
371-
u[j] = 0.0f;
370+
x[j] = X + ulong(GU ? pair[j] / a.topk : pair[j]) * a.k;
371+
g[j] = u[j] = 0.0f;
372372
}
373373
for (uint b = lane; b < a.k / 16u; b += 32u) {
374374
float gate[16], up[16];
375-
ink2_nv_block(gate_w, gate_s, phi, b, gate);
376-
ink2_nv_block(up_w, up_s, phi, b, up);
375+
ink2_nv_block<TWO_PROD>(row_w, row_s, arg, b, gate);
376+
if (GU) ink2_nv_block<TWO_PROD>(row_w + a.k / 2u, row_s + a.k / 16u, arg, b, up);
377377
for (uint j = 0u; j < INK2_PASS; ++j)
378378
for (uint i = 0u; i < 16u; ++i) {
379379
const float v = float(x[j][16u * b + i]);
380380
g[j] += gate[i] * v;
381-
u[j] += up[i] * v;
381+
if (GU) u[j] += up[i] * v;
382382
}
383383
}
384384
for (uint j = 0u; j < INK2_PASS; ++j) {
385-
const float gs = simd_sum(g[j]), us = simd_sum(u[j]);
386-
if (lane == 0u && first + j < count) Y[ulong(pair[j]) * a.n + n] = ink2_act(gs, us);
385+
const float gs = simd_sum(g[j]), us = GU ? simd_sum(u[j]) : 0.0f;
386+
if (lane == 0u && first + j < count) Y[ulong(pair[j]) * a.n + n] = GU ? ink2_act(gs, us) : bfloat(gs);
387387
}
388388
}
389389
}
390390

391+
template <bool GU>
392+
__attribute__((noinline)) void ink2_nv_grouped_exact(
393+
device const bfloat* X, device const uchar* row_w, device const uchar* row_s,
394+
device const uint* members, device bfloat* Y, constant Ink2GroupedArgs& a,
395+
uint n, uint expert, uint count, float phi, uint lane) {
396+
ink2_nv_grouped_pass<GU, false>(X, row_w, row_s, members, Y, a, n, expert, count, phi, lane);
397+
}
398+
399+
template <bool GU>
400+
inline void ink2_nv_grouped(device const bfloat* X, device const uchar* W, device const uchar* S,
401+
device const float* amax, device const float* denominator,
402+
device const uint* counts, device const uint* members,
403+
device bfloat* Y, constant Ink2GroupedArgs& a, uint2 tg, uint sg, uint lane) {
404+
const uint n = tg.x * 8u + sg, expert = tg.y;
405+
if (n >= a.n) return;
406+
const uint count = counts[expert];
407+
if (count == 0u) return;
408+
const uint rows_w = GU ? 2u * a.n : a.n, r = GU ? 2u * n : n;
409+
const float phi = precise::divide(float(bfloat(amax[expert])), float(bfloat(denominator[0])));
410+
device const uchar* row_w = W + ulong(expert) * rows_w * (a.k / 2u) + ulong(r) * (a.k / 2u);
411+
device const uchar* row_s = S + ulong(expert) * rows_w * (a.k / 16u) + ulong(r) * (a.k / 16u);
412+
if (!ink2_nv_two_prod_safe(phi)) {
413+
ink2_nv_grouped_exact<GU>(X, row_w, row_s, members, Y, a, n, expert, count, phi, lane);
414+
return;
415+
}
416+
ink2_nv_grouped_pass<GU, true>(X, row_w, row_s, members, Y, a, n, expert, count, 0.5f * phi, lane);
417+
}
418+
419+
// Threadgroup (x, e): outputs 8x to 8x + 7 of expert e for each of its route pairs, four pairs a pass.
420+
[[kernel, max_total_threads_per_threadgroup(256)]] void tf_ink2_nvfp4_gu_grouped(
421+
device const bfloat* X [[buffer(0)]], device const uchar* W [[buffer(1)]],
422+
device const uchar* S [[buffer(2)]], device const float* amax [[buffer(3)]],
423+
device const float* denominator [[buffer(4)]], device const uint* counts [[buffer(5)]],
424+
device const uint* members [[buffer(6)]], device bfloat* Y [[buffer(7)]],
425+
constant Ink2GroupedArgs& a [[buffer(8)]],
426+
uint2 tg [[threadgroup_position_in_grid]], uint sg [[simdgroup_index_in_threadgroup]],
427+
uint lane [[thread_index_in_simdgroup]]) {
428+
ink2_nv_grouped<true>(X, W, S, amax, denominator, counts, members, Y, a, tg, sg, lane);
429+
}
430+
391431
[[kernel, max_total_threads_per_threadgroup(256)]] void tf_ink2_mxfp8_gu_grouped(
392432
device const bfloat* X [[buffer(0)]], device const uchar* W [[buffer(1)]],
393433
device const uchar* S [[buffer(2)]], device const uint* counts [[buffer(3)]],
@@ -441,33 +481,7 @@ inline void ink2_mx_block(device const uchar* w, device const uchar* scales, uin
441481
constant Ink2GroupedArgs& a [[buffer(8)]],
442482
uint2 tg [[threadgroup_position_in_grid]], uint sg [[simdgroup_index_in_threadgroup]],
443483
uint lane [[thread_index_in_simdgroup]]) {
444-
const uint n = tg.x * 8u + sg, expert = tg.y;
445-
if (n >= a.n) return;
446-
const uint count = counts[expert];
447-
if (count == 0u) return;
448-
const float phi = precise::divide(float(bfloat(amax[expert])), float(bfloat(denominator[0])));
449-
device const uchar* row_w = W + ulong(expert) * a.n * (a.k / 2u) + ulong(n) * (a.k / 2u);
450-
device const uchar* row_s = S + ulong(expert) * a.n * (a.k / 16u) + ulong(n) * (a.k / 16u);
451-
for (uint first = 0u; first < count; first += INK2_PASS) {
452-
uint pair[INK2_PASS];
453-
device const bfloat* x[INK2_PASS];
454-
float d[INK2_PASS];
455-
for (uint j = 0u; j < INK2_PASS; ++j) {
456-
pair[j] = members[expert * a.cap + min(first + j, count - 1u)];
457-
x[j] = X + ulong(pair[j]) * a.k;
458-
d[j] = 0.0f;
459-
}
460-
for (uint b = lane; b < a.k / 16u; b += 32u) {
461-
float weight[16];
462-
ink2_nv_block(row_w, row_s, phi, b, weight);
463-
for (uint j = 0u; j < INK2_PASS; ++j)
464-
for (uint i = 0u; i < 16u; ++i) d[j] += weight[i] * float(x[j][16u * b + i]);
465-
}
466-
for (uint j = 0u; j < INK2_PASS; ++j) {
467-
const float ds = simd_sum(d[j]);
468-
if (lane == 0u && first + j < count) Y[ulong(pair[j]) * a.n + n] = bfloat(ds);
469-
}
470-
}
484+
ink2_nv_grouped<false>(X, W, S, amax, denominator, counts, members, Y, a, tg, sg, lane);
471485
}
472486

473487
[[kernel, max_total_threads_per_threadgroup(256)]] void tf_ink2_mxfp8_down_grouped(

‎zig/kernels/metal/inkling2/experts_units.metal‎

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ inline tfp::frag<bfloat> ink2_units_x(device const bfloat* x0, device const bflo
1010
return tfp::frag<bfloat>(live0 ? *(device const bfloat4*)(x0 + c) : z, live1 ? *(device const bfloat4*)(x1 + c) : z);
1111
}
1212

13-
// Columns 16b + hx .. + 3 of a packed NVFP4 row as BF16 weights, each as ink2_nv_block decodes it.
13+
// Columns 16b + hx .. + 3 of a packed NVFP4 row as BF16 weights: exact 2-product fast path and 3-product fallback.
14+
inline bfloat4 ink2_nv_quad_2p(device const uchar* w, device const uchar* scales, float half_phi, uint b, uint hx) {
15+
const float bs = ink2_e4m3(scales[b]) * half_phi;
16+
const uint word = ((device const uint*)w)[2u * b + ((hx >> 3u) & 1u)] >> (4u * (hx & 4u));
17+
float4 v;
18+
for (uint j = 0u; j < 4u; ++j) v[j] = ink2_e2m1_twice_lut[(word >> (4u * j)) & 15u] * bs;
19+
return bfloat4(bfloat(v[0]), bfloat(v[1]), bfloat(v[2]), bfloat(v[3]));
20+
}
21+
1422
inline bfloat4 ink2_nv_quad(device const uchar* w, device const uchar* scales, float phi, uint b, uint hx) {
1523
const float half_scale = 0.5f * ink2_e4m3(scales[b]);
1624
const uint word = ink2_word(w + 8u * b + (hx & 8u) / 2u) >> (4u * (hx & 4u));
@@ -36,13 +44,17 @@ inline bfloat4 ink2_mx_quad(device const uchar* w, device const uchar* scales, u
3644
return out;
3745
}
3846

39-
template <bool FP8, bool BAD>
47+
template <bool FP8, bool BAD, bool TWO_PROD = false>
4048
inline void ink2_units_w(device const uchar* w, device const uchar* s, uint wb, uint sb, float phi, uint b,
4149
uint hx, thread tfp::frag<bfloat>& b0, thread tfp::frag<bfloat>& b1) {
4250
if (FP8) {
4351
b0 = tfp::frag<bfloat>(ink2_mx_quad(w, s, b, hx, BAD), ink2_mx_quad(w + 8u * wb, s + 8u * sb, b, hx, BAD));
4452
b1 = tfp::frag<bfloat>(ink2_mx_quad(w + 16u * wb, s + 16u * sb, b, hx, BAD),
4553
ink2_mx_quad(w + 24u * wb, s + 24u * sb, b, hx, BAD));
54+
} else if (TWO_PROD) {
55+
b0 = tfp::frag<bfloat>(ink2_nv_quad_2p(w, s, phi, b, hx), ink2_nv_quad_2p(w + 8u * wb, s + 8u * sb, phi, b, hx));
56+
b1 = tfp::frag<bfloat>(ink2_nv_quad_2p(w + 16u * wb, s + 16u * sb, phi, b, hx),
57+
ink2_nv_quad_2p(w + 24u * wb, s + 24u * sb, phi, b, hx));
4658
} else {
4759
b0 = tfp::frag<bfloat>(ink2_nv_quad(w, s, phi, b, hx), ink2_nv_quad(w + 8u * wb, s + 8u * sb, phi, b, hx));
4860
b1 = tfp::frag<bfloat>(ink2_nv_quad(w + 16u * wb, s + 16u * sb, phi, b, hx),
@@ -79,20 +91,13 @@ inline void ink2_units_store(threadgroup float* part, thread tfp::frag<float>& l
7991
threadgroup_barrier(mem_flags::mem_threadgroup);
8092
}
8193

82-
// Threadgroup (x, e): weight rows 32x .. 32x + 31 of expert e by its pairs, 32 a band; FP8 is MXFP8, else NVFP4.
83-
template <bool FP8, bool GU, bool BAD = false>
84-
inline void ink2_units(device const bfloat* X, device const uchar* W, device const uchar* S,
85-
device const float* amax, device const float* denominator,
86-
device const uint* counts, device const uint* members,
87-
device bfloat* Y, constant Ink2GroupedArgs& a, uint2 tg, uint sg, uint lane,
88-
threadgroup float* part) {
89-
const uint expert = tg.y, w0 = 32u * tg.x;
90-
const uint count = counts[expert];
91-
if (count == 0u) return;
94+
// Exact 3-product fallback and 2-product body for BM=32, BN=32 tensor-unit expert tiles.
95+
template <bool FP8, bool GU, bool BAD, bool TWO_PROD>
96+
inline void ink2_units_body(device const bfloat* X, device const uchar* W, device const uchar* S,
97+
float scale_arg, device const uint* members, device bfloat* Y,
98+
constant Ink2GroupedArgs& a, uint expert, uint count, uint w0, uint sg,
99+
uint lane, threadgroup float* part) {
92100
const uint K = GU ? INK2_GU_K : INK2_DOWN_K, rows_w = GU ? 2u * a.n : a.n, steps = K / 128u;
93-
if (w0 >= rows_w) return;
94-
const float phi = FP8 ? 1.0f : (BAD ? 2.0f * ink2_phi(amax, denominator, tg.y)
95-
: ink2_phi(amax, denominator, tg.y));
96101
const uint wb = FP8 ? K : K / 2u, sb = FP8 ? K / 32u : K / 16u;
97102
const short2 home = tfp::frag_home(ushort(lane));
98103
const uint hx = uint(home.x), hy = uint(home.y);
@@ -117,7 +122,7 @@ inline void ink2_units(device const bfloat* X, device const uchar* W, device con
117122
// Simdgroup s sums the columns of eighth s from zero, 16 an op; the eight partial sums are then added in order.
118123
for (uint b = sg * steps; b < (sg + 1u) * steps; ++b) {
119124
tfp::frag<bfloat> b0, b1;
120-
ink2_units_w<FP8, BAD>(w, s, wb, sb, phi, b, hx, b0, b1);
125+
ink2_units_w<FP8, BAD, TWO_PROD>(w, s, wb, sb, scale_arg, b, hx, b0, b1);
121126
ink2_mma(lo0, hi0, ink2_units_x(x0, x1, live0, live1, 16u * b), b0, b1);
122127
if (has_hi) ink2_mma(lo1, hi1, ink2_units_x(x2, x3, live2, live3, 16u * b), b0, b1);
123128
}
@@ -126,6 +131,36 @@ inline void ink2_units(device const bfloat* X, device const uchar* W, device con
126131
}
127132
}
128133

134+
template <bool FP8, bool GU, bool BAD = false>
135+
__attribute__((noinline)) void ink2_units_exact(
136+
device const bfloat* X, device const uchar* W, device const uchar* S, float phi,
137+
device const uint* members, device bfloat* Y, constant Ink2GroupedArgs& a, uint expert,
138+
uint count, uint w0, uint sg, uint lane, threadgroup float* part) {
139+
ink2_units_body<FP8, GU, BAD, false>(X, W, S, phi, members, Y, a, expert, count, w0, sg, lane, part);
140+
}
141+
142+
// Threadgroup (x, e): weight rows 32x .. 32x + 31 of expert e by its pairs, 32 a band; FP8 is MXFP8, else NVFP4.
143+
template <bool FP8, bool GU, bool BAD = false>
144+
inline void ink2_units(device const bfloat* X, device const uchar* W, device const uchar* S,
145+
device const float* amax, device const float* denominator,
146+
device const uint* counts, device const uint* members,
147+
device bfloat* Y, constant Ink2GroupedArgs& a, uint2 tg, uint sg, uint lane,
148+
threadgroup float* part) {
149+
const uint expert = tg.y, w0 = 32u * tg.x;
150+
const uint count = counts[expert];
151+
if (count == 0u) return;
152+
const uint rows_w = GU ? 2u * a.n : a.n;
153+
if (w0 >= rows_w) return;
154+
const float phi = FP8 ? 1.0f : (BAD ? 2.0f * ink2_phi(amax, denominator, tg.y)
155+
: ink2_phi(amax, denominator, tg.y));
156+
if (!FP8 && !ink2_nv_two_prod_safe(phi)) {
157+
ink2_units_exact<FP8, GU, BAD>(X, W, S, phi, members, Y, a, expert, count, w0, sg, lane, part);
158+
return;
159+
}
160+
ink2_units_body<FP8, GU, BAD, !FP8>(X, W, S, FP8 ? 1.0f : (0.5f * phi), members, Y, a, expert, count, w0, sg,
161+
lane, part);
162+
}
163+
129164
[[kernel, max_total_threads_per_threadgroup(256)]] void tf_ink2_nvfp4_gu_units(
130165
device const bfloat* X [[buffer(0)]], device const uchar* W [[buffer(1)]],
131166
device const uchar* S [[buffer(2)]], device const float* amax [[buffer(3)]],

‎zig/src/families/inkling2/metal/experts.zig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ pub const Ref = struct { buf: mtl.Buffer, off: usize = 0 };
88
pub const NvGlobals = struct { amax: Ref, denominator: Ref };
99
pub const Format = plan.Format;
1010
pub const Call = plan.Call;
11+
pub const Nvfp4Scan = plan.Nvfp4Scan;
12+
pub const nvfp4PhiInSafeRange = plan.nvfp4PhiInSafeRange;
13+
pub const nvfp4TwoProdSafe = plan.nvfp4TwoProdSafe;
14+
pub const scanNvfp4Tensors = plan.scanNvfp4Tensors;
1115
pub const Operation = enum { nvfp4_gu, nvfp4_down, mxfp8_gu, mxfp8_down, nvfp4_quantize, mxfp8_quantize, combine, group, group_wide, nvfp4_gu_grouped, nvfp4_down_grouped, mxfp8_gu_grouped, mxfp8_down_grouped };
1216

1317
pub const function_names = [_][:0]const u8{

0 commit comments

Comments
 (0)