debug-cuda-crash

Debug CUDA crashes in FlashInfer applications using API logging and compute-sanitizer.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/ariusewy/flashinfer_dev --skill debug-cuda-crash-ariusewy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-cuda-crash
Source: https://github.com/ariusewy/flashinfer_dev/tree/main/.claude/skills/debug-cuda-crash
Command: npx skills add https://github.com/ariusewy/flashinfer_dev --skill debug-cuda-crash-ariusewy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you diagnose and fix CUDA crashes in your FlashInfer applications by providing detailed logging of API calls and tensor states before a crash occurs.

Core Features & Use Cases

  • API Logging: Captures input tensors, shapes, dtypes, and values for debugging.
  • Error Analysis: Helps identify shape mismatches, numerical issues (NaN/Inf), and memory access errors.
  • Multi-Process Debugging: Supports logging for distributed training setups.
  • Use Case: When your PyTorch model using FlashInfer suddenly crashes with a CUDA error, you can enable API logging to see exactly which tensor inputs caused the illegal memory access or NaN output, allowing for a quick fix.

Quick Start

Enable detailed API logging by setting the environment variables FLASHINFER_LOGLEVEL to 3 and FLASHINFER_LOGDEST to debug.log, then run your Python script.

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 illegal memory access crash in FlashInfer?

To debug a CUDA illegal memory access crash in FlashInfer, enable API logging by setting FLASHINFER_LOGLEVEL to 3 and FLASHINFER_LOGDEST to a file, which captures input tensor states and shapes before the failure.

What is the best way to identify NaN or Inf values causing PyTorch CUDA errors?

The best way to identify NaN or Inf values causing PyTorch CUDA errors is to enable detailed API logging to capture tensor inputs and outputs, allowing you to pinpoint the exact numerical issue before the crash.

Can I debug CUDA crashes in a multi-process distributed training setup?

Yes, you can debug CUDA crashes in a multi-process distributed training setup. The Skill supports multi-process debugging by enabling API logging to capture tensor states across different processes.

Does compute-sanitizer work with FlashInfer to find memory access errors?

Yes, compute-sanitizer works with FlashInfer. The Skill details leveraging external tools like compute-sanitizer and cuda-gdb alongside API logging to identify common CUDA errors and debug kernel-level issues.

Why does my PyTorch model suddenly crash with a CUDA error during inference?

Your PyTorch model might crash with a CUDA error during inference due to shape mismatches, numerical issues like NaN/Inf values, or illegal memory access. API logging helps capture the exact tensor inputs causing the failure.