Skip to content
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

[PG NCCL] Add TDD, NCCL_DEBUG log #97692

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,14 +659,21 @@ ProcessGroupNCCL::ProcessGroupNCCL(
#endif

init();
const std::string OFF = "OFF";
const char* torch_distributed_debug =
parseEnvVarString("TORCH_DISTRIBUTED_DEBUG", OFF.c_str());
const char* nccl_debug = parseEnvVarString("NCCL_DEBUG", OFF.c_str());
LOG(INFO) << "[Rank " << rank_
<< "] ProcessGroupNCCL initialized with following options:"
<< "\nNCCL_ASYNC_ERROR_HANDLING: " << asyncErrorHandling_
<< "\nNCCL_DESYNC_DEBUG: " << desyncDebug_
<< "\nNCCL_BLOCKING_WAIT: " << blockingWait_
<< "\nTIMEOUT(ms): " << options_->timeout.count()
<< "\nUSE_HIGH_PRIORITY_STREAM: "
<< options_->is_high_priority_stream;
<< options_->is_high_priority_stream
<< "\n TORCH_DISTRIBUTED_DEBUG: "
<< std::string(torch_distributed_debug)
<< "\n NCCL_DEBUG: " << std::string(nccl_debug);

RECORD_PARAM_COMMS(
0, // seq
Expand Down
8 changes: 8 additions & 0 deletions torch/csrc/distributed/c10d/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ inline int parseEnvVarInt(const char* envVarName) {
return C10D_ENV_NOT_SET;
}

inline const char* parseEnvVarString(const char* envVarName, const char* default_val) {
const char* val = std::getenv(envVarName);
if (val == nullptr) {
val = default_val;
}
return val;
}

inline int parseEnvVarIntDefault(const char* envVarName, int defaultVal) {
int val = parseEnvVarInt(envVarName);
if (val == C10D_ENV_NOT_SET)
Expand Down