Archived
core/format, arch/common, libr4d: the ParoQuant M2XFP4 import -- Import::ParoM2 reads a paroquant_m2xfp4 checkpoint's planes and rotations, served as rotated MXFP4 is
A paroquant_m2xfp4 checkpoint (format m2xfp4, groups of 32, subgroups of 8, rotation groups of 128) is imported as ParoQuant's MXFP4 is: the codes, exponents and weight_meta bytes become the m2xfp4 scheme's three planes byte for byte, joined row by row, with the learned rotations beside them as the givens tables. LinearFP8 declares the rotated form like the rotated MXFP4 one, through givens_dense_quant into its own E4M3 pair, and libr4d's layout hook and both m2xfp4 rows accept it, the rows running a fused projection's parts (pb1/pb2) one launch a part as the mxfp4a8 rows do. libref accepts the rotated planes and runs the parts as its mxfp4a8 arm does; libavx serves no M2XFP4. checkpoint_test covers the import, quant_m2xfp_test libref's parts and r4d_selftest libr4d's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b6ad757bfa
commit
2c645333a1
11 files changed
+469
-102
No files matched your search
@@ -608,40 +608,62 @@ extern "C" void r4d_gemm_m2xfp4a8_decode(long a, long ascale, long wq, long ws,
|
||||
// ============================================================== the plugin ABI entry point
|
||||
extern "C" int r4d_rad_gemm_m2xfp4a8_decode(const RadArgs* a, RadStream s) {
|
||||
GemmOps g;
|
||||
/* No parts: the m2xfp4 declare makes none, so gemm_ops refuses pb1/pb2, as libref does. */
|
||||
int rc = gemm_ops(a, &g, 1);
|
||||
int rc = gemm_ops(a, &g, 1, /*parts=*/1);
|
||||
if (rc != RAD_OK) return rc;
|
||||
if (g.N < 16 || g.N % 16) return R4D_NO(RAD_E_SHAPE);
|
||||
if (!g.ascale || !g.bref) return R4D_NO(RAD_E_INVAL);
|
||||
MxParts mp;
|
||||
rc = mx_parts(a, &g, &mp);
|
||||
if (rc != RAD_OK) return rc;
|
||||
if (g.K % 64) return R4D_NO(RAD_E_SHAPE);
|
||||
if (g.M > r4d_gemm_m2xfp4a8_decode_max_m() || g.N > R4D_M2D_MAX_N) return R4D_NO(RAD_E_SHAPE);
|
||||
int as_group = 0, as_rs = 1;
|
||||
rc = mx_ascale_grid(g, &as_group, &as_rs);
|
||||
rc = mx_ascale_grid(g, &as_group, &as_rs, mp.n);
|
||||
if (rc != RAD_OK) return rc;
|
||||
R4dMxDecCfg t;
|
||||
r4d_cfg_mxfp4_decode(a, &t);
|
||||
// The meta plane rides the weight blob's tail, in the scale plane's [K/32][N] order.
|
||||
const long meta = r4d_addr(g.b) + (long)g.N * g.K / 2;
|
||||
R4D_TRY("gemm_m2xfp4a8_decode",
|
||||
m2d_launch(r4d_addr(g.a), r4d_addr(g.ascale), r4d_addr(g.b), r4d_addr(g.bscale), meta,
|
||||
r4d_addr(g.bref), r4d_addr(g.y), (int)g.M, (int)g.K, (int)g.N, t.ks, t.bk, t.nt,
|
||||
as_group, as_rs, (long)(uintptr_t)s, (long)(uintptr_t)a->scratch,
|
||||
(long)a->scratch_bytes, (int)g.K, (int)g.N, (int)g.N));
|
||||
const long long kb = (g.K + 127) / 128;
|
||||
// The meta plane rides the weight blob's tail, in the scale plane's [K/32][N] order: a part of
|
||||
// a partitioned weight (mx_parts) windows it at n0 as it does the exponent plane, and the codes
|
||||
// at n0 * K / 2.
|
||||
const long meta0 = (long)g.N * g.K / 2;
|
||||
for (int p = 0; p < mp.n; ++p) {
|
||||
const long long n0 = mp.n0[p], np = mp.n1[p] - mp.n0[p];
|
||||
R4D_TRY("gemm_m2xfp4a8_decode",
|
||||
m2d_launch(r4d_addr(g.a) + p * g.K, r4d_addr(g.ascale) + (long)(p * kb * 4),
|
||||
r4d_addr(g.b) + n0 * g.K / 2, r4d_addr(g.bscale) + n0,
|
||||
r4d_addr(g.b) + meta0 + n0, r4d_addr(g.bref) + n0,
|
||||
r4d_addr(g.y) + n0 * 2,
|
||||
(int)g.M, (int)g.K, (int)np, t.ks, t.bk, t.nt, as_group, as_rs,
|
||||
(long)(uintptr_t)s, (long)(uintptr_t)a->scratch, (long)a->scratch_bytes,
|
||||
(int)(mp.lda ? mp.lda : g.K), (int)g.N, (int)g.N));
|
||||
}
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
/* The op's scratch size. A narrower M can split wider than the band's widest M, so the size is the
|
||||
* widest split over the band times the widest M, an upper bound for every launch. */
|
||||
* widest split over the band times the widest M, an upper bound for every launch. Parts of a
|
||||
* partitioned weight split at their own N and run in turn sharing the scratch, so the bound is the
|
||||
* largest part's. */
|
||||
extern "C" int64_t r4d_rad_gemm_m2xfp4a8_decode_scratch(const RadArgs* a) {
|
||||
const long long M = r4d_geti_or(a, "M", 0), N = r4d_geti_or(a, "N", 0);
|
||||
const long long K = r4d_geti_or(a, "K", 0);
|
||||
if (M < 1 || N < 16 || K < 64 || M > r4d_gemm_m2xfp4a8_decode_max_m()) return 0;
|
||||
R4dMxDecCfg t;
|
||||
r4d_cfg_mxfp4_decode(a, &t);
|
||||
int ks = 1;
|
||||
for (int m = 1; m <= (int)M; ++m) {
|
||||
const int k = m2d_plan(m, (int)K, (int)N, t.ks, t.bk, t.nt).ks;
|
||||
if (k > ks) ks = k;
|
||||
long long bound[4];
|
||||
mx_part_bounds(N, r4d_geti_or(a, "pb1", 0), r4d_geti_or(a, "pb2", 0), bound);
|
||||
int64_t worst = 0;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
const long long np = bound[i + 1] - bound[i];
|
||||
if (np < 16) continue;
|
||||
int ks = 1;
|
||||
for (int m = 1; m <= (int)M; ++m) {
|
||||
const int k = m2d_plan(m, (int)K, (int)np, t.ks, t.bk, t.nt).ks;
|
||||
if (k > ks) ks = k;
|
||||
}
|
||||
const int64_t b = (int64_t)m2d_partial_bytes((int)M, (int)np, ks);
|
||||
if (b > worst) worst = b;
|
||||
}
|
||||
return (int64_t)m2d_partial_bytes((int)M, (int)N, ks);
|
||||
return worst;
|
||||
}
|
||||
@@ -325,37 +325,49 @@ extern "C" void r4d_gemm_m2xfp4a8_tiled(long at, long ascale, long wq, long ws,
|
||||
}
|
||||
|
||||
// ============================================================== the plugin ABI entry point
|
||||
// The row-major activation is re-tiled into the op's scratch and the GEMM reads it there.
|
||||
// The row-major activation is re-tiled into the op's scratch and the GEMM reads it there. For a
|
||||
// partitioned weight (mx_parts), each part's activation copy is re-tiled and multiplied in turn.
|
||||
extern "C" int r4d_rad_gemm_m2xfp4a8_tiled(const RadArgs* a, RadStream s) {
|
||||
GemmOps g;
|
||||
/* No parts: the m2xfp4 declare makes none, so gemm_ops refuses pb1/pb2, as libref does. */
|
||||
int rc = gemm_ops(a, &g, 1);
|
||||
int rc = gemm_ops(a, &g, 1, /*parts=*/1);
|
||||
if (rc != RAD_OK) return rc;
|
||||
if (g.N < 16 || g.N % 16) return R4D_NO(RAD_E_SHAPE);
|
||||
if (!g.ascale) return R4D_NO(RAD_E_INVAL);
|
||||
/* The per-row reference exponent is required, as in r4d_rad_gemm_mxfp4a8_m64. */
|
||||
if (!g.bref) return R4D_NO(RAD_E_INVAL);
|
||||
MxParts mp;
|
||||
rc = mx_parts(a, &g, &mp);
|
||||
if (rc != RAD_OK) return rc;
|
||||
if (g.K % R4D_M2T_KUNIT) return R4D_NO(RAD_E_SHAPE);
|
||||
int as_group = 0, as_rs = 1;
|
||||
rc = mx_ascale_grid(g, &as_group, &as_rs);
|
||||
rc = mx_ascale_grid(g, &as_group, &as_rs, mp.n);
|
||||
if (rc != RAD_OK) return rc;
|
||||
const long long slab = r4d_m2xfp4a8_tile_a_bytes((int)g.M, (int)g.K);
|
||||
if (!a->scratch || a->scratch_bytes < slab) return R4D_NO(RAD_E_INVAL);
|
||||
R4dMxTileCfg t;
|
||||
r4d_cfg_mxfp4_tiled(a, &t);
|
||||
const long kb = (long)((g.K + 127) / 128);
|
||||
const long at = (long)(uintptr_t)a->scratch;
|
||||
// The meta plane rides the weight blob's tail, in the scale plane's [K/32][N] order.
|
||||
const long meta = r4d_addr(g.b) + (long)g.N * g.K / 2;
|
||||
R4D_TRY("gemm_m2xfp4a8_tiled",
|
||||
r4d_m2xfp4a8_tile_a(r4d_addr(g.a), at, (int)g.M, (int)g.K, (long)(uintptr_t)s, (int)g.K);
|
||||
r4d_gemm_m2xfp4a8_tiled(at, r4d_addr(g.ascale), r4d_addr(g.b), r4d_addr(g.bscale), meta,
|
||||
r4d_addr(g.bref), r4d_addr(g.y), (int)g.M, (int)g.K, (int)g.N,
|
||||
t.tn, as_group, as_rs, (long)(uintptr_t)s, (int)g.N, (int)g.N));
|
||||
// The meta plane rides the weight blob's tail, in the scale plane's [K/32][N] order; a part
|
||||
// windows it at n0, as it does the exponent plane.
|
||||
const long meta0 = (long)g.N * g.K / 2;
|
||||
for (int p = 0; p < mp.n; ++p) {
|
||||
const long long n0 = mp.n0[p], np = mp.n1[p] - mp.n0[p];
|
||||
R4D_TRY("gemm_m2xfp4a8_tiled",
|
||||
r4d_m2xfp4a8_tile_a(r4d_addr(g.a) + p * g.K, at, (int)g.M, (int)g.K,
|
||||
(long)(uintptr_t)s, (int)(mp.lda ? mp.lda : g.K));
|
||||
r4d_gemm_m2xfp4a8_tiled(at, r4d_addr(g.ascale) + p * kb * 4,
|
||||
r4d_addr(g.b) + n0 * g.K / 2, r4d_addr(g.bscale) + n0,
|
||||
r4d_addr(g.b) + meta0 + n0, r4d_addr(g.bref) + n0,
|
||||
r4d_addr(g.y) + n0 * 2, (int)g.M, (int)g.K, (int)np, t.tn,
|
||||
as_group, as_rs, (long)(uintptr_t)s, (int)g.N, (int)g.N));
|
||||
}
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
/* The op's scratch, sized at the band's widest M: the fragment-tiled activation in whole 16-row
|
||||
* fragments. */
|
||||
* fragments. One copy serves every part: parts run in order on the op's stream, so a re-tile
|
||||
* cannot overtake the previous part's GEMM. */
|
||||
extern "C" int64_t r4d_rad_gemm_m2xfp4a8_tiled_scratch(const RadArgs* a) {
|
||||
const long long M = r4d_geti_or(a, "M", 0), K = r4d_geti_or(a, "K", 0);
|
||||
return (int64_t)r4d_m2xfp4a8_tile_a_bytes((int)M, (int)K);
|
||||
|
||||
+27
-3
@@ -977,12 +977,17 @@ extern "C" int r4d_rad_relayout_mxfp4_gated(const RadParam* p, int n_p, int oper
|
||||
* bounds the fold: d >= 0 for every block, so the largest e4m3 a table cell holds is the x1.75
|
||||
* magnitude 10.5 scaled by 2^-d, a normal at every d >= 0.
|
||||
*
|
||||
* Anything else is refused, a transform included: this kernel library decodes one scheme, and a
|
||||
* weight whose meta plane said something else would decode to other numbers. */
|
||||
* Anything else is refused: this kernel library decodes one scheme, and a weight whose meta plane
|
||||
* said something else would decode to other numbers.
|
||||
*
|
||||
* A rotated weight (ParoQuant's M2XFP4) carries the same three planes in the basis its "givens"
|
||||
* transform names, with the rotation's tables beside them -- the rotated MXFP4 weight's shape plus
|
||||
* the meta plane. The GEMM reads the planes as for an unrotated weight; the rotation is applied to
|
||||
* the activation (givens_dense_quant), whose tables are separate weight operands. */
|
||||
namespace {
|
||||
/* The scheme's three planes, whichever kind of weight carries them. */
|
||||
bool m2_planes(const RadEncoding* enc) {
|
||||
if (!enc || !rad_enc_is(enc, "m2xfp4")) return false;
|
||||
if (enc->transform[0] || enc->n_planes != 3) return false;
|
||||
if (enc->plane[0].dtype != RAD_FP4E2M1 || enc->plane[0].block[0] != 1 ||
|
||||
enc->plane[0].block[1] != 1)
|
||||
return false;
|
||||
@@ -997,6 +1002,23 @@ bool m2_planes(const RadEncoding* enc) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* A rotated one: the three planes in the basis of a "givens" transform, whose tables are views of
|
||||
* the weight's planes. Only the presence and the dtype of the tables is checked here (the arch
|
||||
* declares them as operands the rotation op reads); any other transform would decode to other
|
||||
* numbers, so it is refused. */
|
||||
bool m2_paro_enc(const RadEncoding* enc, long long K) {
|
||||
if (!enc || std::strncmp(enc->transform, "givens", RAD_ENC_STR) != 0) return false;
|
||||
if (enc->n_planes < 6 || !rad_enc_valid(enc) || !m2_planes(enc)) return false;
|
||||
const int p = rad_enc_find(enc, "t.pairs"), an = rad_enc_find(enc, "t.angle"),
|
||||
sc = rad_enc_find(enc, "t.scale");
|
||||
if (p < 0 || an < 0 || sc < 0) return false;
|
||||
if (enc->plane[p].dtype != RAD_I32 || enc->plane[an].dtype != RAD_F32 ||
|
||||
enc->plane[sc].dtype != RAD_F32)
|
||||
return false;
|
||||
/* The quantiser rotates whole groups of 128 columns, one scale per group. */
|
||||
return K % 128 == 0 && enc->plane[p].extent[1] == K;
|
||||
}
|
||||
|
||||
int m2_enc_layout(const RadParam* p, int n_p, int operand, const RadEncoding* enc, const int* sel,
|
||||
const RadTensor* pl, int n, RadLayout* out, WGeom* gout) {
|
||||
if (!out || !pl) return RAD_E_INVAL;
|
||||
@@ -1005,6 +1027,8 @@ int m2_enc_layout(const RadParam* p, int n_p, int operand, const RadEncoding* en
|
||||
if (rc != RAD_OK) return rc;
|
||||
if (g.group != R4D_MXFP4_GROUP || g.K % 16) return RAD_E_SHAPE;
|
||||
if (!m2_planes(enc)) return RAD_E_DTYPE;
|
||||
const bool plain = !enc->transform[0] && enc->n_planes == 3;
|
||||
if (!plain && !m2_paro_enc(enc, g.K)) return RAD_E_DTYPE;
|
||||
if (gout) *gout = g;
|
||||
const long long nblk = g.K / R4D_MXFP4_GROUP;
|
||||
if (operand == Q_BSCALE || operand == Q_BREF) {
|
||||
|
||||
+31
-16
@@ -4867,13 +4867,19 @@ static void mxfp4a8_m_invariant(const Plugin& pl, const char* row, int64_t N, in
|
||||
* mxfp4 row's plus the table's accepted k = 3 rounding: a quarter of the weights at up to 2^-4.4
|
||||
* each is about 1.2% of a whole dot, so 4e-2 holds the same margin the 1e-2 does there. The
|
||||
* relayout is exercised for real: the weight operand takes codes and meta, and the stored blob the
|
||||
* launch reads is this hook's output. The output starts as NaN, as there. */
|
||||
* launch reads is this hook's output. The output starts as NaN, as there. Parts (ParoQuant's
|
||||
* rotated M2XFP4): weight rows [0, pb1), [pb1, pb2), [pb2, N) each meet their own copy of the
|
||||
* activation, as at mxfp4a8. */
|
||||
static void m2xfp4a8_numeric(const Plugin& pl, const char* row, int64_t M, int64_t N, int64_t K,
|
||||
int tn, bool ablk = false, std::vector<RadParam> extra = {}) {
|
||||
int tn, bool ablk = false, std::vector<RadParam> extra = {},
|
||||
int64_t pb1 = 0, int64_t pb2 = 0) {
|
||||
if (!sel(row)) return;
|
||||
const PartCut cut(N, pb1, pb2);
|
||||
const int parts = cut.parts;
|
||||
char nm[160];
|
||||
std::string ex;
|
||||
for (const RadParam& p : extra) ex += std::string(" ") + p.key + "=" + std::to_string(p.ival);
|
||||
if (parts > 1) ex += " parts=" + std::to_string(parts);
|
||||
std::snprintf(nm, sizeof nm, "%s numeric M=%lld N=%lld K=%lld tn=%d%s%s", row, (long long)M,
|
||||
(long long)N, (long long)K, tn, ablk ? " ascale=row x 128" : "", ex.c_str());
|
||||
const RadKernelInfo* r = find(pl, row);
|
||||
@@ -4906,20 +4912,21 @@ static void m2xfp4a8_numeric(const Plugin& pl, const char* row, int64_t M, int64
|
||||
}
|
||||
|
||||
const int64_t nkb = (K + 127) / 128, asc = ablk ? nkb : 1;
|
||||
std::vector<uint8_t> ha((size_t)(M * K));
|
||||
std::vector<float> av((size_t)(M * K)), as((size_t)(M * asc));
|
||||
const int64_t PK = parts * K, PA = parts * asc; /* a row of `a`, and of its scale */
|
||||
std::vector<uint8_t> ha((size_t)(M * PK));
|
||||
std::vector<float> av((size_t)(M * PK)), as((size_t)(M * PA));
|
||||
for (int64_t i = 0; i < M; ++i) {
|
||||
for (int64_t c = 0; c < asc; ++c) {
|
||||
const uint32_t h = st_mix32((uint32_t)(i * asc + c) ^ 0xa5u);
|
||||
as[(size_t)(i * asc + c)] =
|
||||
for (int64_t c = 0; c < PA; ++c) {
|
||||
const uint32_t h = st_mix32((uint32_t)(i * PA + c) ^ 0xa5u);
|
||||
as[(size_t)(i * PA + c)] =
|
||||
ablk ? ((i + c) % 11 == 5 ? 0.0f : 0.002f * (float)(1 + h % 97))
|
||||
: 0.0125f * (float)(1 + h % 5);
|
||||
}
|
||||
for (int64_t k = 0; k < K; ++k) {
|
||||
const bool zero = ablk && as[(size_t)(i * asc + k / 128)] == 0.0f;
|
||||
for (int64_t k = 0; k < PK; ++k) {
|
||||
const bool zero = ablk && as[(size_t)(i * PA + (k / K) * asc + (k % K) / 128)] == 0.0f;
|
||||
const float v = zero ? 0.0f : mxfp4_act(i, k, 0x3cu);
|
||||
rad_store_f32(ha.data(), RAD_F8E4M3, i * K + k, v);
|
||||
av[(size_t)(i * K + k)] = rad_load_f32(ha.data(), RAD_F8E4M3, i * K + k);
|
||||
rad_store_f32(ha.data(), RAD_F8E4M3, i * PK + k, v);
|
||||
av[(size_t)(i * PK + k)] = rad_load_f32(ha.data(), RAD_F8E4M3, i * PK + k);
|
||||
}
|
||||
}
|
||||
std::vector<uint16_t> hy((size_t)(M * N), 0x7fc0); /* bf16 NaN */
|
||||
@@ -4937,8 +4944,8 @@ static void m2xfp4a8_numeric(const Plugin& pl, const char* row, int64_t M, int64
|
||||
st_memcpy(d_e, ws.data(), ws.size(), hipMemcpyHostToDevice);
|
||||
st_memcpy(d_r, wr.data(), wr.size(), hipMemcpyHostToDevice);
|
||||
std::vector<RadTensor> ts = {
|
||||
T(d_a, RAD_F8E4M3, { M, K }),
|
||||
ablk ? T(d_s, RAD_F32, { M, asc }) : T(d_s, RAD_F32, { M }),
|
||||
T(d_a, RAD_F8E4M3, { M, PK }),
|
||||
ablk ? T(d_s, RAD_F32, { M, PA }) : T(d_s, RAD_F32, { M }),
|
||||
T(d_w, RAD_U8, { (int64_t)wq.size() }), T(d_e, RAD_U8, { (int64_t)ws.size() }),
|
||||
T(d_y, RAD_BF16, { M, N }), T(nullptr, RAD_F32, { 1 }), T(d_r, RAD_U8, { (int64_t)wr.size() }),
|
||||
};
|
||||
@@ -4946,6 +4953,8 @@ static void m2xfp4a8_numeric(const Plugin& pl, const char* row, int64_t M, int64
|
||||
std::vector<RadParam> ps = { PI("M", M), PI("N", N), PI("K", K), PI("group", 32),
|
||||
PS("dtype", "m2xfp4") };
|
||||
if (tn) ps.push_back(PI("tn", tn));
|
||||
if (pb1) ps.push_back(PI("pb1", pb1));
|
||||
if (pb2) ps.push_back(PI("pb2", pb2));
|
||||
for (const RadParam& p : extra) ps.push_back(p);
|
||||
RadArgs a;
|
||||
std::memset(&a, 0, sizeof(a));
|
||||
@@ -4974,6 +4983,7 @@ static void m2xfp4a8_numeric(const Plugin& pl, const char* row, int64_t M, int64
|
||||
double num = 0, den = 0;
|
||||
for (int64_t i = 0; i < M; ++i)
|
||||
for (int64_t n = 0; n < N; n = (n + 1 == N) ? N : std::min(n + nstep, N - 1)) {
|
||||
const int pt = cut.part_of(n);
|
||||
double acc = 0;
|
||||
for (int64_t k = 0; k < K; ++k) {
|
||||
const uint8_t meta = p.data[(size_t)im][(size_t)(n * nblk + k / 32)];
|
||||
@@ -4982,8 +4992,8 @@ static void m2xfp4a8_numeric(const Plugin& pl, const char* row, int64_t M, int64
|
||||
(double)rad_load_f32(p.data[(size_t)ic].data(), RAD_FP4E2M1, n * K + k) *
|
||||
(1.0 + kk / 4.0) *
|
||||
(double)rad_load_f32(p.data[(size_t)is].data(), RAD_E8M0, n * nblk + k / 32);
|
||||
acc += (double)av[(size_t)(i * K + k)] * w *
|
||||
(ablk ? (double)as[(size_t)(i * asc + k / 128)] : 1.0);
|
||||
acc += (double)av[(size_t)(i * PK + pt * K + k)] * w *
|
||||
(ablk ? (double)as[(size_t)(i * PA + pt * asc + k / 128)] : 1.0);
|
||||
}
|
||||
if (!ablk) acc *= (double)as[(size_t)i];
|
||||
const double d = (double)h_bf16(hy[(size_t)(i * N + n)]) - acc;
|
||||
@@ -28215,17 +28225,22 @@ static void device_phase(const Plugin& pl) {
|
||||
{ PI("ks", ks), PI("bk", bk), PI("nt", nt) });
|
||||
}
|
||||
/* The M2XFP4 rows: the decode band's rule and band edges, the tiled row at both widths and
|
||||
* past the tn crossover, and both activation grids, at the three-plane encoding. */
|
||||
* past the tn crossover, both activation grids, and parts (ParoQuant's rotated M2XFP4) --
|
||||
* the same spread the OCP rows get, at the three-plane encoding. */
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 8, 272, 640, 0, false);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 8, 272, 640, 0, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 40, 400, 2560, 0, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 128, 512, 2560, 0, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 5, 1040, 576, 0, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 96, 14336, 640, 0, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 8, 400, 2560, 0, true, {}, 128);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_decode", 40, 512, 2560, 0, true, {}, 128, 384);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_tiled", 40, 272, 640, 2, false);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_tiled", 300, 400, 640, 4, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_tiled", 2100, 512, 2560, 0, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_tiled", 300, 272, 576, 2, true);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_tiled", 300, 400, 640, 2, true, {}, 192);
|
||||
m2xfp4a8_numeric(pl, "gemm_m2xfp4a8_tiled", 300, 34816, 5120, 0, true, {}, 17408);
|
||||
gemm_case(pl, "gemm_w4a8_tiled", "w4a8", 256, 256, K, RAD_I8, 1, 0, 0, 256*K/2, 256*(K/128)*4);
|
||||
gemm_case(pl, "gemm_w8a8_tiled", "w8a8", 256, 256, K, RAD_I8, 1, 0, 0, 256*K, 256*(K/128)*2);
|
||||
gemm_case(pl, "gemm_w4a8_prefill", "w4a8", 256, 256, K, RAD_I8, 1, 0, 0, 256*K/2, 256*(K/128)*4);
|
||||
|
||||
Reference in new issue
Block a user