메뉴
HN
Hacker News 30일 전

LLM 초저비트 양자화 툴킷 AutoRound

IMP
8/10
핵심 요약

대규모 언어 모델(LLM) 및 비전 언어 모델(VLM)을 위한 고급 양자화 툴킷인 AutoRound가 소개되었습니다. 이 도구는 부호 기반 경사 하강법(Sign-gradient descent)을 활용하여 2~4비트의 초저비트 환경에서도 높은 정확도를 유지하며 빠르고 저렴하게 모델을 최적화할 수 있습니다. 또한 주요 인퍼런스 프레임워크인 vLLM, SGLang, Transformers 등과 원활하게 통합되어 활용성이 매우 뛰어납니다.

번역된 본문

사용자 가이드 | 🚀 AutoRound란 무엇인가요? AutoRound는 대규모 언어 모델(LLM) 및 비전 언어 모델(VLM)을 위해 설계된 고급 양자화 툴킷입니다. 부호-경사 하강법(Sign-gradient descent)을 활용하고 폭넓은 하드웨어 호환성을 제공하여, 최소한의 튜닝만으로 초저비트(2~4비트) 환경에서도 높은 정확도를 달성합니다. 자세한 내용은 SignRoundV1 및 SignRoundV2 논문을 참조하세요. 사용 방법에 대한 지침은 사용자 가이드를 참조하십시오.

🆕 새로운 소식 [2026/03] 블록 단위 FP8 양자화가 --scheme FP8_BLOCK --iters 0 --disable_opt_rtn 명령어를 통해 사용 가능합니다. [2026/03] 해당 PR을 통해 MTP 레이어 양자화가 지원되었습니다. [2025/12] SignRoundV2 논문이 공개되었습니다. enable_alg_ext를 활성화하고 혼합 정밀도 양자화를 위해 AutoScheme API를 사용하여 결과를 재현해 보세요: 논문, LLaMA 모델 평가 노트. [2025/11] AutoRound가 LLM-Compressor에 통합되었습니다: 사용법, vLLM 블로그, RedHat 블로그, X 포스트, Intel 블로그, LinkedIn, 위챗, 즈후. [2025/11] --enable_alg_ext를 통해 향상된 GGUF 양자화 알고리즘을 사용할 수 있습니다: 정확도. [2025/10] AutoRound가 SGLang에 통합되었습니다: 사용법, LMSYS 블로그, X 포스트, Intel 블로그, LinkedIn. [2025/10] 몇 분 만에 방식(Scheme)을 생성하는 혼합 정밀도 알고리즘이 추가되었습니다: 사용법, 정확도. [2025/09] MXFP4 및 NVFP4 데이터 타입을 지원합니다: 정확도. [2025/08] --enable_alg_ext를 통해 개선된 INT2 알고리즘을 사용할 수 있습니다: 정확도. [2025/07] GGUF 포맷이 지원됩니다: 사용법. [2025/05] AutoRound가 vLLM에 통합되었습니다: 사용법, Medium 블로그, 샤오홍슈. [2025/05] AutoRound가 Transformers에 통합되었습니다: 블로그. [2025/03] INT2-혼합 DeepSeek-R1 모델(~200GB)이 97.9%의 정확도를 유지합니다: 모델.

✨ 주요 기능 ✅ 뛰어난 정확도: 23비트의 초저비트에서도 강력한 성능을 발휘하며(예시 모델), 4비트에서는 업계 최고 수준의 결과를 보여줍니다(벤치마크). ✅ 생태계 통합: Transformers, vLLM, SGLang 등과 원활하게 연동됩니다. ✅ 다중 포맷 내보내기 지원: 최대의 호환성을 위해 AutoRound, AutoAWQ, AutoGPTQ 및 GGUF 내보내기를 지원합니다. 자세한 내용은 내보내기 포맷에서 확인하세요. ✅ 빠른 혼합 비트/데이터타입 방식 생성: 오버헤드로 모델의 BF16 RAM 크기의 약 1.11.5배를 사용하여 몇 분 만에 자동으로 구성합니다. 정확도 결과 및 사용자 가이드. ✅ 최적화된 반올림(Round-to-Nearest) 모드: 빠른 양자화를 위해 --iters 0을 사용하며, 4비트의 경우 약간의 정확도 저하가 발생할 수 있습니다. 자세한 내용은 opt_rtn 모드에서 확인하세요. ✅ 저렴한 양자화 비용: 단일 GPU에서 약 10분 만에 7B 모델을 양자화할 수 있습니다. 자세한 내용은 양자화 비용에서 확인하세요. ✅ 10개 이상의 VLM 지원: 10개 이상의 비전 언어 모델에 대한 즉시 사용 가능한 양자화를 제공합니다(예시 모델, 지원 매트릭스). ✅ 다양한 레시피: 필요에 맞게 auto-round-best, auto-round, auto-round-light 중에서 선택할 수 있습니다. 자세한 내용은 양자화 레시피에서 확인하세요. ✅ 고급 유틸리티: 다중 GPU 양자화, 다중 캘리브레이션 데이터셋 및 10개 이상의 런타임 백엔드 지원이 포함됩니다. ✅ 가중치 전용 양자화 그 이상: MXFP, NVFP, W8A8 등과 같은 추가 데이터 타입에 대한 지원을 적극적으로 확장하고 있습니다.

설치 방법 PyPI에서 설치

CPU(Xeon)/GPU(CUDA)

pip install auto-round

CPU(Xeon)/GPU(CUDA) nightly 버전

pip install auto-round-nightly

HPU(Gaudi)

hpu 도커 컨테이너 내부에 설치 (예: vault.habana.ai/gaudi-docker/1.23.0/ubuntu24.04/habanalabs/pytorch-installer-2.9.0:latest)

pip install auto-round-hpu

XPU(Intel GPU)

pip install torch --index-url https://download.pytorch.org/whl/xpu pip install auto-round

소스에서 빌드

CPU(Xeon)/GPU(CUDA)

pip install .

HPU(Gaudi)

python setup.py install hpu

XPU(Intel GPU)

pip install torch --index-url https://download.pytorch.org/whl/xpu pip install .

모델 양자화 (CPU/Intel GPU/Gaudi/CUDA) 양자화 중에 문제가 발생하면 iters=0, disable_opt_rtn=True를 설정하여 순수 RTN 모드를 사용해 보십시오. 또한 더 나은 결과를 위해 group_size=32 또는 혼합 비트를 사용하는 것이 좋습니다.

CLI 사용법 터미널에서 auto-round -h를 호출하면 지원되는 전체 인수 목록이 제공됩니다. ModelScop

원문 보기
원문 보기 (영어)
Advanced Quantization Algorithm for LLMs English | 简体中文 User Guide | 用户指南 🚀 What is AutoRound? AutoRound is an advanced quantization toolkit designed for Large Language Models (LLMs) and Vision-Language Models (VLMs). It achieves high accuracy at ultra-low bit widths (2–4 bits) with minimal tuning by leveraging sign-gradient descent and providing broad hardware compatibility. See our papers SignRoundV1 and SignRoundV2 for more details. For usage instructions, please refer to the User Guide . 🆕 What's New [2026/03] Block-wise FP8 quantization is available via --scheme FP8_BLOCK --iters 0 --disable_opt_rtn . [2026/03] MTP layer quantization has been supported in this PR [2025/12] The SignRoundV2 paper is available. Turn on enable_alg_ext and use the AutoScheme API for mixed-precision quantization to reproduce the results: Paper , Notes for evaluating LLaMA models . [2025/11] AutoRound has landed in LLM-Compressor : Usage , vLLM blog , RedHat blog , X post , Intel blog , Linkedin , 微信 , 知乎 . [2025/11] An enhanced GGUF quantization algorithm is available via --enable_alg_ext : Accuracy . [2025/10] AutoRound has been integrated into SGLang : Usage , LMSYS Blog , X post , Intel blog , Linkedin . [2025/10] A mixed precision algorithm is available to generate schemes in minutes: Usage , Accuracy . [2025/09] MXFP4 and NVFP4 dtypes is available: Accuracy . [2025/08] An improved INT2 algorithm is available via --enable_alg_ext : Accuracy [2025/07] GGUF format is supported: Usage . [2025/05] AutoRound has been integrated into vLLM : Usage , Medium blog , 小红书 . [2025/05] AutoRound has been integrated into Transformers : Blog . [2025/03] The INT2-mixed DeepSeek-R1 model (~200GB) retains 97.9% accuracy: Model . ✨ Key Features ✅ Superior Accuracy Delivers strong performance even at 2–3 bits example models , with leading results at 4 bits benchmark . ✅ Ecosystem Integration Seamlessly works with Transformers, vLLM, SGLang and more. ✅ Multiple Formats Export Support AutoRound, AutoAWQ, AutoGPTQ, and GGUF for maximum compatibility. Details are shown in export formats ✅ Fast Mixed Bits/Dtypes Scheme Generation Automatically configure in minutes, with about 1.1X-1.5X the model’s BF16 RAM size as overhead. Accuracy results and user guide . ✅ Optimized Round-to-Nearest Mode Use --iters 0 for fast quantization with some accuracy drop for 4 bits. Details are shown in opt_rtn mode ✅ Affordable Quantization Cost Quantize 7B models in about 10 minutes on a single GPU. Details are shown in quantization costs ✅ 10+ VLMs Support Out-of-the-box quantization for 10+ vision-language models example models , support matrix ✅ Multiple Recipes Choose from auto-round-best , auto-round , and auto-round-light to suit your needs. Details are shown in quantization recipes ✅ Advanced Utilities Includes multiple gpus quantization , multiple calibration datasets and support for 10+ runtime backends . ✅ Beyond weight only quantization. We are actively expanding support for additional datatypes such as MXFP , NVFP, W8A8, and more. Installation Install from pypi # CPU(Xeon)/GPU(CUDA) pip install auto-round # CPU(Xeon)/GPU(CUDA) nightly pip install auto-round-nightly # HPU(Gaudi) # install inside the hpu docker container, e.g. vault.habana.ai/gaudi-docker/1.23.0/ubuntu24.04/habanalabs/pytorch-installer-2.9.0:latest pip install auto-round-hpu # XPU(Intel GPU) pip install torch --index-url https://download.pytorch.org/whl/xpu pip install auto-round Build from Source # CPU(Xeon)/GPU(CUDA) pip install . # HPU(Gaudi) python setup.py install hpu # XPU(Intel GPU) pip install torch --index-url https://download.pytorch.org/whl/xpu pip install . Model Quantization (CPU/Intel GPU/Gaudi/CUDA) If you encounter issues during quantization, try using pure RTN mode with iters=0, disable_opt_rtn=True. Additionally, using group_size=32 or mixed bits is recommended for better results. CLI Usage The full list of supported arguments is provided by calling auto-round -h on the terminal. ModelScope is supported for model downloads, simply set AR_USE_MODELSCOPE=1 . auto-round \ --model Qwen/Qwen3-0.6B \ --scheme " W4A16 " \ --format " auto_round " \ --output_dir ./tmp_autoround We offer another two recipes, auto-round-best and auto-round-light , designed for optimal accuracy and improved speed, respectively. Details are as follows. Other Recipes # Best accuracy, 3X slower, low_gpu_mem_usage could save ~20G but ~30% slower auto-round-best \ --model Qwen/Qwen3-0.6B \ --scheme " W4A16 " \ --low_gpu_mem_usage # 2-3X speedup, slight accuracy drop at W4 and larger accuracy drop at W2 auto-round-light \ --model Qwen/Qwen3-0.6B \ --scheme " W4A16 " In conclusion, we recommend using auto-round for W4A16 and auto-round-best with enable_alg_ext for W2A16 . However, you may adjust the configuration to suit your specific requirements and available resources. API Usage from auto_round import AutoRound # Load a model (supports FP8/BF16/FP16/FP32) model_name_or_path = "Qwen/Qwen3-0.6B" # Available schemes: "W2A16", "W3A16", "W4A16", "W8A16", "NVFP4", "MXFP4" (no real kernels), "GGUF:Q4_K_M", etc. ar = AutoRound ( model_name_or_path , scheme = "W4A16" ) # Highest accuracy (4–5× slower). # `low_gpu_mem_usage=True` saves ~20GB VRAM but runs ~30% slower. # ar = AutoRound(model_name_or_path, nsamples=512, iters=1000, low_gpu_mem_usage=True) # Faster quantization (2–3× speedup) with slight accuracy drop at W4G128. # ar = AutoRound(model_name_or_path, nsamples=128, iters=50, lr=5e-3) # Supported formats: "auto_round" (default), "auto_gptq", "auto_awq", "llm_compressor", "gguf:q4_k_m", etc. ar . quantize_and_save ( output_dir = "./qmodel" , format = "auto_round" ) Important Hyperparameters Quantization Scheme & Configuration scheme (str|dict|AutoScheme) : The predefined quantization keys, e.g. W4A16 , MXFP4 , NVFP4 , GGUF:Q4_K_M . For MXFP4/NVFP4, we recommend exporting to LLM-Compressor format. bits (int) : Number of bits for quantization (default is None ). If not None, it will override the scheme setting. group_size (int) : Size of the quantization group (default is None ). If not None, it will override the scheme setting. sym (bool) : Whether to use symmetric quantization (default is None ). If not None, it will override the scheme setting. layer_config (dict) : Configuration for layer_wise scheme (default is None ), mainly for customized mixed schemes. Algorithm Settings enable_alg_ext (bool) : [Experimental Feature] Only for iters>0 . Enable algorithm variants for specific schemes (e.g., MXFP4/W2A16) that could bring notable improvements. Default is False . disable_opt_rtn (bool|None) : Use pure RTN mode for specific schemes (e.g., GGUF and WOQ). Default is None . If None, it defaults to False in most cases to improve accuracy, but may be set to True due to known issues. Tuning Process Parameters iters (int) : Number of tuning iterations (default is 200 ). Common values: 0 (RTN mode), 50 (with lr=5e-3 recommended), 1000. Higher values increase accuracy but slow down tuning. lr (float) : The learning rate for rounding value (default is None ). When None, it will be set to 1.0/iters automatically. batch_size (int) : Batch size for training (default is 8 ). 4 is also commonly used. enable_deterministic_algorithms (bool) : Whether to enable deterministic algorithms for reproducibility (default is False ). Calibration Dataset dataset (str|list|tuple|torch.utils.data.DataLoader) : The dataset for tuning (default is "NeelNanda/pile-10k" ). Supports local JSON files and dataset combinations, e.g. "./tmp.json,NeelNanda/pile-10k:train,mbpp:train+validation+test" . nsamples (int) : Number of samples for tuning (default is 128 ). seqlen (int) : Data length of the sequence for tuning (default is 2048 ). Device/Speed Configuration enable_torch_compile (bool) : If no exception is raised, typically we recommend setting it to True for faster quantization with lower resource. low_gpu_mem_usage (bool) : Whether to offload intermediate features to CPU at th