From c41198a04b3842e736dae21c1ace6ec8606011d5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 25 Jun 2026 12:07:46 +0000 Subject: [PATCH] Make HCCL OOM injection persistent after trigger count Remove the upper bound (trigger_count + 2) so that injected HCCL OOM errors continue for all subsequent operations once the call count exceeds HCCL_OOM_TRIGGER_COUNT. Co-authored-by: yjyang62 --- torch_npu/csrc/distributed/ProcessGroupHCCL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch_npu/csrc/distributed/ProcessGroupHCCL.cpp b/torch_npu/csrc/distributed/ProcessGroupHCCL.cpp index d6de8a833..a5c8efcb6 100644 --- a/torch_npu/csrc/distributed/ProcessGroupHCCL.cpp +++ b/torch_npu/csrc/distributed/ProcessGroupHCCL.cpp @@ -113,7 +113,7 @@ void maybeThrowHcclOom(c10d::OpType opType, c10_npu::CaptureStatus capture_statu } const int64_t current_count = ++g_hccl_oom_call_count; - if (current_count > trigger_count && current_count < trigger_count + 2) { + if (current_count > trigger_count) { auto retmsg = std::string("HCCL function error: Failed to allocate memory. " "Injected HCCL OOM after ") + std::to_string(current_count) + " HCCL operations, op type is " + opTypeToString(opType) +