Merge ParoQuant: PRs #65, #66 and #67 (malic), with fixes

Rotated Qwen3.8-27B checkpoints: ParoQuant MXFP4, int5 bit-plane and z-lab's int4 import (the givens
transform with parts, per-row scales, zero points), the w5a16/w4a16_asym decode GEMMs, the
w4a8i8/w5a8i8 prefill band, the givens_rotate kernel, and the dense per-group rotation
(givens_dense_quant: one 128x128 f16 matrix a part and group on the matrix cores) for the quantising
rotation in prefill. gemm_nt_q gains part bounds (pb1/pb2), an op-schema change an out-of-tree
kernel library has to follow.

Fixes on top: the dense matrices are a container table ("t.dense") that rad-convert composes in f64
from the pairs and angles, and the loader only moves its bits. A container converted before this is
refused at load, naming the re-convert (--reuse copies every unchanged weight). A gemm_nt_q row that
does not read part bounds refuses them instead of ignoring them. libavx implements givens_rotate and
givens_dense_quant.
This commit is contained in:
Deadcode committed 2026-10-12 20:46:37 +02:00
commit f6a9467cb5
40 files changed
+4206 -143

No files matched your search

+6 -3
View File
@@ -592,7 +592,8 @@ void r4d_gemm_w8a8_tiled(long a, long ascale, long wq, long ws, long c, int M, i
// as_group 0 = one f32 activation scale per row, 128 = one per (row, 128 of K) at row stride as_rs.
void r4d_gemm_mxfp4a8_nt_m64(long a, long ascale, long wq, long ws, long wref, long c,
int M, int K, int N, int WV, int SK, int MB, int NPW,
int as_group, int as_rs, long stream);
int as_group, int as_rs, long stream,
int lda = 0, int ldws = 0, int ldc = 0);
int r4d_gemm_mxfp4a8_nt_m64_max_m(void);
int r4d_gemm_mxfp4a8_nt_m64_group(void);
// The same weight tiled for PREFILL: a 256-row block reads A fragments straight from a
@@ -601,8 +602,10 @@ int r4d_gemm_mxfp4a8_nt_m64_group(void);
// the per-wave column width in 16-column fragments. as_group 0 = one f32 activation scale per row,
// 128 = one per (row, 128 of K) at row stride as_rs.
void r4d_gemm_mxfp4a8_tiled(long at, long ascale, long wq, long ws, long wref, long c,
int M, int K, int N, int TN, int as_group, int as_rs, long stream);
void r4d_mxfp4a8_tile_a(long a, long at, int M, int K, long stream);
int M, int K, int N, int TN, int as_group, int as_rs, long stream,
int ldws = 0, int ldc = 0);
// `lda` is the activation's row pitch in bytes (0 = K), for a window of a wider plane.
void r4d_mxfp4a8_tile_a(long a, long at, int M, int K, long stream, int lda = 0);
long r4d_mxfp4a8_tile_a_bytes(int M, int K);
int r4d_gemm_mxfp4a8_tiled_group(void);
// The DECODE band (M <= 128) is r4d_rad_gemm_mxfp4a8_decode alone: its split-K partial is the op's