Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

update docs,fixtypos (#35)

WeiweiZhang1e4078c377903
diff --git a/README.md b/README.md
index 8967f0b11..a85eaff95 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,14 @@ AutoRound
AutoRound is an advanced weight-only quantization algorithm for low-bits LLM inference. It's tailored for a wide range of models and consistently delivers noticeable improvements, often significantly outperforming SignRound with the cost of more tuning time for quantization.
+our method adopts sign gradient descent to fine-tune rounding values and minmax values of weights in just 200 steps, which competes impressively against recent methods without introducing any additional inference overhead. The below image presents an overview of AutoRound.
+
+<div align="center">
+
+![](docs/autoround_overview.png)
+
+<div align="left">
+
## Prerequisites
- Python 3.9 or higher
diff --git a/examples/language-modeling/main.py b/examples/language-modeling/main.py
index 5e7b47a4f..833224f4d 100644
--- a/examples/language-modeling/main.py
+++ b/examples/language-modeling/main.py
@@ -114,11 +114,11 @@ if __name__ == '__main__':
res = get_library_version("lm-eval")
if res == "0.3.0":
use_eval_legacy = True
+
if not use_eval_legacy:
from eval import eval_model
else:
from eval_legacy import eval_model
-
if isinstance(tasks, str):
tasks = tasks.split(',')
if isinstance(tasks, list):
@@ -131,6 +131,12 @@ if __name__ == '__main__':
tasks = list(set(tasks))
if isinstance(args.tasks, str):
tasks = ','.join(tasks)
+
+ if 'fake' in args.deployment_device and not args.disable_eval:
+ if use_eval_legacy:
+ print("Using the legacy lm_eval(0.3.0)")
+ else:
+ print("Using the latest lm_eval(0.4.1)")
model_name = args.model_name
if model_name[-1] == "/":
@@ -251,3 +257,4 @@ if __name__ == '__main__':
device=torch_device, excel_file=excel_name)
+
diff --git a/examples/language-modeling/requirements.txt b/examples/language-modeling/requirements.txt
index 2497cbda5..9b0df5e0c 100644
--- a/examples/language-modeling/requirements.txt
+++ b/examples/language-modeling/requirements.txt
@@ -2,7 +2,7 @@ transformers
torch
git+https://github.com/EleutherAI/lm-evaluation-harness.git@96d185fa6232a5ab685ba7c43e45d1dbb3bb906d
# For the paper results use the old lm_eval (0.3.0)
-# git+https://github.com/EleutherAI/lm-evaluation-harness.git@008fc2a23245c40384f2312718433eeb1e0f87a9s
+# git+https://github.com/EleutherAI/lm-evaluation-harness.git@008fc2a23245c40384f2312718433eeb1e0f87a9
tiktoken
transformers_stream_generator
peft