Skip to content

Commit c5556bd

Browse files
authored
Merge branch 'PaddlePaddle:develop' into 4090
2 parents 842de80 + 87b59bd commit c5556bd

File tree

21 files changed

+1298
-32
lines changed

21 files changed

+1298
-32
lines changed

paddle/cinn/backends/nvrtc/nvrtc_util.cc

+9-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,14 @@ std::string Compiler::CompileCudaSource(const std::string& code,
183183
nvrtcCompileProgram(prog, param_cstrings.size(), param_cstrings.data());
184184

185185
if (compile_res != NVRTC_SUCCESS) {
186-
std::string new_code = CodeGenCudaDev::GetGeneralSourceHeader() + code;
186+
std::string new_code = code;
187+
std::string from = CodeGenCudaDev::GetSourceHeader();
188+
size_t pos = new_code.find(from);
189+
if (pos != std::string::npos) {
190+
new_code.replace(
191+
pos, from.length(), CodeGenCudaDev::GetGeneralSourceHeader());
192+
}
193+
187194
NVRTC_CALL(nvrtcCreateProgram(&prog,
188195
new_code.c_str(),
189196
nullptr,
@@ -193,6 +200,7 @@ std::string Compiler::CompileCudaSource(const std::string& code,
193200
compile_res =
194201
nvrtcCompileProgram(prog, param_cstrings.size(), param_cstrings.data());
195202
}
203+
196204
{ // get log
197205
size_t log_size;
198206
NVRTC_CALL(nvrtcGetProgramLogSize(prog, &log_size));

paddle/common/flags.cc

+13
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,19 @@ PHI_DEFINE_EXPORTED_bool(multi_node_sample_use_gpu_table,
12651265
PHI_DEFINE_EXPORTED_bool(nccl_blocking_wait, false, "nccl blocking wait");
12661266
#endif
12671267

1268+
/**
1269+
* ProcessGroupFlagCX related FLAG
1270+
* Name: flagcx_blocking_wait
1271+
* Since Version:
1272+
* Value Range: bool, default=false
1273+
* Example:
1274+
* Note: nccl blocking wait.
1275+
* blocks host thread until collective operation completes
1276+
*/
1277+
#if defined(PADDLE_WITH_FLAGCX)
1278+
PHI_DEFINE_EXPORTED_bool(flagcx_blocking_wait, false, "flagcx blocking wait");
1279+
#endif
1280+
12681281
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
12691282
PHI_DEFINE_EXPORTED_bool(benchmark_nccl,
12701283
false,

paddle/fluid/distributed/collective/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ if(WITH_NCCL OR WITH_RCCL)
3636

3737
endif()
3838

39+
if(WITH_FLAGCX)
40+
cc_library(
41+
process_group_flagcx
42+
SRCS process_group_flagcx.cc common.cc
43+
DEPS process_group phi)
44+
endif()
45+
3946
if(WITH_XPU_BKCL)
4047
cc_library(
4148
process_group_bkcl

0 commit comments

Comments
 (0)