debug-distributed-hang

Diagnose distributed hangs in multi-GPU SGLang deployments using per-rank traces, NCCL logs, and CUDA core dumps.

1|Updated May 8, 2026
One-click install
npx skills add https://github.com/dyyoungg/sglang-dev --skill debug-distributed-hang-dyyoungg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-distributed-hang
Source: https://github.com/dyyoungg/sglang-dev/tree/main/.claude/skills/debug-distributed-hang
Command: npx skills add https://github.com/dyyoungg/sglang-dev --skill debug-distributed-hang-dyyoungg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hangs in distributed inference occur when ranks diverge in state, causing collective operations (AllGather, AllReduce, Broadcast) to deadlock. This Skill provides procedures to identify, pinpoint, and fix hanging scenarios in multi-GPU SGLang deployments.

Core Features & Use Cases

  • Per-rank logging: capture rank-specific progress to diff across ranks and locate divergence points.
  • Deterministic investigation: use py-spy, NCCL debug logs, and CUDA coredumps to identify the exact hang location.
  • Divergence correction workflow: apply binary-search style techniques to isolate the root cause and validate fixes.

Quick Start

Attach py-spy to the scheduler process, enable NCCL logging, and trigger a CUDA coredump to locate the first diverging point in a hung multi-GPU SGLang run.

Frequently Asked Questions about debug-distributed-hang

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug distributed hangs in multi-GPU SGLang deployments?

To debug distributed hangs in multi-GPU SGLang deployments, attach py-spy to the scheduler, enable NCCL debug logging, and trigger a CUDA core dump to locate the first diverging rank during collective operations like AllGather and AllReduce.

Why do NCCL collective operations like AllGather and Broadcast deadlock in distributed inference?

NCCL collective operations deadlock in distributed inference because ranks diverge in state, causing synchronization failures during AllGather, AllReduce, or Broadcast operations. Identifying the first diverging event requires diffing per-rank logs.

Do I need py-spy and CUDA core dumps to diagnose SGLang multi-GPU hangs?

Yes, diagnosing SGLang multi-GPU hangs requires py-spy, NCCL debug logs, and CUDA core dumps. These tools provide deterministic investigation capabilities to pinpoint exact hang locations and validate subsequent fixes.

How do I locate the first diverging rank when a distributed PyTorch training run hangs?

Locate the first diverging rank when a distributed run hangs by enabling per-rank logging and applying binary-search style techniques. Diffing these rank-specific progress logs isolates the exact state drift causing the deadlock.

Can I use this NCCL hang debugging workflow for TP, PP, DP, and EP setups across multi-node clusters?

Yes, this NCCL hang debugging workflow applies to TP, PP, DP, and EP setups across multi-node clusters. It specifically detects size mismatches, branch divergences, and cascading state drift during collective operations.