-
Notifications
You must be signed in to change notification settings - Fork 72
/
setup.py
executable file
·73 lines (60 loc) · 1.68 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Written by Dr. Hicham Badri @Mobius Labs GmbH - 2023
#####################################################
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
from setuptools.command.egg_info import egg_info
import os
def install_cuda_cmd() -> str:
cmd = "cd hqq/kernels; "
cmd += "python setup_cuda.py install; "
cmd += "cd ../..;"
return cmd
def run_setup_cuda():
print("Running setup_cuda.py...")
try:
os.system(install_cuda_cmd())
except Exception as e:
print("Error while running setup_cuda.py:", e)
class InstallCommand(install):
def run(self):
install.run(self)
run_setup_cuda()
class DevelopCommand(develop):
def run(self):
develop.run(self)
run_setup_cuda()
class EgginfoCommand(egg_info):
def run(self):
egg_info.run(self)
run_setup_cuda()
setup(
name="hqq",
version="0.2.3",
description="Half-Quadratic Quantization (HQQ)",
url="https://github.com/mobiusml/hqq/",
author="Dr. Hicham Badri",
author_email="hicham@mobiuslabs.com",
license="Apache 2",
packages=find_packages(include=["hqq", "hqq.*"]),
package_data={
"hqq": ["kernels/*.cpp", "kernels/*.cu"],
},
include_package_data=True,
cmdclass={
"install": InstallCommand,
"develop": DevelopCommand,
"egg_info": EgginfoCommand,
},
install_requires=[
"numpy>=1.24.4",
"tqdm>=4.64.1",
"einops",
"accelerate",
"transformers>=4.36.1",
"huggingface_hub",
"termcolor",
#"bitblas",
#"timm",
],
)