Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Commit cf5d331

Browse files
committed
add version control
1 parent 3ac2c1e commit cf5d331

File tree

2 files changed

+39
-26
lines changed

2 files changed

+39
-26
lines changed

setup.py

+38-26
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def fetch_requirements(path):
8484
raise RuntimeError("Requires Pytorch 1.8 or newer.\n" +
8585
"The latest stable release can be obtained from https://pytorch.org/")
8686

87+
8788
cmdclass = {}
8889
ext_modules = []
8990

@@ -109,8 +110,8 @@ def cuda_ext_helper(name, sources, extra_cuda_flags):
109110
sources=[os.path.join('energonai/kernel/cuda_native/csrc', path) for path in sources],
110111
include_dirs=[
111112
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'
114115
],
115116
extra_compile_args={
116117
'cxx': ['-O3'] + version_dependent_macros,
@@ -149,29 +150,40 @@ def cuda_ext_helper(name, sources, extra_cuda_flags):
149150
# ['get_ncclid.cpp'],
150151
# extra_cuda_flags + cc_flag))
151152

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+
152164
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 {},
173185
# 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+
)

version.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1

0 commit comments

Comments
 (0)