-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
35 lines (27 loc) · 1.02 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
from setuptools import setup, find_packages
from torch.utils import cpp_extension
import subprocess, os, shutil
import pathlib
HERE = pathlib.Path(__file__).absolute().parent
def install_fast_hadamard():
# install fast hadamard transform
hadamard_dir = os.path.join(HERE, "third-party/fast-hadamard-transform")
pip = shutil.which("pip")
retcode = subprocess.call([pip, "install", "-v", "-e", hadamard_dir])
def parse_requirements(filename):
with open(filename, "r") as f:
return [line.strip() for line in f if line and not line.startswith("#")]
install_fast_hadamard()
requirements = parse_requirements("requirements.txt")
setup(
name="QQQ",
ext_modules=[
cpp_extension.CUDAExtension(
name="QQQ._CUDA",
sources=["csrc/pybind.cpp", "csrc/qqq_gemm.cu"],
),
],
cmdclass={"build_ext": cpp_extension.BuildExtension.with_options(use_ninja=False)},
packages=find_packages(exclude=["notebook", "scripts", "tests"]),
install_requires=requirements,
)