Skip to content

Commit 3323371

Browse files
remove the dependency on AutoGPTQ for CPU and bump to V0.4.3 (#380)
Signed-off-by: Sun, Xuehao <[email protected]> Co-authored-by: Wenhua Cheng <[email protected]>
1 parent 34fc38e commit 3323371

File tree

6 files changed

+19
-30
lines changed

6 files changed

+19
-30
lines changed

.azure-pipelines/template/ut-template.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ steps:
3535
- ${{ if eq(parameters.imageSource, 'build') }}:
3636
- script: |
3737
docker exec ${{ parameters.utContainerName }} bash -c "cd /auto-round \
38-
&& pip install -r requirements.txt \
39-
&& pip install -vvv --no-build-isolation .[cpu] \
38+
&& pip install -vvv --no-build-isolation . \
4039
&& pip list"
4140
displayName: "Env Setup"
4241
4342
- ${{ if eq(parameters.imageSource, 'pull') }}:
4443
- script: |
4544
docker exec ${{ parameters.utContainerName }} bash -c "cd /auto-round \
46-
&& pip install -vvv --no-build-isolation .[hpu] \
45+
&& pip install -vvv --no-build-isolation . \
4746
&& pip list"
4847
displayName: "HPU Env Setup"
4948

MANIFEST.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
include requirements.txt
1+
include requirements.txt
2+
include requirements-cpu.txt
3+
include requirements-hpu.txt

README.md

+2-18
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AutoRound
55
<h3> Advanced Quantization Algorithm for LLMs</h3>
66

77
[![python](https://img.shields.io/badge/python-3.9%2B-blue)](https://github.com/intel/auto-round)
8-
[![version](https://img.shields.io/badge/release-0.4.2-green)](https://github.com/intel/auto-round)
8+
[![version](https://img.shields.io/badge/release-0.4.3-green)](https://github.com/intel/auto-round)
99
[![license](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/intel/auto-round/blob/main/LICENSE)
1010
---
1111
<div align="left">
@@ -47,30 +47,14 @@ details and quantized models in several Hugging Face Spaces, e.g. [OPEA](https:/
4747
### Install from pypi
4848

4949
```bash
50-
# GPU
5150
pip install auto-round
52-
53-
# CPU
54-
pip install auto-round[cpu]
55-
56-
# HPU
57-
pip install auto-round[hpu]
5851
```
5952

6053
<details>
6154
<summary>Build from Source</summary>
6255

6356
```bash
64-
pip install -r requirements.txt
65-
66-
# GPU
67-
pip install -vvv --no-build-isolation -e .
68-
69-
# CPU
70-
pip install -vvv --no-build-isolation -e .[cpu]
71-
72-
# HPU
73-
pip install -vvv --no-build-isolation -e .[hpu]
57+
pip install -vvv --no-build-isolation .
7458
```
7559

7660
</details>

auto_round/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
"""Intel® auto-round: An open-source Python library
1515
supporting popular model weight only compression based on signround."""
1616

17-
__version__ = "0.4.2"
17+
__version__ = "0.4.3"

requirements-cpu.txt

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ threadpoolctl
99
lm-eval>=0.4.2,<0.5
1010
tqdm
1111
packaging
12-
auto-gptq>=0.7.1
1312
pillow
1413
numba
1514
tbb

setup.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
def is_cuda_available():
2727
try:
28+
os.system("pip install torch")
2829
import torch
2930

3031
return torch.cuda.is_available()
@@ -111,6 +112,15 @@ def detect_local_sm_architectures():
111112
return arch_list
112113

113114

115+
def detect_hardware():
116+
if is_hpu_available():
117+
return "requirements-hpu.txt"
118+
elif is_cuda_available():
119+
return "requirements.txt"
120+
else:
121+
return "requirements-cpu.txt"
122+
123+
114124
UNSUPPORTED_COMPUTE_CAPABILITIES = ['3.5', '3.7', '5.0', '5.2', '5.3']
115125

116126
if BUILD_CUDA_EXT:
@@ -219,11 +229,7 @@ def detect_local_sm_architectures():
219229
"auto_round_extension.*",
220230
],
221231
),
222-
"install_requires": fetch_requirements("requirements.txt"),
223-
"extras_require": {
224-
"hpu": fetch_requirements("requirements-hpu.txt"),
225-
"cpu": fetch_requirements("requirements-cpu.txt"),
226-
},
232+
"install_requires": fetch_requirements(detect_hardware()),
227233
}
228234

229235
if __name__ == "__main__":
@@ -248,7 +254,6 @@ def detect_local_sm_architectures():
248254
url="https://github.com/intel/auto-round",
249255
packages=include_packages,
250256
include_dirs=include_dirs,
251-
##include_package_data=False,
252257
install_requires=install_requires,
253258
extras_require=extras_require,
254259
python_requires=">=3.7.0",

0 commit comments

Comments
 (0)