{
  "id": "pytorch/distributed-broadcast-error",
  "signature": "RuntimeError: [torch.distributed] Broadcast failed on rank 3: ncclInternalError: Internal error - unexpected event",
  "signature_zh": "运行时错误：[torch.distributed] 广播在 rank 3 上失败：ncclInternalError：内部错误 - 意外事件",
  "regex": "RuntimeError: \\[torch\\.distributed\\] Broadcast failed on rank \\d+: ncclInternalError: Internal error - unexpected event",
  "domain": "pytorch",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "NCCL internal error during a broadcast collective operation, often caused by GPU hardware faults, driver issues, or network timeouts in multi-node setups.",
  "root_cause_type": "generic",
  "root_cause_zh": "广播集合操作期间的 NCCL 内部错误，通常由 GPU 硬件故障、驱动程序问题或多节点设置中的网络超时引起。",
  "versions": [
    {
      "version": "torch>=1.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "torch<=2.5.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nccl>=2.14",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nccl<=2.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Rebooting all nodes without changing NCCL configuration",
      "why_fails": "If the root cause is a driver mismatch or NCCL version incompatibility, a simple reboot will not fix the issue.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increasing the number of GPUs per node to improve bandwidth",
      "why_fails": "More GPUs can exacerbate NCCL internal errors due to increased contention and resource pressure.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set environment variable NCCL_IB_DISABLE=1 to disable InfiniBand and fall back to TCP, which is more stable on some clusters. For example: export NCCL_IB_DISABLE=1; torchrun --nproc_per_node=8 train.py",
      "success_rate": 0.8,
      "how": "Set environment variable NCCL_IB_DISABLE=1 to disable InfiniBand and fall back to TCP, which is more stable on some clusters. For example: export NCCL_IB_DISABLE=1; torchrun --nproc_per_node=8 train.py",
      "condition": "",
      "sources": []
    },
    {
      "action": "Update NCCL and CUDA drivers to compatible versions. Check NCCL compatibility matrix and use torch's bundled NCCL if possible: pip install torch --index-url https://download.pytorch.org/whl/cu118",
      "success_rate": 0.85,
      "how": "Update NCCL and CUDA drivers to compatible versions. Check NCCL compatibility matrix and use torch's bundled NCCL if possible: pip install torch --index-url https://download.pytorch.org/whl/cu118",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Set environment variable NCCL_IB_DISABLE=1 to disable InfiniBand and fall back to TCP, which is more stable on some clusters. For example: export NCCL_IB_DISABLE=1; torchrun --nproc_per_node=8 train.py",
    "Update NCCL and CUDA drivers to compatible versions. Check NCCL compatibility matrix and use torch's bundled NCCL if possible: pip install torch --index-url https://download.pytorch.org/whl/cu118"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pytorch.org/docs/stable/distributed.html#torch.distributed.broadcast",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2024-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}