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

Bu işleme şunda yer alıyor:
Bertan Dogancay
2025-06-16 15:26:53 -04:00
işlemeyi yapan: GitHub
ebeveyn fb4ad82d0d
işleme 39211c6b41
+10 -3
Dosyayı Görüntüle
@@ -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