-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
添加rocm平台支持代码 #29342
添加rocm平台支持代码 #29342
Conversation
Thanks for your contribution! |
cmake/external/pybind11.cmake
Outdated
@@ -39,7 +39,7 @@ ExternalProject_Add( | |||
# to be modified without triggering incremental compilation, and the | |||
# third-party library version changes cannot be incorporated. | |||
# reference: https://cmake.org/cmake/help/latest/module/ExternalProject.html | |||
UPDATE_COMMAND "" | |||
# UPDATE_COMMAND "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这行代码可以删掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
cmake/hip.cmake
Outdated
|
||
set(HIP_HCC_FLAGS "${HIP_HCC_FLAGS} -fPIC -DPADDLE_WITH_HIP -std=c++11" ) | ||
#include_directories("${ROCM_PATH}/thrust") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要include的话,删掉?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
DEFINE_string(miopen_dir, "", | ||
"Specify path for loading libcudnn.so. For instance, " | ||
"/usr/local/cudnn/lib. If empty [default], dlopen " | ||
"will search cudnn from LD_LIBRARY_PATH"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string的内容需要修改下?应该不是libcudnn.so,也不是search cudnn。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
咦? 好的 我改一下
"Specify path for loading cuda library, such as libcublas, " | ||
"libcurand, libcusolver. For instance, /usr/local/cuda/lib64. " | ||
"If default, dlopen will search cuda from LD_LIBRARY_PATH"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同样不是cuda library, 也不是search cuda
DEFINE_string(rccl_dir, "", | ||
"Specify path for loading nccl library, such as libnccl.so. " | ||
"For instance, /usr/local/cuda/lib64. If default, " | ||
"dlopen will search cuda from LD_LIBRARY_PATH"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是nccl, 也不是/usr/local/cuda/lib64, 也不是search cuda
|
||
#define ROCBLAS_BLAS_ROUTINE_EACH_R4(__macro) \ | ||
__macro(rocblas_gemm_batched_ex); \ | ||
// __macro(rocblas_gemm_strided_batched_ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好能注释一下当前无法支持的原因,以便以后修复
__macro(rocblas_dgemm); \ | ||
__macro(rocblas_hgemm); \ | ||
__macro(rocblas_dgeam); \ | ||
/*__macro(rocblas_gemm_ex); */\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好能注释一下当前无法支持的原因,以便以后修复
__macro(hipModuleLoadData); \ | ||
__macro(hipModuleGetFunction); \ | ||
__macro(hipModuleUnload); \ | ||
/* __macro(hipOccupancyMaxActiveBlocksPerMultiprocessor);*/ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同样,注释一下当前无法支持的原因,以便以后修复
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好滴 这些目前在rocm3.5 上还木有对应的支持
@@ -0,0 +1,36 @@ | |||
/* Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的 我改一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phlrain 改好啦 麻烦你再看看呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for CMakeLists.txt
PR types
New features
PR changes
APIs
Describe
1、修改编译选项WITH_AMD_GPU为 WITH_ROCM_PLATFORM
2、为rocm平台添加相关编译选项
3、添加ROCM 平台底层代码调用:dynload,完善miopen/hiprand/rocblas/rocrand等相关库的调用接口
扩展paddle框架的硬件适用范围,
编译参数:
cmake .. -DPYTHON_EXECUTABLE=$PATH_PYTHON/bin/python3 -DPYTHON_INCLUDE_DIR=$PATH_PYTHON/include
-DPYTHON_LIBRARY=$PATH_PYTHON/lib/libpython3.so -DCMAKE_BUILD_TYPE=Release -DWITH_GPU=OFF -DWITH_GLOO=OFF -DWITH_TP_CACHE=ON -DWITH_TESTING=ON -DWITH_MKL=OFF -DWITH_NCCL=OFF -DWITH_ROCM_PLATFORM=ON
os:CentOS Linux release 7.7.1908
GCC:7.3.1
cmake:3.18
rocm:3.5