[NPKit] Use default output directory when env var is not set (#1747)

[ROCm/rccl commit: 39211c6b41]
This commit is contained in:
Bertan Dogancay
2025-06-16 15:26:53 -04:00
committed by GitHub
parent 3e5dc99aa6
commit 9fa53cc454
+10 -3
View File
@@ -2558,10 +2558,17 @@ static ncclResult_t commCleanup(ncclComm_t comm) {
// Dump NPKit events and shutdown
const char* npkitDumpDir = getenv("NPKIT_DUMP_DIR");
if (npkitDumpDir == nullptr) {
WARN("NPKIT_DUMP_DIR is empty");
} else {
NCCLCHECK(NpKit::Dump(npkitDumpDir));
npkitDumpDir = "./npkit_dump";
INFO(NCCL_INIT, "NPKIT_DUMP_DIR is not set, using default directory: %s", npkitDumpDir);
struct stat st;
if (stat(npkitDumpDir, &st) != 0) {
if (mkdir(npkitDumpDir, 0755) != 0) {
WARN("Failed to create NPKIT_DUMP_DIR directory: %s", npkitDumpDir);
}
}
}
NCCLCHECK(NpKit::Dump(npkitDumpDir));
NCCLCHECK(NpKit::Shutdown());
#endif