Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen3.8-27B
|
| 5 |
+
pipeline_tag: image-text-to-text
|
| 6 |
+
tags:
|
| 7 |
+
- paroquant
|
| 8 |
+
- int5
|
| 9 |
+
- w5a8
|
| 10 |
+
- rocm
|
| 11 |
+
- rdna4
|
| 12 |
+
- vllm
|
| 13 |
+
- quantized
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Qwen3.8-27B-PARO-int5
|
| 17 |
+
|
| 18 |
+
Qwen3.8-27B with **ParoQuant rotations on uniform asymmetric int5 weights**, built for AMD RDNA4
|
| 19 |
+
(Radeon AI PRO R9700, gfx1201) and served through a W5A8 fp8-WMMA path in a patched vLLM. It is the
|
| 20 |
+
fidelity-first sibling of [Qwen3.8-27B-PARO-MXFP4](https://huggingface.co/Launch80/Qwen3.8-27B-PARO-MXFP4):
|
| 21 |
+
**4.2x lower KL divergence** for +2.6 ms/step and 3 GB more on disk.
|
| 22 |
+
|
| 23 |
+
- **Weights:** uniform asymmetric int5, group size 128 along K, fp16 group scales and zero points
|
| 24 |
+
(5.25 bits/weight effective). Stored as `"int5-bitplane"`: `qweight`/`qzeros` hold the low four
|
| 25 |
+
bits in the int4 AWQ packing, and `qweight_hi`/`qzeros_hi` are `[K, N/32]` int32 fifth-bit planes.
|
| 26 |
+
- **Rotations:** the learned pairwise Givens rotations (`pairs`, `theta`, 8 layers of 64 disjoint
|
| 27 |
+
pairs per 128-channel group) and pre-inverted `channel_scales` from
|
| 28 |
+
[z-lab/Qwen3.8-27B-PARO](https://huggingface.co/z-lab/Qwen3.8-27B-PARO) (ParoQuant, ICLR'26),
|
| 29 |
+
reused unchanged — rotations trained from scratch on a consumer-RAM calibration budget come out
|
| 30 |
+
as identity past layer ~10.
|
| 31 |
+
- **How it was made:** bf16 base weights x z-lab's channel scales, rotated with z-lab's rotations,
|
| 32 |
+
quantized one-shot to int5 g128 RTN, then a stage-2 fine-tune of the weights and group scales
|
| 33 |
+
under the int5 grid (rotations frozen). Inference identity:
|
| 34 |
+
`y = ((x * channel_scales) R^T) dequant(Q)^T`.
|
| 35 |
+
- **Config:** `quantization_config.quant_method = "paroquant"`, `bits = 5`, `format = "int5-bitplane"`,
|
| 36 |
+
`group_size = 128`, `krot = 8`. `lm_head` and embeddings are bf16, as in the source checkpoints.
|
| 37 |
+
Tokenizer, chat template and generation config are Qwen's.
|
| 38 |
+
|
| 39 |
+
## Why five bits
|
| 40 |
+
|
| 41 |
+
The int4 kernel feeds the fp8 WMMA the signed code `c - 8`, which is exact in e4m3. With 5-bit codes,
|
| 42 |
+
`c - 16` spans -16..15 and **every integer in that range is also exact in e4m3** — so the GEMM algebra,
|
| 43 |
+
the zero-point fold, the per-token activation quant, the rotation-stream producers and the split-K /
|
| 44 |
+
A-tiled bands all carry over unchanged. Only weight staging differs: low nibbles keep the existing word
|
| 45 |
+
layout and the fifth bit rides in a byte-per-(slot, lane) plane in the same fragment order. int6 does
|
| 46 |
+
**not** have this property (codes to ±32 are not exact in e4m3) and would need an int8-WMMA rewrite.
|
| 47 |
+
|
| 48 |
+
At decode the 5-bit kernel costs 1.20-1.26x the 4-bit kernel at M<=8 — exactly the 1.235x byte ratio,
|
| 49 |
+
so it is purely bandwidth-bound with no unpack penalty.
|
| 50 |
+
|
| 51 |
+
## Loading
|
| 52 |
+
|
| 53 |
+
This is **not** loadable by stock transformers or stock vLLM: `paroquant` is a vLLM quantization plugin
|
| 54 |
+
that fuses the rotation with the activation quant and runs the int5 x fp8 WMMA GEMM. It ships in
|
| 55 |
+
[radiance-vllm-mxfp4](https://codeberg.org/ggz14/radiance-vllm-mxfp4) (`paroquant/`, `PAROQUANT.md`),
|
| 56 |
+
which builds the kernels in-container on ROCm for gfx1201:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
./setup-paroquant.sh
|
| 60 |
+
MODEL_DIR=Qwen3.8-27B-PARO-int5 MODE=prod SPEC=7 \
|
| 61 |
+
RADIANCE_PQ_I8=1 RADIANCE_PQ_PG=1 RADIANCE_PQ_ZPE=1 \
|
| 62 |
+
./paroquant/run_paroquant.sh
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
Those three flags select the configuration all the numbers below were measured with: int8 per-group
|
| 66 |
+
activations (`I8` + `PG`) and the zero-point epilogue (`ZPE`). Other hardware would need the rotation
|
| 67 |
+
prologue and GEMM ported; the format itself is plain int5 plus the rotation tensors, so a
|
| 68 |
+
dequantize-and-rotate reference is a few lines.
|
| 69 |
+
|
| 70 |
+
## Results (2 x R9700, TP=2, fp8 KV, DFlash2-FP8 drafter, SPEC=7)
|
| 71 |
+
|
| 72 |
+
KL is `KL(bf16 || candidate)` over wikitext, 96 x 500-char chunks, top-256, with the bf16 reference
|
| 73 |
+
**served on the same stack** — a reference collected on a different image charges quantization ~0.018
|
| 74 |
+
nats that belong to the serving stack's own numerics.
|
| 75 |
+
|
| 76 |
+
| | int4 ParoQuant | PARO-MXFP4 | **this checkpoint** |
|
| 77 |
+
|---|---|---|---|
|
| 78 |
+
| bits/weight | 4.25 | 4.25 | **5.25** |
|
| 79 |
+
| KL top-5 / top-256 | 0.0195 / 0.0285 | 0.0296 / 0.0419 | **0.0070 / 0.0100** |
|
| 80 |
+
| top-1 agreement | 91.5% | 90.3% | **95.21%** |
|
| 81 |
+
| GSM8K 500q, greedy, served path | 97.4-98.0% | 97.4-97.6% | **97.40%** |
|
| 82 |
+
| decode step @ctx 25 / 8k / 32k | 23.5 ms | 23.3 ms | **25.90 / 27.46 / 28.19 ms** |
|
| 83 |
+
| prefill 2k / 8k / 32k / 64k (PP t/s) | 3808 / 3646 / 3495 / 3349 | 4770 / 4827 / 4495 / 4273 | **3941 / 3790 / 3616 / 3436** |
|
| 84 |
+
| KV cache tokens | 854k | 862k | **760k** |
|
| 85 |
+
| on disk | 18 GB | 18 GB | **21 GB** |
|
| 86 |
+
|
| 87 |
+
Where the fidelity comes from, cumulatively: fp16 group scales instead of e8m0 shared exponents
|
| 88 |
+
(-32% KL), the fifth bit (0.0285 -> 0.0155), the stage-2 fine-tune (-> 0.0126), and int8 per-group
|
| 89 |
+
activations instead of e4m3 per-token (-> 0.0097). The last one matters more than it looks: per-*token*
|
| 90 |
+
int8 was the wrong granularity, not the wrong format, and per-group int8 lands **below** the
|
| 91 |
+
weights-only RTN number.
|
| 92 |
+
|
| 93 |
+
## Choosing between this and PARO-MXFP4
|
| 94 |
+
|
| 95 |
+
Task accuracy does not separate them — GSM8K is 97.4-97.8% for every variant, inside noise at 500
|
| 96 |
+
questions. The separation is distributional fidelity: at 0.0100 vs 0.0419 nats this checkpoint stays
|
| 97 |
+
markedly closer to the bf16 base's full output distribution, which is what matters for
|
| 98 |
+
logprob-sensitive work, draft-model acceptance, and long agentic chains where small per-token
|
| 99 |
+
divergences compound. If you want maximum prefill throughput and KV headroom instead, take PARO-MXFP4.
|