Skip to content

Commit f3e49c4

Browse files
authored
Fix rocm cmake (#32230)
* [ROCM] fix some typo in cmake, test=develop * [ROCM] fix rccl in paddle build script, test=develop
1 parent 22ea4c3 commit f3e49c4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ option(WITH_TENSORRT "Compile PaddlePaddle with NVIDIA TensorRT" OFF)
3333
option(WITH_XPU "Compile PaddlePaddle with BAIDU KUNLUN XPU" OFF)
3434
option(WITH_WIN_DUMP_DBG "Compile with windows core dump debug mode" OFF)
3535
option(WITH_ASCEND "Compile PaddlePaddle with ASCEND" OFF)
36+
option(WITH_ROCM "Compile PaddlePaddle with ROCM platform" OFF)
3637
# NOTE(zhiqiu): WITH_ASCEND_CL can be compile on x86_64, so we can set WITH_ASCEND=OFF and WITH_ASCEND_CL=ON
3738
# to develop some acl related functionality on x86
3839
option(WITH_ASCEND_CL "Compile PaddlePaddle with ASCEND CL" ${WITH_ASCEND})
@@ -43,6 +44,9 @@ endif()
4344
if (WITH_GPU AND WITH_ASCEND)
4445
message(FATAL_ERROR "Error when compile GPU and ASCEND at the same time")
4546
endif()
47+
if (WITH_GPU AND WITH_ROCM)
48+
message(FATAL_ERROR "Error when compile CUDA and ROCM at the same time")
49+
endif()
4650

4751
if(WITH_GPU AND NOT APPLE)
4852
enable_language(CUDA)
@@ -168,8 +172,6 @@ option(WITH_DISTRIBUTE "Compile with distributed support" OFF)
168172
option(WITH_BRPC_RDMA "Use brpc rdma as the rpc protocal" OFF)
169173
option(ON_INFER "Turn on inference optimization and inference-lib generation" OFF)
170174
################################ Internal Configurations #######################################
171-
option(WITH_ROCM "Compile PaddlePaddle with ROCM platform" OFF)
172-
option(WITH_RCCL "Compile PaddlePaddle with RCCL support" OFF)
173175
option(WITH_NV_JETSON "Compile PaddlePaddle with NV JETSON" OFF)
174176
option(WITH_PROFILER "Compile PaddlePaddle with GPU profiler and gperftools" OFF)
175177
option(WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF)
@@ -188,6 +190,7 @@ option(WITH_DGC "Use DGC(Deep Gradient Compression) or not" ${WITH_DISTRIBUTE}
188190
option(SANITIZER_TYPE "Choose the type of sanitizer, options are: Address, Leak, Memory, Thread, Undefined" OFF)
189191
option(WITH_LITE "Compile Paddle Fluid with Lite Engine" OFF)
190192
option(WITH_NCCL "Compile PaddlePaddle with NCCL support" ON)
193+
option(WITH_RCCL "Compile PaddlePaddle with RCCL support" ON)
191194
option(WITH_XPU_BKCL "Compile PaddlePaddle with BAIDU KUNLUN XPU BKCL" OFF)
192195
option(WITH_CRYPTO "Compile PaddlePaddle with crypto support" ON)
193196
option(WITH_ARM "Compile PaddlePaddle with arm support" OFF)
@@ -305,9 +308,9 @@ endif(WITH_ROCM)
305308

306309
if (NOT WITH_ROCM AND WITH_RCCL)
307310
MESSAGE(WARNING
308-
"Disable RCCL when compiling without GPU. Force WITH_RCCL=OFF.")
309-
set(WITH_NCCL OFF CACHE STRING
310-
"Disable RCCL when compiling without GPU" FORCE)
311+
"Disable RCCL when compiling without ROCM. Force WITH_RCCL=OFF.")
312+
set(WITH_RCCL OFF CACHE STRING
313+
"Disable RCCL when compiling without ROCM" FORCE)
311314
endif()
312315

313316
if(WITH_RCCL)

paddle/scripts/paddle_build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ function cmake_base() {
238238
-DWITH_GPU=${WITH_GPU:-OFF}
239239
-DWITH_TENSORRT=${WITH_TENSORRT:-ON}
240240
-DWITH_ROCM=${WITH_ROCM:-OFF}
241-
-DWITH_RCCL=${WITH_RCCL:-OFF}
242241
-DWITH_DISTRIBUTE=${distibuted_flag}
243242
-DWITH_MKL=${WITH_MKL:-ON}
244243
-DWITH_AVX=${WITH_AVX:-OFF}
@@ -276,7 +275,6 @@ EOF
276275
-DWITH_GPU=${WITH_GPU:-OFF} \
277276
-DWITH_TENSORRT=${WITH_TENSORRT:-ON} \
278277
-DWITH_ROCM=${WITH_ROCM:-OFF} \
279-
-DWITH_RCCL=${WITH_RCCL:-OFF} \
280278
-DWITH_DISTRIBUTE=${distibuted_flag} \
281279
-DWITH_MKL=${WITH_MKL:-ON} \
282280
-DWITH_AVX=${WITH_AVX:-OFF} \

0 commit comments

Comments
 (0)