Commit 396acd66 authored by gaoqiong's avatar gaoqiong
Browse files

根据发版要求修改

parent d76eae82
......@@ -9,7 +9,7 @@ AutoAWQ_kernel是一个从AutoAWQ分离出来的一个组件,以减少编译
下载光源的镜像,起dcoker
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-centos7.6-dtk24.04-py310
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10
# <Image ID>用上面拉取docker镜像的ID替换
# <Host Path>主机端路径
......@@ -33,7 +33,9 @@ python3 setup.py bdist_wheel
cd dist && pip3 install autoawq*
```
## 参考资料
- [README](README.md)
- [https://github.com/casper-hansen/AutoAWQ_kernels](https://github.com/casper-hansen/AutoAWQ_kernels.git)
......
......@@ -7,6 +7,11 @@ from distutils.sysconfig import get_python_lib
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
from typing import Optional, Union
pwd = os.path.dirname(__file__)
add_git_version = False
if int(os.environ.get('ADD_GIT_VERSION', '0')) == 1:
add_git_version = True
os.environ["CC"] = "g++"
os.environ["CXX"] = "g++"
AUTOAWQ_KERNELS_VERSION = "0.0.6"
......@@ -33,16 +38,21 @@ def get_abi():
def get_version_add(sha: Optional[str] = None) -> str:
command = "git config --global --add safe.directory "+pwd
result = subprocess.run(command, shell=True, capture_output=False, text=True)
version=''
autoawq_root = os.path.dirname(os.path.abspath(__file__))
add_version_path = os.path.join(os.path.join(autoawq_root, ""), "version.py")
if sha != 'Unknown':
if sha is None:
sha = get_sha(autoawq_root)
version = 'git' + sha[:7]
if add_git_version:
if sha != 'Unknown':
if sha is None:
sha = get_sha(autoawq_root)
version = 'das.opt1.' + sha[:7]
else:
version = 'das.opt1'
# abi
version += "." + get_abi()
#version += "." + get_abi()
# dtk version
if os.getenv("ROCM_PATH"):
......@@ -61,7 +71,7 @@ def get_version_add(sha: Optional[str] = None) -> str:
with open(add_version_path, 'r',encoding='utf-8') as file:
lines = file.readlines()
lines[1] = "__dcu_version__ = '0.0.6+das1.1.{}'\n".format(version)
lines[1] = "__dcu_version__ = '0.0.6+{}'\n".format(version)
with open(add_version_path, encoding="utf-8",mode="w") as file:
file.writelines(lines)
file.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment