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
c0ccf15e
Commit
c0ccf15e
authored
Mar 19, 2024
by
xiabo
Browse files
Adapt to dtk24.04
parent
fb7d8f3c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
15 deletions
+17
-15
README.md
README.md
+14
-13
mmcv/ops/csrc/common/cuda/carafe_cuda_kernel.cuh
mmcv/ops/csrc/common/cuda/carafe_cuda_kernel.cuh
+2
-1
mmcv/ops/csrc/common/pytorch_cuda_helper.hpp
mmcv/ops/csrc/common/pytorch_cuda_helper.hpp
+1
-1
No files found.
README.md
View file @
c0ccf15e
# <div align="center"><strong>MMCV</strong></div>
# <div align="center"><strong>MMCV</strong></div>
## 简介
## 简介
MMCV是计算机视觉研究的基础库,主要提供以下功能:图像处理、图像和标注结果可视化、图像转换、多种CNN网络结构、高质量实现的常见CUDA算子。
MMCV官方github地址:
[
https://github.com/open-mmlab/mmcv
](
https://github.com/open-mmlab/mmcv
)
MMCV是计算机视觉研究的基础库,主要提供以下功能:图像处理、图像和标注结果可视化、图像转换、多种CNN网络结构、高质量实现的常见CUDA算子。
## 安装
## 安装
组件支持
+
Python 3.7、3.8、3.9
### 使用pip方式安装
###
1、
使用pip方式安装
mmcv whl包下载目录:
[
https://cancon.hpccube.com:65024/4/main/mmcv/dtk2
3.10
](
https://cancon.hpccube.com:65024/4/main/mmcv/dtk2
3.10
)
,选择对应的pytorch版本和python版本下载对应mmcv的whl包
mmcv whl包下载目录:
[
https://cancon.hpccube.com:65024/4/main/mmcv/dtk2
4.04
](
https://cancon.hpccube.com:65024/4/main/mmcv/dtk2
4.04
)
,选择对应的pytorch版本和python版本下载对应mmcv的whl包
```
shell
```
shell
pip
install
mmcv
*
(
下载的mmcv的whl包
)
pip
install
mmcv
*
(
下载的mmcv的whl包
)
```
```
### 使用源码编译方式安装
###
2、
使用源码编译方式安装
#### 编译环境准备
#### 编译环境准备
提供2种环境准备方式:
提供2种环境准备方式:
1.
基于光源pytorch基础镜像环境:镜像下载地址:
[
https://sourcefind.cn/#/image/dcu/pytorch
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据pytorch、python、dtk及系统下载对应的镜像版本。
1.
基于光源pytorch基础镜像环境:镜像下载地址:
[
https://sourcefind.cn/#/image/dcu/pytorch
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据pytorch、python、dtk及系统下载对应的镜像版本。
2.
基于现有python环境:安装pytorch,pytorch whl包下载目录:
[
https://cancon.hpccube.com:65024/4/main/pytorch/dtk2
3.10
](
https://cancon.hpccube.com:65024/4/main/pytorch/dtk2
3.10
)
,根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
2.
基于现有python环境:安装pytorch,pytorch whl包下载目录:
[
https://cancon.hpccube.com:65024/4/main/pytorch/dtk2
4.04
](
https://cancon.hpccube.com:65024/4/main/pytorch/dtk2
4.04
)
,根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
```
shell
```
shell
pip
install
torch
*
(
下载的torch的whl包
)
pip
install
torch
*
(
下载的torch的whl包
)
pip
install
setuptools
==
59.5.0 wheel
```
```
#### 源码编译安装
#### 源码编译安装
-
代码下载
-
代码下载
```
shell
```
shell
git
clone
http
s
://developer.hpccube.com/codes/
aicomponent/mmcv
# 根据编译需要切换分支
git http://developer.hpccube.com/codes/
OpenDAS/mmcv.git
# 根据编译需要切换分支
```
```
-
提供2种源码编译方式(进入mmcv目录):
-
提供2种源码编译方式(进入mmcv目录):
```
```
...
@@ -36,17 +37,17 @@ pip install dist/mmcv*
...
@@ -36,17 +37,17 @@ pip install dist/mmcv*
2. 源码编译安装
2. 源码编译安装
MMCV_WITH_OPS=1 ROCM_HOME=${ROCM_PATH} python3 setup.py install
MMCV_WITH_OPS=1 ROCM_HOME=${ROCM_PATH} python3 setup.py install
```
```
#### 注意事项
+
若使用pip install下载安装过慢,可添加pypi清华源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+
ROCM_PATH为dtk的路径,默认为/opt/dtk
##
版本号查询
##
验证
-
python -c "import mmcv; mmcv.
\_\_
version__",版本号与官方版本同步,查询该软件的版本号,例如2.0.0;
-
python -c "import mmcv; mmcv.
\_\_
version__",版本号与官方版本同步,查询该软件的版本号,例如2.0.0;
## Known Issue
## Known Issue
-
无
-
无
## Note
## 参考资料
+
若使用pip install下载安装过慢,可添加pypi清华源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+
ROCM_PATH为dtk的路径,默认为/opt/dtk
## 其他参考
-
[
README_ORIGIN
](
README_ORIGIN.md
)
-
[
README_ORIGIN
](
README_ORIGIN.md
)
-
[
README_zh-CN
](
README_zh-CN.md
)
-
[
README_zh-CN
](
README_zh-CN.md
)
-
[
https://github.com/open-mmlab/mmcv
](
https://github.com/open-mmlab/mmcv
)
mmcv/ops/csrc/common/cuda/carafe_cuda_kernel.cuh
View file @
c0ccf15e
...
@@ -56,7 +56,8 @@ template <>
...
@@ -56,7 +56,8 @@ template <>
__device__
__forceinline__
phalf
warpReduceSum
(
phalf
val
)
{
__device__
__forceinline__
phalf
warpReduceSum
(
phalf
val
)
{
for
(
int
offset
=
WARP_SIZE
/
2
;
offset
>
0
;
offset
/=
2
)
for
(
int
offset
=
WARP_SIZE
/
2
;
offset
>
0
;
offset
/=
2
)
#ifdef MMCV_WITH_HIP
#ifdef MMCV_WITH_HIP
__PHALF
(
val
)
+=
__shfl_down
(
val
,
offset
);
// __PHALF(val) += __shfl_down(val, offset);
__PHALF
(
val
)
+=
WARP_SHFL_DOWN
(
val
,
offset
);
#else
#else
__PHALF
(
val
)
+=
__PHALF
(
val
)
+=
__shfl_down_sync
(
FULL_MASK
,
__PHALF
(
val
).
operator
__half
(),
offset
);
__shfl_down_sync
(
FULL_MASK
,
__PHALF
(
val
).
operator
__half
(),
offset
);
...
...
mmcv/ops/csrc/common/pytorch_cuda_helper.hpp
View file @
c0ccf15e
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#include <ATen/ATen.h>
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include <c10/cuda/CUDAGuard.h>
#include <ATen/cuda/DeviceUtils.cuh>
#include <ATen/cuda/CUDAApplyUtils.cuh>
#include <ATen/cuda/CUDAApplyUtils.cuh>
#include <THC/THCAtomics.cuh>
#include <THC/THCAtomics.cuh>
...
...
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