Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
755049f2
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
755049f2
编写于
2月 07, 2023
作者:
C
chalsliu
提交者:
GitHub
2月 07, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support build with gcc12 for CUDA less than 12.0 (#50106)
上级
1a0f3490
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
93 addition
and
10 deletion
+93
-10
cmake/experiments/cuda_module_loading_lazy.cmake
cmake/experiments/cuda_module_loading_lazy.cmake
+5
-0
cmake/external/gloo.cmake
cmake/external/gloo.cmake
+12
-0
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+12
-0
cmake/external/warpctc.cmake
cmake/external/warpctc.cmake
+16
-1
paddle/fluid/framework/fleet/heter_ps/gpu_graph_utils.h
paddle/fluid/framework/fleet/heter_ps/gpu_graph_utils.h
+1
-1
paddle/fluid/operators/jit/CMakeLists.txt
paddle/fluid/operators/jit/CMakeLists.txt
+17
-8
paddle/phi/tools/CMakeLists.txt
paddle/phi/tools/CMakeLists.txt
+7
-0
patches/gloo/device.cc.patch
patches/gloo/device.cc.patch
+10
-0
patches/warpctc/CMakeLists.txt.patch
patches/warpctc/CMakeLists.txt.patch
+13
-0
未找到文件。
cmake/experiments/cuda_module_loading_lazy.cmake
浏览文件 @
755049f2
...
...
@@ -31,6 +31,11 @@ if(LINUX)
message
(
"cuda 11.7+ already support lazy module loading"
)
return
()
endif
()
if
(
${
CUDA_VERSION
}
VERSION_LESS
"11.2"
AND
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_GREATER_EQUAL 12.0
)
message
(
"cuda less than 11.2 doesn't support gcc12"
)
return
()
endif
()
message
(
"for cuda before 11.7, libcudart.so must be used for the lazy module loading trick to work, instead of libcudart_static.a"
...
...
cmake/external/gloo.cmake
浏览文件 @
755049f2
...
...
@@ -31,6 +31,17 @@ set(GLOO_LIBRARIES
"
${
GLOO_INSTALL_DIR
}
/lib/libgloo.a"
CACHE FILEPATH
"gloo library."
FORCE
)
set
(
GLOO_PATCH_COMMAND
""
)
if
(
WITH_GPU
)
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 12.0 AND
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_GREATER 12.0
)
file
(
TO_NATIVE_PATH
${
PADDLE_SOURCE_DIR
}
/patches/gloo/device.cc.patch
native_dst
)
set
(
GLOO_PATCH_COMMAND patch -d
${
GLOO_SOURCE_DIR
}
/gloo/transport/tcp <
${
native_dst
}
)
endif
()
endif
()
include_directories
(
${
GLOO_INCLUDE_DIR
}
)
if
(
WITH_ASCEND OR WITH_ASCEND_CL
)
...
...
@@ -59,6 +70,7 @@ else()
GIT_TAG
${
GLOO_TAG
}
PREFIX
"
${
GLOO_PREFIX_DIR
}
"
UPDATE_COMMAND
""
PATCH_COMMAND
${
GLOO_PATCH_COMMAND
}
CONFIGURE_COMMAND
""
BUILD_COMMAND
mkdir -p
${
GLOO_SOURCE_DIR
}
/build && cd
${
GLOO_SOURCE_DIR
}
/build && cmake
...
...
cmake/external/protobuf.cmake
浏览文件 @
755049f2
...
...
@@ -250,6 +250,12 @@ function(build_protobuf TARGET_NAME BUILD_FOR_HOST)
else
()
set
(
PROTOBUF_REPOSITORY
${
GIT_URL
}
/protocolbuffers/protobuf.git
)
set
(
PROTOBUF_TAG 9f75c5aa851cd877fb0d93ccc31b8567a6706546
)
if
(
WITH_GPU
)
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 12.0
AND
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_GREATER 12.0
)
set
(
PROTOBUF_TAG 2dc747c574b68a808ea4699d26942c8132fe2b09
)
endif
()
endif
()
endif
()
if
(
WITH_ARM_BRPC
)
set
(
ARM_PROTOBUF_URL
...
...
@@ -322,6 +328,12 @@ elseif(WITH_ARM_BRPC)
set
(
PROTOBUF_VERSION 3.7.1-baidu-ee-common
)
else
()
set
(
PROTOBUF_VERSION 3.1.0
)
if
(
WITH_GPU
)
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 12.0
AND
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_GREATER 12.0
)
set
(
PROTOBUF_VERSION 3.16.0
)
endif
()
endif
()
endif
()
if
(
NOT PROTOBUF_FOUND
)
...
...
cmake/external/warpctc.cmake
浏览文件 @
755049f2
...
...
@@ -25,6 +25,19 @@ set(WARPCTC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/warpctc)
set
(
WARPCTC_REPOSITORY
${
GIT_URL
}
/baidu-research/warp-ctc.git
)
set
(
WARPCTC_TAG bdc2b4550453e0ef2d3b5190f9c6103a84eff184
)
set
(
WARPCTC_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/warpctc/src/extern_warpctc
)
set
(
WARPCTC_PATCH_COMMAND
""
)
set
(
WARPCTC_CCBIN_OPTION
""
)
if
(
NOT WIN32 AND WITH_GPU
)
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 12.0 AND
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_GREATER 12.0
)
file
(
TO_NATIVE_PATH
${
PADDLE_SOURCE_DIR
}
/patches/warpctc/CMakeLists.txt.patch native_src
)
set
(
WARPCTC_PATCH_COMMAND patch -d
${
WARPCTC_SOURCE_DIR
}
<
${
native_src
}
)
set
(
WARPCTC_CCBIN_OPTION -DCCBIN_COMPILER=
${
CCBIN_COMPILER
}
)
endif
()
endif
()
set
(
WARPCTC_INCLUDE_DIR
"
${
WARPCTC_INSTALL_DIR
}
/include"
CACHE PATH
"Warp-ctc Directory"
FORCE
)
...
...
@@ -112,7 +125,7 @@ else()
GIT_TAG
${
WARPCTC_TAG
}
PREFIX
${
WARPCTC_PREFIX_DIR
}
UPDATE_COMMAND
""
PATCH_COMMAND
""
PATCH_COMMAND
${
WARPCTC_PATCH_COMMAND
}
#BUILD_ALWAYS 1
CMAKE_ARGS -DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
-DCMAKE_C_COMPILER=
${
CMAKE_C_COMPILER
}
...
...
@@ -132,7 +145,9 @@ else()
-DBUILD_TESTS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_BUILD_TYPE=
${
THIRD_PARTY_BUILD_TYPE
}
-DCUDA_TOOLKIT_ROOT_DIR=
${
CUDA_TOOLKIT_ROOT_DIR
}
${
EXTERNAL_OPTIONAL_ARGS
}
${
WARPCTC_CCBIN_OPTION
}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=
${
THIRD_PARTY_BUILD_TYPE
}
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
...
...
paddle/fluid/framework/fleet/heter_ps/gpu_graph_utils.h
浏览文件 @
755049f2
...
...
@@ -62,7 +62,7 @@ inline std::vector<int> shuffle_int_vector(int n) {
e
=
i
++
;
}
std
::
shuffle
(
ret
.
begin
(),
ret
.
end
(),
random_engine_wrapper
.
engine
);
return
std
::
move
(
ret
)
;
return
ret
;
}
#define CUDA_CHECK(cmd) \
...
...
paddle/fluid/operators/jit/CMakeLists.txt
浏览文件 @
755049f2
...
...
@@ -39,14 +39,23 @@ cc_test(
SRCS test.cc
DEPS jit_kernel_helper
)
if
(
NOT WIN32
)
cc_binary
(
jit_kernel_benchmark
SRCS
benchmark.cc
DEPS
jit_kernel_helper
device_tracer
tensor
)
set
(
cuda_less12_and_gcc_greater12 false
)
if
(
DEFINED CMAKE_CUDA_COMPILER_VERSION
)
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 12.0
AND
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_GREATER 12.0
)
set
(
cuda_less12_and_gcc_greater12 true
)
endif
()
endif
()
if
(
NOT cuda_less12_and_gcc_greater12
)
cc_binary
(
jit_kernel_benchmark
SRCS
benchmark.cc
DEPS
jit_kernel_helper
device_tracer
tensor
)
endif
()
endif
()
if
(
WITH_TESTING AND TEST jit_kernel_test
)
set_tests_properties
(
jit_kernel_test PROPERTIES TIMEOUT 120
)
...
...
paddle/phi/tools/CMakeLists.txt
浏览文件 @
755049f2
if
(
WITH_GPU
)
if
(
${
CMAKE_CUDA_COMPILER_VERSION
}
LESS 12.0 AND
${
CMAKE_CXX_COMPILER_VERSION
}
VERSION_GREATER 12.0
)
return
()
endif
()
endif
()
add_executable
(
print_phi_kernels print_phi_kernels.cc
)
target_link_libraries
(
print_phi_kernels phi phi_api_utils
)
if
(
WIN32
)
...
...
patches/gloo/device.cc.patch
0 → 100644
浏览文件 @
755049f2
--- a/device.cc
+++ b/device.cc
@@ -12,6 +12,7 @@
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
+#include <array>
#include "gloo/common/linux.h"
#include "gloo/common/logging.h"
patches/warpctc/CMakeLists.txt.patch
0 → 100644
浏览文件 @
755049f2
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,10 @@
option(BUILD_SHARED "build warp-ctc shared library." ON)
option(WITH_ROCM "Compile PaddlePaddle with ROCM platform" OFF)
+set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -ccbin ${CCBIN_COMPILER} -allow-unsupported-compiler")
+set(NVCC_PREPEND_FLAGS "${NVCC_PREPEND_FLAGS} -ccbin ${CCBIN_COMPILER} -allow-unsupported-compiler")
+set(CCBIN "-ccbin ${CCBIN_COMPILER} -allow-unsupported-compiler")
+
if(WITH_ROCM)
add_definitions(-DWARPCTC_WITH_HIP)
include(hip)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录