From c430017de3c2f0f90750d607b2e1b07074de0c33 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Wed, 11 Dec 2024 11:51:10 +0800 Subject: [PATCH 1/5] bump version to 0.4.3 and update installation instructions Signed-off-by: Sun, Xuehao --- README.md | 20 ++------------------ auto_round/version.py | 2 +- requirements-cpu.txt | 1 - setup.py | 18 +++++++++++++----- 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 039e4ef6..b0cec20d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ AutoRound

Advanced Quantization Algorithm for LLMs

[![python](https://img.shields.io/badge/python-3.9%2B-blue)](https://github.com/intel/auto-round) -[![version](https://img.shields.io/badge/release-0.4.2-green)](https://github.com/intel/auto-round) +[![version](https://img.shields.io/badge/release-0.4.3-green)](https://github.com/intel/auto-round) [![license](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/intel/auto-round/blob/main/LICENSE) ---
@@ -48,30 +48,14 @@ more accuracy data and recipes across various models. ### Install from pypi ```bash -# GPU pip install auto-round - -# CPU -pip install auto-round[cpu] - -# HPU -pip install auto-round[hpu] ```
Build from Source ```bash - pip install -r requirements.txt - - # GPU - pip install -vvv --no-build-isolation -e . - - # CPU - pip install -vvv --no-build-isolation -e .[cpu] - - # HPU - pip install -vvv --no-build-isolation -e .[hpu] + pip install -vvv --no-build-isolation . ```
diff --git a/auto_round/version.py b/auto_round/version.py index 3776cd59..80ebd5fd 100644 --- a/auto_round/version.py +++ b/auto_round/version.py @@ -14,4 +14,4 @@ """IntelĀ® auto-round: An open-source Python library supporting popular model weight only compression based on signround.""" -__version__ = "0.4.2" +__version__ = "0.4.3" diff --git a/requirements-cpu.txt b/requirements-cpu.txt index 4b575c6d..71228b64 100644 --- a/requirements-cpu.txt +++ b/requirements-cpu.txt @@ -9,7 +9,6 @@ threadpoolctl lm-eval>=0.4.2,<0.5 tqdm packaging -auto-gptq>=0.7.1 pillow numba tbb diff --git a/setup.py b/setup.py index 8c5649ba..3d5c25f3 100644 --- a/setup.py +++ b/setup.py @@ -111,6 +111,19 @@ def detect_local_sm_architectures(): return arch_list +def detect_hardware(): + try: + os.system("pip install torch") + except: + print("Failed to install torch") + if is_hpu_available(): + return "requirements-hpu.txt" + elif is_cuda_available(): + return "requirements.txt" + else: + return "requirements-cpu.txt" + + UNSUPPORTED_COMPUTE_CAPABILITIES = ['3.5', '3.7', '5.0', '5.2', '5.3'] if BUILD_CUDA_EXT: @@ -220,10 +233,6 @@ def detect_local_sm_architectures(): ], ), "install_requires": fetch_requirements("requirements.txt"), - "extras_require": { - "hpu": fetch_requirements("requirements-hpu.txt"), - "cpu": fetch_requirements("requirements-cpu.txt"), - }, } if __name__ == "__main__": @@ -248,7 +257,6 @@ def detect_local_sm_architectures(): url="https://github.com/intel/auto-round", packages=include_packages, include_dirs=include_dirs, - ##include_package_data=False, install_requires=install_requires, extras_require=extras_require, python_requires=">=3.7.0", From db4a17568f7793b4ff1eb5eb6083d7f4eb6267ad Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Wed, 11 Dec 2024 11:52:36 +0800 Subject: [PATCH 2/5] auto detect hardware Signed-off-by: Sun, Xuehao --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3d5c25f3..9649255f 100644 --- a/setup.py +++ b/setup.py @@ -232,7 +232,7 @@ def detect_hardware(): "auto_round_extension.*", ], ), - "install_requires": fetch_requirements("requirements.txt"), + "install_requires": fetch_requirements(detect_hardware()), } if __name__ == "__main__": From afdef1793bafd81890da5d9318f300119788d350 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Wed, 11 Dec 2024 12:20:50 +0800 Subject: [PATCH 3/5] move pip install Signed-off-by: Sun, Xuehao --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 9649255f..98582dbf 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ def is_cuda_available(): try: + os.system("pip install torch") import torch return torch.cuda.is_available() @@ -112,10 +113,6 @@ def detect_local_sm_architectures(): def detect_hardware(): - try: - os.system("pip install torch") - except: - print("Failed to install torch") if is_hpu_available(): return "requirements-hpu.txt" elif is_cuda_available(): From 92533e5975c30d2a810ef79280e35514cc50d029 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Wed, 11 Dec 2024 13:34:05 +0800 Subject: [PATCH 4/5] fix ut Signed-off-by: Sun, Xuehao --- .azure-pipelines/template/ut-template.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/template/ut-template.yml b/.azure-pipelines/template/ut-template.yml index f8021b62..e2c8c949 100644 --- a/.azure-pipelines/template/ut-template.yml +++ b/.azure-pipelines/template/ut-template.yml @@ -35,15 +35,14 @@ steps: - ${{ if eq(parameters.imageSource, 'build') }}: - script: | docker exec ${{ parameters.utContainerName }} bash -c "cd /auto-round \ - && pip install -r requirements.txt \ - && pip install -vvv --no-build-isolation .[cpu] \ + && pip install -vvv --no-build-isolation . \ && pip list" displayName: "Env Setup" - ${{ if eq(parameters.imageSource, 'pull') }}: - script: | docker exec ${{ parameters.utContainerName }} bash -c "cd /auto-round \ - && pip install -vvv --no-build-isolation .[hpu] \ + && pip install -vvv --no-build-isolation . \ && pip list" displayName: "HPU Env Setup" From 7ae6e322c54bf22e362bfb6eb15d043bf62fbeb0 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Thu, 12 Dec 2024 15:25:54 +0800 Subject: [PATCH 5/5] update MANIFEST.in Signed-off-by: Sun, Xuehao --- MANIFEST.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 540b7204..d2abcd5f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,3 @@ -include requirements.txt \ No newline at end of file +include requirements.txt +include requirements-cpu.txt +include requirements-hpu.txt