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

Commit

Permalink
[setup] add version control
Browse files Browse the repository at this point in the history
  • Loading branch information
feifeibear authored Sep 13, 2022
2 parents 3ac2c1e + cf5d331 commit aeb486b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 26 deletions.
64 changes: 38 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def fetch_requirements(path):
raise RuntimeError("Requires Pytorch 1.8 or newer.\n" +
"The latest stable release can be obtained from https://pytorch.org/")


cmdclass = {}
ext_modules = []

Expand All @@ -109,8 +110,8 @@ def cuda_ext_helper(name, sources, extra_cuda_flags):
sources=[os.path.join('energonai/kernel/cuda_native/csrc', path) for path in sources],
include_dirs=[
os.path.join(this_dir, 'energonai/kernel/cuda_native/csrc'),
# '/opt/lcsoftware/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/nccl-2.9.6-1'
# '-ysovaavjkgjez2fwms4dkvatu5yrxbec/include'
# '/opt/lcsoftware/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/nccl-2.9.6-1'
# '-ysovaavjkgjez2fwms4dkvatu5yrxbec/include'
],
extra_compile_args={
'cxx': ['-O3'] + version_dependent_macros,
Expand Down Expand Up @@ -149,29 +150,40 @@ def cuda_ext_helper(name, sources, extra_cuda_flags):
# ['get_ncclid.cpp'],
# extra_cuda_flags + cc_flag))


def get_version():
with open('version.txt') as f:
version = f.read().strip()
if build_cuda_ext:
torch_version = '.'.join(torch.__version__.split('.')[:2])
cuda_version = '.'.join(get_cuda_bare_metal_version(CUDA_HOME)[1:])
version += f'+torch{torch_version}cu{cuda_version}'
return version


setup(
name='energonai',
version='0.0.1b0',
packages=find_packages(
exclude=(
'benchmark',
'docker',
'tests',
'docs',
'examples',
'tests',
'scripts',
'requirements',
'*.egg-info',
'dist',
'build',
)),
description='Large-scale Model Inference',
license='Apache Software License 2.0',
ext_modules=ext_modules,
cmdclass={'build_ext': BuildExtension} if ext_modules else {},
name='energonai',
version=get_version(),
packages=find_packages(
exclude=(
'benchmark',
'docker',
'tests',
'docs',
'examples',
'tests',
'scripts',
'requirements',
'*.egg-info',
'dist',
'build',
)),
description='Large-scale Model Inference',
license='Apache Software License 2.0',
ext_modules=ext_modules,
cmdclass={'build_ext': BuildExtension} if ext_modules else {},
# install_requires=fetch_requirements('requirements.txt'),
entry_points={
'console_scripts': ['energonai=energonai.cli:typer_click_object',],
},
)
entry_points={
'console_scripts': ['energonai=energonai.cli:typer_click_object', ],
},
)
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1

0 comments on commit aeb486b

Please sign in to comment.