debug-distributed-hang

Diagnose distributed SGLang hangs using py-spy traces and NCCL logs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hangs in multi-GPU SGLang runs cause ranks to diverge and stall collective operations; this skill guides you to identify hang locations using py-spy traces, watchdog behavior, NCCL logs, and CUDA coredumps, and to derive actionable fixes.

Core Features & Use Cases

  • Diagnoses hangs using py-spy traces, watchdog behavior, NCCL logs, and CUDA coredumps to locate stall points.
  • Provides per-rank logging patterns to identify divergence and state drift across GPUs.
  • Enables a binary-search workflow to pinpoint the first diverge point and trace inputs to their roots.
  • Outlines practical fixes and safe operational patterns for distributed inference across TP/PP/DP/EP.

Quick Start

Start by enabling watchdog traces and per-rank logging on a failing multi-GPU run, then perform a binary-search to locate the divergence and apply the recommended fixes.

Frequently Asked Questions about debug-distributed-hang

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

FAQPage Schema
How do I diagnose distributed SGLang hangs in multi-GPU runs?

Diagnose distributed SGLang hangs by collecting py-spy traces, watchdog behavior, NCCL logs, and CUDA coredumps to locate rank divergence points where collective operations stall.

What is the best way to find the root cause of NCCL collective stalls?

The best way to find root cause of NCCL collective stalls is enabling per-rank logging to identify state drift, then applying a binary-search workflow to pinpoint the first divergence point and trace inputs to their roots.

How do I use py-spy traces to debug multi-GPU inference hangs?

Use py-spy traces alongside watchdog behavior and NCCL logs in multi-GPU inference hangs to locate exact stall points, enabling per-rank logging to identify divergence and state drift across GPUs.

Does this debugging approach work for TP, PP, DP, and EP parallelism contexts?

Yes, the debugging approach applies in multi-GPU TP, PP, DP, and EP contexts to identify where collectives stall, log per-rank state, and outline practical fixes for safe operational patterns in distributed inference.

Why do ranks diverge and stall during distributed SGLang runs?

Ranks diverge and stall during distributed SGLang runs when collective operations desynchronize, requiring per-rank logging patterns and a binary-search workflow to pinpoint the first divergence point and derive actionable fixes.

How to analyze CUDA coredumps when distributed inference hangs?

Analyze CUDA coredumps alongside py-spy traces and NCCL logs when distributed inference hangs to locate stall points, then enable per-rank logging to identify divergence and state drift across GPUs for actionable fixes.