I am thinking of building a small open source tool and want to know if it is worth it.
Problem: A distributed job hangs on the cluster because ranks went out of sync. One rank has an extra batch, takes a different branch, or calls a different shape. You find out after paying for the GPUs. Example: DDP: Only one rank finishing while rest hang, where one rank had 1051 batches and the others had 1052.
Idea: rankcheck (not built yet) runs your unmodified script on your laptop as N real CPU processes for a few steps. It swaps NCCL for Gloo and CUDA for CPU for you. If ranks go out of sync or stall, it stops and shows where. The output is also a small repro you can share.
# mockup of planned output
$ rankcheck torchrun --nproc_per_node=4 train.py
HANG at step 1052
rank 3: finished, exited train loop train.py:88
ranks 0-2: waiting in all_reduce (DDP backward) train.py:97
cause: rank 3 ran 1051 batches, ranks 0-2 ran 1052
I know about TORCH_DISTRIBUTED_DEBUG=DETAIL and LocalTensor. I tried DETAIL with 4 Gloo ranks on a Mac. It catches most mismatches, like a wrong op or wrong shape, within a second or two and gives file:line on every rank. Where it falls short is the early-exit case above. It waits out the full timeout, then reports “Rank 3 failed to pass monitoredBarrier” with a line number but no reason. You also have to set up the CPU/Gloo run yourself. LocalTensor runs one process, so it can’t catch rank-specific branches.
So rankcheck would mostly be DETAIL plus the missing parts: set up the CPU run for you, fail fast when a rank exits early, and say why (here, rank 3’s sampler gave it one fewer batch).
Have you hit this? If so, what do you use today to catch it?
Thanks.