forked from databricks/megablocks
-
Notifications
You must be signed in to change notification settings - Fork 55
/
setup.py
56 lines (49 loc) · 1.5 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
from setuptools import setup, find_packages
import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
_dc = torch.cuda.get_device_capability()
_dc = f"{_dc[0]}{_dc[1]}"
ext_modules = [
CUDAExtension(
"megablocks_ops",
["csrc/ops.cu"],
include_dirs = ["csrc"],
extra_compile_args={
"cxx": ["-fopenmp"],
"nvcc": [
"--ptxas-options=-v",
"--optimize=2",
f"--generate-code=arch=compute_{_dc},code=sm_{_dc}"
]
})
]
install_requires=[
'stanford-stk @ git+https://github.com/stanford-futuredata/stk.git@main',
'grouped_gemm @ git+https://github.com/tgale96/grouped_gemm@main',
'mosaicml-turbo==0.0.4',
]
extra_deps = {}
extra_deps['dev'] = [
'absl-py',
]
extra_deps['all'] = set(dep for deps in extra_deps.values() for dep in deps)
setup(
name="megablocks",
version="0.4.0",
author="Trevor Gale",
author_email="[email protected]",
description="MegaBlocks",
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url="https://github.com/stanford-futuredata/megablocks",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: Unix",
],
packages=find_packages(),
ext_modules=ext_modules,
cmdclass={"build_ext": BuildExtension},
install_requires=install_requires,
extras_require=extra_deps,
)