diff --git a/setup.py b/setup.py index ea1fbc0..5160cc4 100644 --- a/setup.py +++ b/setup.py @@ -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 = [] @@ -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, @@ -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', ], + }, +) diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..8a9ecc2 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file