@@ -84,6 +84,7 @@ def fetch_requirements(path):
84
84
raise RuntimeError ("Requires Pytorch 1.8 or newer.\n " +
85
85
"The latest stable release can be obtained from https://pytorch.org/" )
86
86
87
+
87
88
cmdclass = {}
88
89
ext_modules = []
89
90
@@ -109,8 +110,8 @@ def cuda_ext_helper(name, sources, extra_cuda_flags):
109
110
sources = [os .path .join ('energonai/kernel/cuda_native/csrc' , path ) for path in sources ],
110
111
include_dirs = [
111
112
os .path .join (this_dir , 'energonai/kernel/cuda_native/csrc' ),
112
- # '/opt/lcsoftware/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/nccl-2.9.6-1'
113
- # '-ysovaavjkgjez2fwms4dkvatu5yrxbec/include'
113
+ # '/opt/lcsoftware/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/nccl-2.9.6-1'
114
+ # '-ysovaavjkgjez2fwms4dkvatu5yrxbec/include'
114
115
],
115
116
extra_compile_args = {
116
117
'cxx' : ['-O3' ] + version_dependent_macros ,
@@ -149,29 +150,40 @@ def cuda_ext_helper(name, sources, extra_cuda_flags):
149
150
# ['get_ncclid.cpp'],
150
151
# extra_cuda_flags + cc_flag))
151
152
153
+
154
+ def get_version ():
155
+ with open ('version.txt' ) as f :
156
+ version = f .read ().strip ()
157
+ if build_cuda_ext :
158
+ torch_version = '.' .join (torch .__version__ .split ('.' )[:2 ])
159
+ cuda_version = '.' .join (get_cuda_bare_metal_version (CUDA_HOME )[1 :])
160
+ version += f'+torch{ torch_version } cu{ cuda_version } '
161
+ return version
162
+
163
+
152
164
setup (
153
- name = 'energonai' ,
154
- version = '0.0.1b0' ,
155
- packages = find_packages (
156
- exclude = (
157
- 'benchmark' ,
158
- 'docker' ,
159
- 'tests' ,
160
- 'docs' ,
161
- 'examples' ,
162
- 'tests' ,
163
- 'scripts' ,
164
- 'requirements' ,
165
- '*.egg-info' ,
166
- 'dist' ,
167
- 'build' ,
168
- )),
169
- description = 'Large-scale Model Inference' ,
170
- license = 'Apache Software License 2.0' ,
171
- ext_modules = ext_modules ,
172
- cmdclass = {'build_ext' : BuildExtension } if ext_modules else {},
165
+ name = 'energonai' ,
166
+ version = get_version () ,
167
+ packages = find_packages (
168
+ exclude = (
169
+ 'benchmark' ,
170
+ 'docker' ,
171
+ 'tests' ,
172
+ 'docs' ,
173
+ 'examples' ,
174
+ 'tests' ,
175
+ 'scripts' ,
176
+ 'requirements' ,
177
+ '*.egg-info' ,
178
+ 'dist' ,
179
+ 'build' ,
180
+ )),
181
+ description = 'Large-scale Model Inference' ,
182
+ license = 'Apache Software License 2.0' ,
183
+ ext_modules = ext_modules ,
184
+ cmdclass = {'build_ext' : BuildExtension } if ext_modules else {},
173
185
# install_requires=fetch_requirements('requirements.txt'),
174
- entry_points = {
175
- 'console_scripts' : ['energonai=energonai.cli:typer_click_object' ,],
176
- },
177
- )
186
+ entry_points = {
187
+ 'console_scripts' : ['energonai=energonai.cli:typer_click_object' , ],
188
+ },
189
+ )
0 commit comments