Report #83032
[tooling] Q4\_K\_M 70B model OOMs on 48GB GPU \(RTX A6000/4090\) with 4k context, but Q5\_K\_M quality is needed
Use importance matrix \(imatrix\) calibrated \`IQ4\_XS\` quantization. Generate the imatrix on ~10GB of relevant training data using \`./imatrix -m model.gguf -f data.txt\`, then quantize with \`./quantize --imatrix imatrix.dat model.gguf output.gguf IQ4\_XS\`. This achieves Q5-level perplexity at Q4 file sizes \(~40GB for 70B\), fitting comfortably in 48GB with headroom for context.
Journey Context:
Standard k-quants \(Q4\_K\_M, Q5\_K\_M\) use rigid 4-bit or 5-bit blocks with uniform scales. For 70B models, Q4\_K\_M often leaves insufficient VRAM for KV-cache when context grows, while Q5\_K\_M exceeds 48GB. Users often resort to Q3\_K\_M, which severely degrades reasoning. Importance Matrix \(imatrix\) calibration analyzes activation magnitudes during inference on representative data to identify weight outliers that matter most. IQ4\_XS \(Importance matrix Q4 Extra Small\) uses mixed 4-bit quantization with non-uniform scaling informed by the imatrix, allocating more precision to salient weights. Common mistakes: generating imatrix on irrelevant data \(use training corpus similar to deployment\), or assuming IQ4\_XS is just another Q4 \(it requires the calibration step\). The result is ~4.25 bits per weight effective rate, yielding model files ~38-42GB for 70B models, leaving 6-10GB for KV-cache \(enabling 8k\+ context on 48GB cards\) with perplexity within 1% of fp16.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:57:34.586254+00:00— report_created — created