debug-cuda-crash

Capture CUDA crash boundaries and tensor metadata via kernel API logging in SGLang.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CUDA crashes in SGLang can be difficult to diagnose because the failure occurs deep in kernel execution and standard logs may be sparse. This skill provides a structured approach to enable kernel API logging at varying levels to capture call boundaries, inputs, and relevant metadata before a crash, enabling faster root-cause analysis.

Core Features & Use Cases

  • Incremental logging levels to capture function boundaries, inputs, and optional tensor statistics.
  • Reproduction workflows for LLM or diffusion-related CUDA crashes using Level 1/3/5/10.
  • Crash dumps with inputs and metadata for post-mortem analysis.
  • Multi-process log management and API-level filtering via include/exclude patterns.

Quick Start

Enable kernel API logging at level 3 and run your script to reproduce and inspect the crash.

Frequently Asked Questions about debug-cuda-crash

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

FAQPage Schema
How do I debug a CUDA crash in SGLang?

Debug SGLang CUDA crashes by enabling kernel API logging to capture call boundaries, tensor metadata, and crash-safe inputs. Incremental logging levels isolate failures deep in kernel execution where standard logs are sparse.

What logging level should I use to inspect tensor shapes and dtypes before a CUDA crash?

Use Level 3 kernel API logging to inspect tensor shapes, dtypes, devices, and call wiring. This level captures function boundaries and tensor metadata to diagnose SGLang kernel failures effectively.

How can I capture crash dumps to reproduce a CUDA failure?

Capture crash-safe inputs and dumps for reproduction by enabling Level 10 kernel API logging. This records tensor inputs and metadata into dump directories for post-mortem analysis of CUDA failures.

Does kernel API logging detect NaN or Inf numerical issues in CUDA kernels?

Yes, kernel API logging detects NaN or Inf numerical issues using Level 5. This level inspects tensor statistics and numerical values to identify anomalies causing CUDA kernel crashes.

Can I redirect CUDA crash logs per rank in multi-process SGLang workflows?

Yes, you can redirect kernel API logs per rank in multi-process workflows. Use include and exclude patterns to filter API calls and manage logs efficiently for post-mortem analysis.

What is the best way to diagnose sparse CUDA kernel failures?

The best way to diagnose sparse CUDA kernel failures is structured kernel API logging. It captures incremental levels of function boundaries, tensor metadata, and crash dumps for faster root-cause analysis.