debug-distributed-hang

Diagnose hanging issues in multi-GPU distributed inference using py-spy, NCCL logs, and CUDA coredumps.

12|2|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/scottgl9/sglang-spark-gb10-optimizations --skill debug-distributed-hang-scottgl9
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-distributed-hang
Source: https://github.com/scottgl9/sglang-spark-gb10-optimizations/tree/main/.claude/skills/debug-distributed-hang
Command: npx skills add https://github.com/scottgl9/sglang-spark-gb10-optimizations --skill debug-distributed-hang-scottgl9

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users diagnose and resolve hanging issues in distributed deep learning inference, preventing deadlocks and ensuring smooth multi-GPU operation.

Core Features & Use Cases

  • Hanging Detection: Guides on using tools like py-spy, NCCL logs, and CUDA coredumps to locate hang points.
  • Per-Rank Logging: Facilitates detailed logging from each GPU rank to compare states and identify divergence causes.
  • Root Cause Analysis: Provides methodologies for diffing logs, tracing back to specific inputs or operations causing the hang.
  • Fix Recommendations: Offers advice on addressing size mismatches, non-determinism, conditional branches, and pipeline mismatches.

Quick Start

Attach CUDA debuggers, enable NCCL debug logs, and configure per-rank logging to trace the points where the distributed training or inference process stalls, then analyze the logs to identify and fix the root cause.

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 a multi-GPU distributed inference hang?

Debug a multi-GPU distributed inference hang by attaching py-spy, enabling NCCL debug logs, and configuring per-rank logging to trace stall points, then diff logs to identify and fix the root cause.

What causes deadlocks in multi-GPU distributed inference setups?

Deadlocks in multi-GPU distributed inference setups are caused by size mismatches, non-determinism, conditional branches, and pipeline mismatches. Per-rank logging helps compare GPU states to identify which divergence causes the hang.

How do I use NCCL logs to locate hang points in distributed training?

Use NCCL logs to locate hang points by enabling debug logging and configuring per-rank outputs from each GPU rank. Diff these logs to trace back to specific inputs or operations causing the distributed training process to stall.

Does py-spy work with CUDA to diagnose hanging issues in deep learning inference?

Yes, py-spy works with CUDA to diagnose hanging issues in deep learning inference. Attach py-spy to inspect stalled processes and use CUDA coredumps alongside NCCL logs to locate the exact hang points in multi-GPU operations.

What is the best way to identify rank divergence causing a distributed GPU hang?

The best way to identify rank divergence causing a distributed GPU hang is per-rank logging. By configuring detailed logs from each GPU rank, you can compare states and trace divergences back to specific inputs or operations.

Why does my distributed inference process stall when using multiple GPU ranks?

Your distributed inference process stalls due to size mismatches, non-determinism, conditional branches, or pipeline mismatches across GPU ranks. Analyze CUDA coredumps and diff per-rank logs to find the exact operation causing the deadlock.