debug-distributed-hang

Diagnose hanging SGLang distributed inference jobs by locating blocked NCCL collectives and divergent rank states.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps diagnose distributed inference runs that freeze or time out when GPU ranks diverge during collective or point-to-point communication.

Core Features & Use Cases

  • Hang Localization: Use watchdog traces, py-spy, NCCL logging, and CUDA coredumps to identify the blocked operation and code path.
  • Rank State Comparison: Add structured per-rank logs, compare event counts and hashes, and locate the first point where distributed state diverges.
  • Root Cause and Fix Guidance: Trace divergent inputs backward and address floating-point nondeterminism, random state differences, conditional branch divergence, and pipeline send/receive mismatches.
  • Use Case: When an SGLang TP, PP, DP, or EP job hangs during an AllGather, use this Skill to identify the diverging rank state and verify the fix across repeated runs.

Quick Start

Use the debug-distributed-hang skill to investigate the hanging SGLang multi-GPU inference job, identify the blocked collective, and locate the first rank-state divergence.

Frequently Asked Questions about debug-distributed-hang

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

FAQPage Schema
Why does my multi-GPU SGLang inference job hang during NCCL AllGather operations?

Multi-GPU SGLang inference jobs hang during NCCL AllGather operations when GPU ranks diverge during collective communication. This Skill diagnoses the freeze by locating blocked collective operations and identifying the first divergent rank state using watchdog or py-spy traces.

How do I debug an NCCL collective hang in a distributed tensor parallel inference run?

To debug an NCCL collective hang in distributed tensor parallel inference, you need watchdog or py-spy traces and NCCL diagnostics to localize the blocked operation. This Skill guides you through adding per-rank structured logging to compare event counts and locate the state divergence.

What is the best way to find the first divergent rank state in a frozen pipeline parallel inference job?

Finding the first divergent rank state in a frozen pipeline parallel inference job involves adding structured per-rank logs and comparing event hashes. This Skill traces divergent inputs backward to address floating-point nondeterminism, random state differences, and pipeline send or receive mismatches.

Can I use CUDA coredumps to diagnose rank divergence in multi-GPU inference?

Yes, you can use optional CUDA coredumps alongside NCCL logging and per-rank structured logging to diagnose rank divergence in multi-GPU inference. This Skill uses these diagnostics to identify the blocked code path and verify the fix across repeated validation runs.

Does this distributed debugging approach work with SGLang data and expert parallelism?

Yes, this distributed debugging approach works with SGLang data and expert parallelism runs that freeze or time out. It applies to tensor, pipeline, data, and expert parallelism configurations experiencing rank divergence during point-to-point or collective communication.

How do I fix floating-point nondeterminism causing distributed inference hangs?

To fix floating-point nondeterminism causing distributed inference hangs, trace divergent inputs backward to locate the first rank-state divergence. This Skill helps address floating-point nondeterminism, random state differences, and conditional branch divergence, followed by repeated validation of fixes.