debug-distributed
Guide for debugging distributed training issues in AReaL. Use when user encounters hangs, wrong results, OOM, or communication errors.
npx skills add majiayu000/claude-skill-registry --skill debug-distributed --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Debug Distributed Training Debugging guide for distributed training issues in AReaL (FSDP2, TP, CP, EP). ## When to Use This skill is triggered when: - Training hangs or deadlocks - Results differ across ranks or are numerically wrong - OOM errors in distributed settings - NCCL/communication errors or device mesh issues ## Debugging Principles ### Minimal Reproduction **Always follow the minimal demo principle**: Reproduce with the least amount of code to narrow down the issue faster. ```python # Bad: Debug in full training loop # Good: Create minimal script import torch import torch.distributed as dist dist.init_process_group("nccl") rank = dist.get_rank() # Reproduce the exact operation that fails tensor = torch.ones(10).cuda() dist.all_reduce(tensor) # <-- Isolate the failing op print(f"Rank {rank}: {tensor}") ``` **Reduction strategy:** 1. Remove unrelated model components 1. Use small tensor sizes 1. Reduce world_size to minimum (e.g., 2 GPUs) 1. Remove torch.compile if possible 1. Disable activation checkpointing ## Step-by-Step Debugging Guide ### 1. Hang Debugging (Deadlocks, Synchronization) **Environment Variables for Debugging**: ```bash # Full debug logging export TOR
- When to Use
- Debugging Principles
- Minimal Reproduction
- Step-by-Step Debugging Guide
- 1. Hang Debugging (Deadlocks, Synchronization)
- 2. Wrong Results (Gradient, Reduction Issues)
- 3. OOM Issues (Memory, Sharding)
- 4. Communication Errors
- Debugging Tools
- Environment Variables Reference
- py-spy for Call Stack Analysis
- Rank-Conditional Printing
- Check Device Mesh
- Validate Tensor Consistency
Full debug logging export TORCH_DISTRIBUTED_DEBUG=DETAIL export NCCL_DEBUG=INFO export NCCL_DEBUG_SUBSYS=ALL torch.compile debugging export TORCH_LOGS="+dynamo,recompiles" export TORCHDYNAMO_VERBOSE=1 Find process IDs ps aux | grep python Dump call stack of specific rank
What does the debug-distributed skill do?
Guide for debugging distributed training issues in AReaL. Use when user encounters hangs, wrong results, OOM, or communication errors.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill debug-distributed --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
