|
3 | 3 | from pathlib import Path
|
4 | 4 | from setuptools import setup, find_packages
|
5 | 5 |
|
6 |
| -AUTOAWQ_VERSION = "0.2.7.post1" |
7 |
| -INSTALL_KERNELS = os.getenv("INSTALL_KERNELS", "0") == "1" |
8 |
| -IS_CPU_ONLY = not torch.backends.mps.is_available() and not torch.cuda.is_available() |
| 6 | +AUTOAWQ_VERSION = "0.2.7.post2" |
9 | 7 | TORCH_VERSION = str(os.getenv("TORCH_VERSION", None) or torch.__version__).split('+', maxsplit=1)[0]
|
10 | 8 |
|
11 |
| -CUDA_VERSION = os.getenv("CUDA_VERSION", None) or torch.version.cuda |
12 |
| -if CUDA_VERSION: |
13 |
| - CUDA_VERSION = "".join(CUDA_VERSION.split("."))[:3] |
14 |
| - |
15 | 9 | common_setup_kwargs = {
|
16 | 10 | "version": AUTOAWQ_VERSION,
|
17 | 11 | "name": "autoawq",
|
|
50 | 44 | "zstandard",
|
51 | 45 | ]
|
52 | 46 |
|
53 |
| -try: |
54 |
| - import awq_ext |
55 |
| - |
56 |
| - KERNELS_INSTALLED = True |
57 |
| -except ImportError: |
58 |
| - KERNELS_INSTALLED = False |
59 |
| - |
60 |
| -if not KERNELS_INSTALLED and CUDA_VERSION and INSTALL_KERNELS and CUDA_VERSION.startswith("12"): |
61 |
| - requirements.append("autoawq-kernels") |
62 |
| - |
63 |
| -elif IS_CPU_ONLY: |
64 |
| - requirements.append("intel-extension-for-pytorch>=2.4.0") |
65 |
| - |
66 | 47 | setup(
|
67 | 48 | packages=find_packages(),
|
68 | 49 | install_requires=requirements,
|
69 | 50 | extras_require={
|
70 | 51 | "eval": ["lm_eval==0.4.1", "tabulate", "protobuf", "evaluate", "scipy"],
|
71 | 52 | "dev": ["black", "mkdocstrings-python", "mkdocs-material", "griffe-typingdoc"],
|
| 53 | + "cpu": ["intel-extension-for-pytorch>=2.4.0"], |
| 54 | + "kernels": ["autoawq-kernels"], |
72 | 55 | },
|
73 | 56 | **common_setup_kwargs,
|
74 | 57 | )
|
0 commit comments