Skip to content

[distributed] Add the tested collective-order repro to PR #5645 - #1

Merged
tranle-fw merged 1 commit into
zpcore:fix-cp-fsdp-shared-communicatorfrom
tranle-fw:repro-for-pei-5645
Oct 29, 2026
Merged

tranle-fw merged 1 commit into
zpcore:fix-cp-fsdp-shared-communicatorfrom
tranle-fw:repro-for-pei-5645

Conversation

@tranle-fw

Copy link
Copy Markdown
Collaborator
  • Adds the exact GPU-tested 82-line reproducer to the branch behind pytorch/torchtitan#5645: matching warmup, then rank 0 submits A2A→AG while ranks 1–3 submit AG→A2A. --separate-group gives AG its own communicator.
  • Fresh run of the unchanged script: shared PG 0 / sequence 3 times out (rank 0 A2A versus peers AG); separate communicators pass on all four ranks with exact outputs, exit 0. Sanitized evidence below.
  • This is an intentional host-order fault diagnostic. Separate-group completion is measured here, not a general reversed-order guarantee (NVIDIA ordering contract).
Reproduction commands and measured setup

Unchanged tested source: 3803b11c, fault at line 56. Both runs used the same four B300 GPUs and PyTorch 2.13.0a0+8145d630e8.nv26.06, CUDA 13.3, NCCL 2.30.5.

Run each case in a separate process/container with an external deadline. Equivalent local invocations with the recorded communication settings:

export NCCL_LAUNCH_ORDER_IMPLICIT=1
export NCCL_CUMEM_ENABLE=0 NCCL_CUMEM_HOST_ENABLE=0 NCCL_NVLS_ENABLE=0
export NCCL_SOCKET_IFNAME=lo NCCL_DEBUG=WARN TORCH_NCCL_DUMP_ON_TIMEOUT=0

timeout --signal=KILL 150s torchrun --standalone --nproc-per-node=4 scripts/repro_collective_order.py
timeout --signal=KILL 150s torchrun --standalone --nproc-per-node=4 scripts/repro_collective_order.py --separate-group

The measured runs used a container deadline and a CUDA-readiness gate before process-group creation; neither changes the script's fault phase. No GPU delay is injected. Source SHA256: fb0abc0ec4a74a099a8f89125bf71e270cd9092253191f4c7e62aea79f6e88be.

Fresh run of the exact script: sanitized forced-order logs

Four CUDA ranks; PyTorch 2.13.0a0, CUDA 13.3, NCCL 2.30.5; NCCL_LAUNCH_ORDER_IMPLICIT=1 in both runs. After matching AG→A2A warmup, rank 0 deliberately submits A2A→AG while peers submit AG→A2A. This is a host-order negative control, not GPU-only skew or a natural FSDP prefetch reproduction. Host/process identifiers, timestamps, paths and addresses are omitted; retained lines/payloads below are unchanged.

Shared group: all ranks warm up and both asynchronous calls return on every rank, then collective sequence 3 times out.

rank=0 WARMED
rank=0 warmup=False submitted=a2a
rank=0 warmup=False submitted=ag
rank=2 WARMED
rank=3 WARMED
rank=2 warmup=False submitted=ag
rank=3 warmup=False submitted=ag
rank=2 warmup=False submitted=a2a
rank=3 warmup=False submitted=a2a
rank=1 WARMED
rank=1 warmup=False submitted=ag
rank=1 warmup=False submitted=a2a
[Rank 3] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3, OpType=_ALLGATHER_BASE, NumelIn=1048576, NumelOut=4194304, Timeout(ms)=30000)
[Rank 2] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3, OpType=_ALLGATHER_BASE, NumelIn=1048576, NumelOut=4194304, Timeout(ms)=30000)
[Rank 0] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3, OpType=ALLTOALL_BASE, NumelIn=1048576, NumelOut=1048576, Timeout(ms)=30000)
[Rank 1] Watchdog caught collective operation timeout: WorkNCCL(SeqNum=3, OpType=_ALLGATHER_BASE, NumelIn=1048576, NumelOut=4194304, Timeout(ms)=30000)

Dedicated all-gather group: the same opposite host order completes. PASS is printed after CUDA synchronization and exact checks of both outputs.

rank=2 PASS
rank=0 PASS
rank=1 PASS
rank=3 PASS

The shared run recorded the 30-second watchdog, then required its external 150-second container deadline (exit 137). The dedicated run exited 0 in 16.090 seconds. Dedicated completion is an empirical result of this test, not a general guarantee for reversed cross-communicator order.

Only scripts/repro_collective_order.py is added; the existing communicator fix is unchanged. This transfer supersedes pytorch/torchtitan#5658.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant