What's New
Quant Menu — 7 new train-time quantization formats. Train LoRA on top of any pre-quantized base model. Closes the width gap with LlamaFactory.
- GPTQ / AWQ / HQQ (1-8 bit) / AQLM / EETQ / MXFP4 / FP8 — set
training.quantizationto one ofgptq/awq/hqq:1bit..hqq:8bit/aqlm/eetq/mxfp4/fp8. Each format gets a builder + (where applicable) checkpoint validator + transformers*Configwiring. - Compatibility matrix enforced at startup —
check_quant_distributed_compathard-fails HQQ/EETQ/AQLM × {FSDP, ZeRO-3} (sourced from LlamaFactoryquantization.py:199/211). BNB-4bit + FSDP withoutbnb_4bit_quant_storagewarns before the silent 2-3x perf cliff. bnb_4bit_quant_storagefield — set tobfloat16/float16for the canonical FSDP+QLoRA combo ("crucial for fsdp+qlora" — LlamaFactoryquantization.py:178). Schema rejects on every non-BNB-4bit format.- Pre-quantized + QAT mutually exclusive — every pre-quantized format combined with
quantization_awareis rejected at config-load. docs/QUANTIZATION.md— full compatibility matrix (format × {DDP / FSDP / ZeRO-1 / ZeRO-2 / ZeRO-3}) with per-format optional dep + use case.- Net +61 tests (4374 → 4435) covering schema acceptance, builder shape, checkpoint validators, cross-validators, compat matrix, modality/task/backend gates, adversarial inputs, and the central loader entry point.
Install / Upgrade
pip install --upgrade soup-cliOptional extras per format: pip install soup-cli[gptq], [awq], etc. (HQQ, AQLM, EETQ each have their own pip package — see docs/QUANTIZATION.md.)
Security
validate_gptq_checkpoint/validate_awq_checkpointreject null bytes and reduce error-message paths toos.path.basename(no absolute-path leak — matches v0.34.0 crash.py policy).- HQQ suffix capped at 16 chars (DoS defence-in-depth even though Pydantic Literal is closed).
boolrejection on HQQgroup_size(matches project-wide policy from v0.30.0Candidate).check_quant_distributed_compatraisesValueErroron unknown quant (no silent pass)._distributed_strategyuses explicit token sets (zero3/zero++/stage3) instead of fragile substring matching, preventing crafted preset paths from bypassing the matrix.
Known Limitations
- Multi-trainer wiring deferred to v0.38.1 — Quant Menu values are wired into the SFT trainer + transformers backend + text modality only. DPO / GRPO / KTO / ORPO / SimPO / IPO / PPO / RewardModel / Pretrain / Embedding wrappers + vision/audio paths still hardcode the legacy
4bit/8bitbranches. Schema gates protect users from silent no-ops; the new formats raise at config-load with a precise reason. Mirrors v0.27.0 MII / v0.37.0 multipack stub-then-live pattern. - GPTQ / AWQ + ZeRO-3 left unblocked — LlamaFactory's matrix permits these; matrix entries scoped to formats with documented hard-incompatibilities (HQQ/EETQ/AQLM).