Skip to content

NCCL Timeout Bug During Dataset Building with (Large) Datasets #2276

Description

@lumoe

🐛 Bug

When training a model using the Raster Vision pipeline with a "larger" datasets on a dual GPU setup, the process crashes after reaching the "Building datasets..." stage. The issue appears to be caused by a timeout during NCCL operations, specifically an ALLREDUCE operation. Reducing the number of scenes in the dataset allows the training to proceed. All while the GPU utilization is at 100% for a single GPU while the second one is idle.

Attempted Workarounds:

  1. Increasing the TORCH_NCCL_HEARTBEAT_TIMEOUT_SEC environment variable did not resolve the issue as the new value was not applied and the timeout remains at 600000ms.
  2. Disabling monitoring by setting TORCH_NCCL_ENABLE_MONITORING=0 avoids the timeout but disables essential monitoring, which is not ideal. Edit: False positive.
  3. Reducing the number of scenes (10 instead of 3500) in the dataset allows training to proceed
  4. Disabling heartbeat monitoring with TORCH_NCCL_ENABLE_MONITORING=0 also did not solve this issue.

Logs

Logs captured with NCCL_DEBUG=INFO

building-panoptic:875384:875432 [1] NCCL INFO ncclCommInitRank comm 0x564b81859bd0 rank 1 nranks 2 cudaDev 1 nvmlDev 1 busId 110 commId 0x1a221728bd4a5a4a - Init COMPLETE     
2024-11-18 14:43:22:rastervision.pytorch_learner.learner: INFO - Building datasets ...                                                                                                  
[rank1]:[E1118 14:53:22.694659270 ProcessGroupNCCL.cpp:616] [Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=5, OpType=ALLREDUCE, NumelIn=1, NumelOut=1, Timeout(ms)=600000) ran for 600019 milliseconds before timing out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions