Quantize on TT cards: CUDA-free GPTQ/LDLQ bfp4 pipeline (Hessians, GPTQ sweep, FP8 teacher on Blackhole) #67
Labels
No labels
human-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack#67
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Owner directive (2026-09-25): the bfp4 GPTQ quantization (#62) must be runnable on our own TT cards, as part of the toolkit, with no CUDA dependency. The first pass used a CUDA box (cfx-llm0, RTX 3080) for the Hessian collection and GPTQ/LDLQ, and a CUDA vLLM for the FP8 teacher.
What the pipeline needs, and where each part would run on TT
H = Σ XᵀXper linear inputXᵀXin fp32 on device. The hook points are the same ones the DSpark tap capture uses.W[:, rest] -= E·Hinv[blk, rest]tools/bfp-quant/bfp.py) runs on host or as a small device op.bfp4_unpack.py/ packer).Risks to measure (on hardware, not ttsim)
fp32_dest_acc_enat HiFi4 (never LoFi together with fp32 acc; a trap we've already paid for). Gate: the TT-built checkpoint must match the CUDA-built G2 in the proxy errortr(E H Eᵀ)/tr(W H Wᵀ)vs W8 to within 1%. Ideally the rounding is also identical on ≥99% of blocks.Deliverables
tools/tt-quant/: collect_hessians_tt.py, gptq_tt.py and teacher_tt.py, plusnix run .#tt-quant..claude/skills/tt-quant/SKILL.md.Progress (branch
tt-quant,cdf66ac): tooling for all 5 stages is written and tested on host; card work is queued behind the MTP lock on cfx-llm2.tools/tt-quant/ttq.py: GPTQ sweep with a pluggable propagation step. With the host fp32 propagator it is bitwise identical toquant.gptq(unit test).TTPropagatorkeeps W on the card and supports plain fp32 or a 3xTF32 split.nix run .#tt-quant -- test|ship|precision|gptq|hessians|teacher|status.Stage 1 measured on hardware (one P150, real L0 H and W8; record bench/runs/tt-quant-precision-20260925T080826Z.jsonl on tt-quant, commit
5105001). Relative error of the GPTQ propagation E1@U vs fp64: host fp32 2e-7; device fp32/HiFi4 1.1-1.2e-3; bf16/HiFi4 2.3e-3; 3xTF32 5.5-5.9e-4; fp32/HiFi2 6.6-7.5e-3. Device fp32 add/subtract is bit-exact vs host. So fp32 operands do not reach the FPU at TF32, and the right-looking run's 24-70% block agreement comes from matmul error, not the eltwise op. X^T X with bf16 activations, HiFi4 and fp32 acc: 5.9e-5. Next (queued behind the MTP lock): exact-bf16 3-way split (6xbf16, 6 products) on the probe, then GPTQ of L0 and L3 with tt-left-6xbf16 vs the host-propagation fallback (cpu-float32, only X^T X on the card), then the TT Hessians. origin/master (PR #68) is merged into tt-quant.Status after the cfx-llm2 reboot: the 6xbf16 chain had already finished every stage before the reboot (all exit 0), so nothing needed a relaunch. Stage 4 proof is queued on the mesh slot. Results:
0c2e5bfon tt-quant.