Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yujq2
AutoAWQ_kernels
Commits
396acd66
Commit
396acd66
authored
Aug 29, 2024
by
gaoqiong
Browse files
根据发版要求修改
parent
d76eae82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
README.md
README.md
+4
-2
setup.py
setup.py
+17
-7
No files found.
README.md
View file @
396acd66
...
...
@@ -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
)
...
...
setup.py
View file @
396acd66
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment