Agent skill · Code Review & Quality

debug-distributed

Guide for debugging distributed training issues in AReaL. Use when user encounters hangs, wrong results, OOM, or communication errors.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill debug-distributed --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 7 KB
Bundled scripts: none
Path: skills/ai-ml/debug-distributed/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. When to Use
  2. Debugging Principles
  3. Minimal Reproduction
  4. Step-by-Step Debugging Guide
  5. 1. Hang Debugging (Deadlocks, Synchronization)
  6. 2. Wrong Results (Gradient, Reduction Issues)
  7. 3. OOM Issues (Memory, Sharding)
  8. 4. Communication Errors
  9. Debugging Tools
  10. Environment Variables Reference
  11. py-spy for Call Stack Analysis
  12. Rank-Conditional Printing
  13. Check Device Mesh
  14. Validate Tensor Consistency
Ships with 1 file
  • metadata.json
Commands it runs
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
More from claude-skill-registry
All skills →
About this skill
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.

Keep going