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
OpenDAS
MMCV
Commits
73a8c74e
Commit
73a8c74e
authored
May 06, 2023
by
xiabo
Browse files
适配版本号+hip readme_hip.md
parent
06efa79d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
3 deletions
+48
-3
README_HIP.md
README_HIP.md
+40
-0
mmcv/version.py
mmcv/version.py
+1
-1
setup.py
setup.py
+7
-2
No files found.
README_HIP.md
0 → 100644
View file @
73a8c74e
# MMCV
## 安装
### mmcv支持
+
python3.7
+
python3.8
+
python3.9
### 使用pip安装
fastfold whl包下载目录:
[
https://cancon.hpccube.com:65024/4/main/mmcv/dtk23.04
](
https://cancon.hpccube.com:65024/4/main/mmcv/dtk23.04
)
选择对应的pytorch版本和python版本下载对应mmcv的whl包
```
shell
pip
install
mmcv
*
(
下载的mmcv的whl包
)
```
### 使用源码安装
#### 编译环境准备
pytorch whl包下载目录:
[
https://cancon.hpccube.com:65024/4/main/pytorch/dtk23.04
](
https://cancon.hpccube.com:65024/4/main/pytorch/dtk23.04
)
根据python版本,下载对应pytorch的whl包
```
shell
pip
install
torch
*
(
下载的torch的whl包
)
```
```
shell
pip
install
setuptools
=
59.5.0 wheel
```
#### 编译安装
```
shell
git clone
-b
dtk-23.04_v1.6.1 https://developer.hpccube.com/codes/aicomponent/mmcv
cd
mmcv
export
MMCV_BUILD_VERSION
=
abix.dtkxxx
MMCV_WITH_OPS
=
1
ROCM_HOME
=
${
ROCM_PATH
}
python3 setup.py
-v
bdist_wheel
pip
install
dist/mmcv
*
```
## Note
+
若使用 pip install 下载安装过慢,可添加源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+
MMCV_BUILD_VERSION为编译的版本号设置,版本号为1.6.1+gitxxx.abix.dtkxxx gitxxx:为代码自动获取;abi0:使用devtools的gcc编译;abi1:使用非devtools的gcc编译; dtkxxx为dtk的版本号:例:dtk2304
+
ROCM_PATH为dtk的路径,默认为/opt/dtkxxx
\ No newline at end of file
mmcv/version.py
View file @
73a8c74e
...
@@ -30,6 +30,6 @@ def parse_version_info(version_str: str, length: int = 4) -> tuple:
...
@@ -30,6 +30,6 @@ def parse_version_info(version_str: str, length: int = 4) -> tuple:
return
tuple
(
release
)
return
tuple
(
release
)
version_info
=
tuple
(
int
(
x
)
for
x
in
__version__
.
split
(
'.'
)[:
3
])
version_info
=
tuple
(
int
(
x
)
for
x
in
__version__
.
split
(
"+"
)[
0
].
split
(
'.'
)[:
3
])
__all__
=
[
'__version__'
,
'version_info'
,
'parse_version_info'
]
__all__
=
[
'__version__'
,
'version_info'
,
'parse_version_info'
]
setup.py
View file @
73a8c74e
...
@@ -46,6 +46,7 @@ def get_sha(pytorch_root: Union[str, Path]) -> str:
...
@@ -46,6 +46,7 @@ def get_sha(pytorch_root: Union[str, Path]) -> str:
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
version
=
''
mmcv_root
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
mmcv_root
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
add_version_path
=
os
.
path
.
join
(
os
.
path
.
join
(
mmcv_root
,
"mmcv"
),
"version.py"
)
add_version_path
=
os
.
path
.
join
(
os
.
path
.
join
(
mmcv_root
,
"mmcv"
),
"version.py"
)
if
sha
!=
'Unknown'
:
if
sha
!=
'Unknown'
:
...
@@ -57,8 +58,12 @@ def get_version_add(sha: Optional[str] = None) -> str:
...
@@ -57,8 +58,12 @@ def get_version_add(sha: Optional[str] = None) -> str:
version_dtk
=
os
.
getenv
(
'MMCV_BUILD_VERSION'
,
""
)
version_dtk
=
os
.
getenv
(
'MMCV_BUILD_VERSION'
,
""
)
version
+=
"."
+
version_dtk
version
+=
"."
+
version_dtk
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"a"
)
as
file
:
lines
=
[]
file
.
write
(
"__version__=__version__+'+{}'
\n
"
.
format
(
version
))
with
open
(
add_version_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
lines
=
file
.
readlines
()
lines
[
1
]
=
"__version__='1.6.1+{}'
\n
"
.
format
(
version
)
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
file
.
writelines
(
lines
)
file
.
close
()
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