Skip to content

Commit c1a8169

Browse files
authored
Merge branch 'main' into zhenzhong/ark_ci
2 parents b9b5b0e + 5329bcd commit c1a8169

37 files changed

+1445
-316
lines changed

README.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,26 @@ See our [paper](https://arxiv.org/pdf/2309.05516) for more details. For usage in
3030

3131

3232
## 🆕 What's New
33-
[2025/11] AutoRound has now landed in **LLM-Compressor**! You can apply AutoRound algorithm using `AutoRoundModifier`. Check out the [example](https://github.com/vllm-project/llm-compressor/tree/main/examples/autoround/README.md) to get started!
3433

35-
[2025/11] AutoRound now offers preliminary support for an enhanced GGUF quantization algorithm via `--enable_alg_ext`. For detailed accuracy benchmarks, please refer to the [documentation](./docs/gguf_alg_ext_acc.md).
34+
* [2025/11] AutoRound has landed in **LLM-Compressor**: [*Usage*](https://github.com/vllm-project/llm-compressor/tree/main/examples/autoround/README.md).
3635

37-
[2025/10] AutoRound has been integrated into **SGLang**. You can now run models in the AutoRound format directly using the SGLang versions newer than v0.5.4.
36+
* [2025/11] An **enhanced GGUF** quantization algorithm is available via `--enable_alg_ext`: [*Accuracy*](./docs/gguf_alg_ext_acc.md).
3837

39-
[2025/10] We enhanced the RTN mode (--iters 0) to significantly reduce quantization cost compared to the default tuning mode. Check out [this doc](./docs/opt_rtn.md) for some accuracy results. If you don’t have sufficient resources, you can use this mode for 4-bit quantization.
38+
* [2025/10] AutoRound has been integrated into **SGLang**: [*Usage*](), [*LMSYS Blog*](https://lmsys.org/blog/2025-11-13-AutoRound/), [*X post*](https://x.com/lmsysorg/status/1991977019220148650?s=20), [*Linkedin*](https://www.linkedin.com/feed/update/urn:li:activity:7397742859354857472).
4039

41-
[2025/10] We proposed a fast algorithm to generate **mixed bits/datatypes** schemes in minutes. Please
42-
refer to the documentation for accuracy [results](./docs/auto_scheme_acc.md) and [this guide](https://github.com/intel/auto-round/blob/main/docs/step_by_step.md#autoscheme) for usage instructions.
40+
* [2025/10] A **mix precision** algorithm is available to generate schemes in minutes: [*Usage*](https://github.com/intel/auto-round/blob/main/docs/step_by_step.md#autoscheme), [*Accuracy*](./docs/auto_scheme_acc.md).
4341

44-
[2025/09] AutoRound now includes experimental support for the **mxfp4 and nvfp4 dtypes**. For accuracy results, see the [documentation](./docs/mxnv_acc.md)
45-
. We currently recommend exporting to the LLM-Compressor format.
42+
* [2025/09] **MXFP4** and **NVFP4** dtypes is available: [*Accuracy*](./docs/mxnv_acc.md).
4643

47-
[2025/08] AutoRound now provides experimental support for **an improved INT2 algorithm** via `--enable_alg_ext`. See this [documentation](./docs/alg_202508.md)
48-
for some accuracy results.
44+
* [2025/08] An **improved INT2** algorithm is available via `--enable_alg_ext`: [*Accuracy*](./docs/alg_202508.md)
4945

50-
[2025/07] AutoRound now offers experimental support for **GGUF** format, and recommends using optimized RTN mode (--iters 0) for
51-
all bits other than 3 bits.
46+
* [2025/07] **GGUF** format is supported: [*Usage*](./docs/step_by_step.md#gguf-format).
5247

53-
[2025/05] AutoRound has been integrated into **Transformers** and **vLLM**.
48+
* [2025/05] AutoRound has been integrated into **vLLM**: [*Usage*](https://docs.vllm.ai/en/latest/features/quantization/auto_round/), [*Blog*](https://medium.com/@NeuralCompressor/accelerating-vllm-and-sglang-deployment-using-autoround-45fdc0b2683e).
5449

55-
[2025/03] The INT2-mixed **DeepSeek-R1** model (~200GB) retains 97.9% accuracy. Check
56-
out [OPEA/DeepSeek-R1-int2-mixed-sym-inc](https://huggingface.co/OPEA/DeepSeek-R1-int2-mixed-sym-inc).
50+
* [2025/05] AutoRound has been integrated into **Transformers**: [*Blog*](https://huggingface.co/blog/autoround).
51+
52+
* [2025/03] The INT2-mixed **DeepSeek-R1** model (~200GB) retains 97.9% accuracy: [*Model*]((https://huggingface.co/OPEA/DeepSeek-R1-int2-mixed-sym-inc)).
5753

5854

5955
## ✨ Key Features
@@ -319,14 +315,14 @@ for prompt, output in zip(prompts, outputs):
319315

320316
### Transformers (CPU/Intel GPU/Gaudi/CUDA)
321317

322-
323318
AutoRound supports 10+ backends and automatically selects the best available backend based on the installed libraries and prompts the user to
324319
install additional libraries when a better backend is found.
325320

326321
**Please avoid manually moving the quantized model to a different device** (e.g., model.to('cpu')) during inference, as
327322
this may cause unexpected exceptions.
328323

329324
The support for Gaudi device is limited.
325+
330326
```python
331327
from transformers import AutoModelForCausalLM, AutoTokenizer
332328

@@ -337,15 +333,12 @@ text = "There is a girl who likes adventure,"
337333
inputs = tokenizer(text, return_tensors="pt").to(model.device)
338334
print(tokenizer.decode(model.generate(**inputs, max_new_tokens=50)[0]))
339335
```
336+
340337
## Acknowledgement
341338
Special thanks to open-source low precision libraries such as AutoGPTQ, AutoAWQ, GPTQModel, Triton, Marlin, and ExLLaMAV2 for providing low-precision CUDA kernels, which are leveraged in AutoRound.
342339

340+
> **Note**:
341+
> For all publications/events, please view [Publication List](./docs/publication_list.md).
342+
343343
## 🌟 Support Us
344344
If you find AutoRound helpful, please ⭐ star the repo and share it with your community!
345-
346-
347-
348-
349-
350-
351-

auto_round/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def __init__(self, *args, **kwargs):
7878
help="The batch size for tuning/calibration."
7979
"Larger batch sizes may improve stability but require more memory.",
8080
)
81-
basic.add_argument("--avg_bits", default=None, type=float, help="for auto scheme, number of avg weight bits")
81+
basic.add_argument(
82+
"--avg_bits", "--target_bits", default=None, type=float, help="for auto scheme, number of avg weight bits"
83+
)
8284
basic.add_argument(
8385
"--options", default=None, type=str, help="for auto scheme, options for auto scheme, e.g. 'W4A16,W8A16'"
8486
)

auto_round/alg_ext.abi3.so

-16.1 KB
Binary file not shown.

auto_round/autoround.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class AutoRound:
4141
the quantization of LLMs." arXiv:2309.05516 (2023).
4242
4343
Attributes:
44-
model (torch.nn.Module): The loaded PyTorch model in eval mode.
44+
model (torch.nn.Module | str): The loaded PyTorch model in eval mode.
4545
tokenizer: Tokenizer used to prepare input text for calibration/tuning.
4646
platform (str): The platform to load pretrained moded, options: ["hf", "model_scope"]
4747
bits (int): Weight quantization bits.
@@ -85,6 +85,8 @@ def __new__(
8585
enable_adam: bool = False,
8686
# for MLLM and Diffusion
8787
extra_config: ExtraConfig = None,
88+
enable_alg_ext: bool = False,
89+
disable_opt_rtn: bool = False,
8890
low_cpu_mem_usage: bool = False,
8991
**kwargs,
9092
) -> BaseCompressor:

0 commit comments

Comments
 (0)