Quant Menu — 9 Quantization Formats (v0.38.0)
Pick the right quantization format for your base model and hardware. Soup loads the appropriate quantization_config and trains LoRA on top.
# Train LoRA on top of a pre-quantized GPTQ checkpoint:
base: TheBloke/Llama-2-7B-Chat-GPTQ
training:
quantization: gptq # or: awq, hqq:4bit, aqlm, eetq, mxfp4, fp8For FSDP with QLoRA there is nothing to set: when you launch with --fsdp and quantization: 4bit, Soup sets training.bnb_4bit_quant_storage itself to the compute dtype, and overrides a different value you wrote, printing FSDP QLoRA: selected or overrode. The key is otherwise an ordinary BNB setting, accepted only with quantization: 4bit (since v0.76.0 mxfp4 with bnb_4bit_quant_storage is refused, because the MXFP4 load is dequantized and not a bitsandbytes load).
What v0.74.0 changed for a 4-bit load
The fp32 finding is usually described in terms of a frozen base, which is a full-precision story. It reaches a quantized load too. A quantization: 4bit or 8bit model still holds real modules outside the quantized linears, the embeddings, the norms and the LM head, and those were being materialised in fp32 for the same reason: no dtype was passed. They now follow the load dtype (auto, or an explicit fp16 on a pre-Ampere card), matching bnb_4bit_compute_dtype instead of sitting a precision above it. Do not attach the release's 2.59x figure to this: that number was measured on an unquantized frozen base with LoRA, and a 4-bit run was never paying the same bill.
Format matrix
| Format | Bits | Use case | Optional dep |
|---|---|---|---|
4bit | 4 | Default. Best general LoRA training. | bitsandbytes |
8bit | 8 | Larger memory budget, more accurate gradients. | bitsandbytes |
none | 16/32 | Full fine-tuning or DPO/PPO without quant. | — |
gptq | 2/3/4/8 | Train LoRA on top of an existing GPTQ checkpoint. | gptqmodel |
awq | 4 | Train LoRA on top of an existing AWQ checkpoint. | autoawq |
hqq:Nbit | 1, 2, 3, 4, 5, 6, 8 | Wide bit range; compose with LoRA. | hqq |
aqlm | 2 | Extreme compression. | aqlm |
eetq | 8 | Fast 8-bit kernel for SM75+. | eetq |
mxfp4 | 4 (stored) | Train LoRA on top of an MXFP4 pre-quantized checkpoint (for example GPT-OSS). Loaded with Mxfp4Config(dequantize=True), so it trains in bf16: budget memory for the bf16 model, an estimated 2 bytes per parameter (roughly 42 GB for a 20B base). A local base must declare quant_method: mxfp4 in its config.json, or the config is refused at setup | — |
fp8 | — | Train LoRA on top of an FP8-released checkpoint. Loaded with FineGrainedFP8Config(dequantize=True), so it also trains in bf16: budget for the bf16 model, 2 bytes per parameter, not for the FP8 file | transformers ≥ 5.17.0 |
VRAM pre-flight. On a CUDA card (not under stream_layers, which has its own check, and not on backend: mlx), soup train prices the weights of the chosen format before the model loads and refuses a run that does not fit; --allow-oom-attempt launches it anyway. It does nothing on CPU or when the card's memory is unknown. The figures are estimates, in bytes per parameter: 4bit 0.5, 8bit 1.0, none 2.0, gptq and awq 0.55, aqlm 0.5, eetq 1.0, and 2.0 for mxfp4 and fp8, which are dequantized on load. hqq:* has no figure, so the run starts and the pre-flight prints Pre-flight skipped: no memory model for quantization: hqq:4bit (with the format you set). No refusal there does not mean the run fits.
Compatibility matrix
soup train runs check_quant_distributed_compat() at startup. HQQ / EETQ / AQLM hard-fail with FSDP and ZeRO-3; BNB 4-bit + FSDP is resolved rather than warned about since #350: bnb_4bit_quant_storage is set to the effective compute dtype before the model loads, and the adapter parameters are aligned to it before FSDP wraps them, which closes both halves of the old failure. Nothing is left for you to set by hand. The remaining combinations emit a yellow warning.
Pre-quantized + QAT
gptq / awq / hqq:* / aqlm / eetq / mxfp4 / fp8 all carry their own scale; combining with quantization_aware: fp8 or quest is rejected at config-load. quantization_aware: true (int8 QAT) is refused on its own, whatever the format (v0.76.0, #1222): see Backends.
Training on AWQ and GPTQ checkpoints is separate from exporting to them. The Quant Menu path above, a LoRA on top of an existing awq or gptq checkpoint, is not deprecated. The export commands are: soup export --format awq|gptq and soup quantize --to awq|gptq now print Deprecated: and are planned for removal in v0.77, because the AutoAWQ and AutoGPTQ projects are archived upstream and the [awq] extra cannot be installed next to [train]. They point at gguf, onnx, tensorrt, bitnet and tq1_0 instead; see Export.
Scope
Wired into the SFT trainer + transformers backend in v0.38.0. Multi-trainer expansion landed in v0.40.5. MLX backend gets a distinct error message naming the actual reason.
Soup is free and Apache-2.0. If it saved you a training run, starring the repo costs nothing and helps most. You can also fund the GPU time behind the work a 4 GB laptop cannot reach.