Archived
ParoQuant int5/int4: review fixes -- docs, the w5 layout pinned and inverted, zero points checked, int4 import tested
* docs/OPS.md: the dtypes w5a16, w4a16_asym, w5a8i8, w4a8i8_asym, givens_quant_act_i8g, and which rows read pb1/pb2. * r4d_gemm_w5a16_nt_m64: drop the unused two's-complement dequant copied from w4; the errors name this kernel. * r4d_layout: r4d_rad_unrelayout_w5 (the inverse, wired to both w5 rows; the int4 rows take w4's); a zero point that is not a 4-/5-bit code is refused at load (the int8 prefill kernel reads five bits of it, the f16 one all). * rad_fp8.h: one linear_is_givens predicate (table dtypes checked for both formats, the zero plane's u8 too); declare_rotation declares the tables and rot_stages only, decl_rot_op the op in front of each GEMM. * tests: relayout_parity pins the w5 stored form and its refusal; checkpoint_test imports z-lab's int4 as a fused gate|up (two rotated parts); the selftest's asymmetric planes and part bounds come from one helper each. * checkpoint: the ParoQuant refusal names both readable forms.
This commit is contained in:
1 parent
3491aca6fe
commit
a19cbcae85
10 files changed
+312
-187
No files matched your search
+11
-7
@@ -39,10 +39,13 @@ made knowingly.
|
||||
- `dtype` is always present and always a string. It names the **operand combination**, which is
|
||||
why a weight format and an activation format share one key: `bf16`, `f16`/`fp16`, `f32`/`fp32`,
|
||||
`fp8_e4m3`, `fp8a8`, `fp8a16`, `w4`, `w4a8`, `w4a8_asym`, `w4a8h`, `w8a8`, `w4a16`, `w8a16`,
|
||||
`w2a8`, `mxfp4a8`. `w4a8h` is `w4a8` with a `group`-wide Walsh–Hadamard along K baked into the
|
||||
stored weight (`docs/MOE-W4.md`), `w4a8_asym` the unsigned-nibble-minus-zero-point grid rather
|
||||
than the symmetric one, and `fp8a8`/`fp8a16` say whether a block-scaled E4M3 weight is met by
|
||||
an fp8 activation or a bf16 one. `q_dtype` and `kv_dtype` are the same key split in two where
|
||||
`w2a8`, `mxfp4a8`, `w5a16`, `w4a16_asym`, `w5a8i8`, `w4a8i8_asym`. `w4a8h` is `w4a8` with a
|
||||
`group`-wide Walsh–Hadamard along K baked into the stored weight (`docs/MOE-W4.md`), `w4a8_asym`
|
||||
the unsigned-nibble-minus-zero-point grid rather than the symmetric one, and `fp8a8`/`fp8a16` say
|
||||
whether a block-scaled E4M3 weight is met by an fp8 activation or a bf16 one. `w5a16` and
|
||||
`w4a16_asym` are ParoQuant's int5 and z-lab's int4 (u5 / u4 codes, an f16 scale and a u8 zero
|
||||
point a 128 of K) against an f16 activation, and `w5a8i8` / `w4a8i8_asym` the same weights
|
||||
against an int8 one with an f32 scale per (row, 128 of K). `q_dtype` and `kv_dtype` are the same key split in two where
|
||||
attention reads two formats at once.
|
||||
- `M` is the ranged parameter wherever a token count appears. **At most one ranged parameter per
|
||||
op** — that is what keeps `rad_issue` a single integer on the hot path.
|
||||
@@ -387,9 +390,10 @@ copies of the activation, written side by side -- `q` is `[M, parts * n]`, `scal
|
||||
`[M, parts * n / group]` -- and `pairs` and `angle` stack the parts' `stages` rows each, `rscale`
|
||||
one row a part. `gemm_nt_q` then takes `pb1` and `pb2`, the row bounds of the weight's parts: its
|
||||
rows `[0, pb1)`, `[pb1, pb2)` and `[pb2, N)` meet copy 0, 1 and 2, and `a`/`a_scale` are the wide
|
||||
planes. `givens_rotate` is the same rotation with no quantiser, `y` in its own dtype (f16), for the 16-bit-activation weights `w5a16` (ParoQuant int5: u5 codes, an f16 scale and a u8 zero point a 128 of K) and `w4a16_asym` (z-lab's int4, the same at 4 bits); their GEMM serves any `M` (rows past 64 run as chunks of 64). `pb1` absent is one part; `pb2` absent ends the second part at `N`. Only the `mxfp4a8` rows
|
||||
read them, and the host rows that do not (`libavx`) refuse a call that names one rather than
|
||||
contract against the wrong copy.
|
||||
planes. `givens_rotate` is the same rotation with no quantiser, `y` in its own dtype (f16), for the 16-bit-activation weights `w5a16` and `w4a16_asym`; their GEMM serves any `M` (rows past 64 run as chunks of 64). `givens_quant_act_i8g` is the rotation with `quant_act_i8g`'s quantiser (scale `amax / 127` per `group`), for `w5a8i8` / `w4a8i8_asym`. `pb1` absent is one part; `pb2` absent ends the second part at `N`. The `mxfp4a8` rows and the
|
||||
asymmetric 4- and 5-bit rows (`w5a16`, `w4a16_asym`, `w5a8i8`, `w4a8i8_asym`) read them, and the
|
||||
host rows that do not (`libavx`) refuse a call that names one rather than contract against the
|
||||
wrong copy.
|
||||
|
||||
### The int8 and gated fp8 fusions — device-only
|
||||
|
||||
|
||||
Reference in new issue
Block a user