Qwen3-0.6B — 2-bit BPDQ (packed)
Qwen3-0.6B with the transformer weights stored as 2-bit bit-planes. 290 MB on disk, 0.47 GiB resident.
import sys; sys.path.insert(0, MODEL_DIR)
import bpdq
model, tok = bpdq.load(MODEL_DIR) # cuda | mps | cpu
On CUDA, vLLM serves it after import bpdq:
LLM(model=MODEL_DIR, quantization="bpdq", dtype="float16").
demo.ipynb and python bpdq.py selftest|bench|chat MODEL_DIR work as in
gitarist/Qwen3-8B-BPDQ-2bit.
Layout
28 layers × 7 linears (q k v o gate up down) = 196 packed matrices, 440M weights.
w[r, c] = c0[g, r] * bit0(r, c) + c1[g, r] * bit1(r, c) + bias[g, r] g = c // 128
| tensor | dtype | shape | bits / weight |
|---|---|---|---|
bpdq_planes |
int32 | [2, out, in / 32] — 2 bit-planes, 32 columns per word |
2.000 |
bpdq_coeffs |
fp16 | [in / 128, out, 3] — c0, c1, bias per (group, row) |
0.375 |
bpdq_dead |
uint8 | [in] — columns stored as exact zero |
0.005 |
| linears | 2.38 |
Each (row, group of 128 columns) has its own 4-level table, so the levels are not a
uniform grid. Groups are contiguous columns (desc_act: false).
embed_tokens is an 8-bit GPTQ-v2 integer set (qweight, qzeros, fp16 scales,
groups of 128). lm_head is tied to it. Norms are fp16. Whole model: about 3.9 bits per
weight.
Kernels
The fast kernels described in the 8B repo — the CUDA tensor-core kernel and the Apple
subset-sum kernel — need group_size = 256. This checkpoint uses group_size = 128,
so bpdq.py falls back to its generic kernels:
- CUDA: the Triton kernel. The packed codes are repacked at
load into
int32 [in / 16, out](16 columns per word, 2 bits each) with an fp32[groups, 3, out]coefficient table; a weight is peeled withcode = word & 3. - Apple: the generic Metal kernel on the same layout. Not measured on this model.
- CPU: a torch reference.
embed_tokensis expanded to fp16 at load; the tiedlm_headuses that fp16 table.
Checked on an RTX 4090 (vLLM 0.30.0, torch 2.13): bpdq.py selftest passes, with a worst
relative error of 5.1e-4 for packed against dense over the real weights. Packed and dense
generations match.
Base model and quality
Base: Qwen/Qwen3-0.6B. The base was smoothed, then quantized with BPDQ and a GGN-curvature correction, then distilled from fp16 Qwen3-0.6B with 90M tokens of gitarist/calibration-mix.
| this model | fp16 Qwen3-0.6B | |
|---|---|---|
| WikiText-2 PPL (seq 2048, 32 chunks) | 36.0 | 20.96 |
| KL to fp16 | 0.723 | 0 |
| GSM8K nothink, 8-shot, 1319 q, greedy, 400 tok | 20.2% | |
| GSM8K think, 8-shot, 1319 q, greedy, 8192 tok | 28.3% |
At 2 bits a 0.6B model is weak. Use it for experiments with the format.
License
Apache-2.0, inheriting Qwen/Qwen3-0.6B.