-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
48 lines (41 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
36
37
38
39
40
41
42
43
44
45
46
47
48
import torch
from setuptools import setup, Command
from torch.utils import cpp_extension
class TestCommand(Command):
description = "test"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import pytest
pytest.main([
'-nauto', '-x',
'--cov=naive_gpt',
'--tb=long', 'test/'
])
setup(
name='naive_gpt',
version='0.1.0',
packages=['naive_gpt'],
ext_modules=[
cpp_extension.CUDAExtension(
'naive_gpt.ext',
sources=[
'extension/entry.cpp',
'extension/softmax.cu',
'extension/cdist.cu',
'extension/lookup.cu',
'extension/sddmm.cpp',
'extension/spmm.cpp'
]
)
] if torch.cuda.is_available() else [],
cmdclass={
'test': TestCommand,
'build_ext': cpp_extension.BuildExtension,
},
install_requires=[
]
)