Rotation redistributes outliers in weights and activations to make them more uniform, which is highly effective for aggressive low-bit schemes like MXFP4, NVFP4, or W4A4.
Warning: This is an experimental feature. Inference relies on forward hooks and currently only supports the Hugging Face Transformers backend, which may result in slower inference speeds compared to non-rotated models.
To use rotation, pass a rotation_config to the AutoRound constructor. The recommended preset is "quarot" (deterministic Hadamard rotation), which requires no training or calibration data.
Quantized models with rotation can be saved and loaded transparently; rotation matrices and hooks are automatically restored during loading.
from auto_round import AutoRound
model_name = "Qwen/Qwen3-0.6B"
# QuaRot preset: Deterministic Hadamard, no training required
ar = AutoRound(model_name, scheme="MXFP4", rotation_config="quarot")
ar.quantize_and_save(output_dir="./Qwen3-0.6B-mxfp4-quarot", format="auto_round")