kernel-profile

Profile CUDA-C++ kernels with Nsight Compute metrics and classify bottlenecks.

14|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/fmh66/kernel-opt-agent --skill kernel-profile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kernel-profile
Source: https://github.com/fmh66/kernel-opt-agent/tree/main/skills/kernel-profile
Command: npx skills add https://github.com/fmh66/kernel-opt-agent --skill kernel-profile

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, torch, triton, nsight-python, nvidia-cutlass-dsl, and includes scripts (resource) and references (resource) components.

What problem does it solve?

kernel-profile helps you determine whether a CUDA/CUTLASS/CuTe DSL/Triton kernel is memory-bound, compute-bound, latency-bound, occupancy-limited, or mixed by validating correctness first and then collecting Nsight Compute (NCU) metrics with nsight-python.

Core Features & Use Cases

  • Environment readiness & backend availability checks: verifies CUDA/PyTorch/GPU selection plus readiness of ncu and nsight-python, and confirms at least one backend is usable (cuda-cpp, cute-dsl, cutlass, or triton).
  • Correctness validation before profiling: runs the provided kernel implementation against a Python reference (with configurable atol/rtol) and writes correctness.md.
  • Deterministic NCU profiling workflow: collects kernel runtime timing (CUDA events) plus NCU metric summaries and detailed per-metric results, then classifies bottlenecks using the generated ncu_summary.md evidence.
  • Use cases: diagnosing slow GPU kernels, choosing the next optimization direction (e.g., coalescing/misalignment vs compute pipeline utilization vs synchronization vs divergence), and comparing occupancy/memory stalls across kernel variants under fixed dimensions and settings.

Quick Start

Use the kernel-profile skill to validate correctness and generate NCU profiling reports for your kernel implementation against a Python reference, then read ncu_summary.md to decide the bottleneck category.

Frequently Asked Questions about kernel-profile

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

FAQPage Schema
How do I diagnose if my CUDA kernel is memory-bound or compute-bound?

To diagnose if a CUDA kernel is memory-bound or compute-bound, you can profile it using Nsight Compute metrics to collect timing and stall data. This Skill validates kernel correctness first, then generates ncu_summary.md evidence to classify bottlenecks into memory, compute, latency, occupancy, or mixed behavior categories.

Can I profile Triton kernels with Nsight Compute for performance tuning?

Yes, you can profile Triton kernels with Nsight Compute for evidence-backed tuning. This Skill supports Triton modules alongside CUDA-C++ and CUTLASS-wrapped kernels, collecting deterministic NCU metric summaries and detailed per-metric results to guide optimization directions like coalescing or pipeline utilization.

What do I need to run Nsight Compute profiling for bottleneck classification?

To run Nsight Compute profiling for bottleneck classification, you need the ncu and nsight-python readiness tooling installed. You also need a Python reference implementation defining reference(**kwargs) to validate correctness, and the numpy, torch, triton, and nvidia-cutlass-dsl dependencies available in your environment.

How does validating kernel correctness before profiling work?

Validating kernel correctness before profiling works by running your kernel implementation against a Python reference function with configurable absolute and relative tolerance thresholds. The Skill executes this comparison and outputs a correctness.md report, ensuring your Nsight Compute metrics reflect an accurate kernel before you invest time in optimization.

Does this approach work with CUTLASS and CuTe DSL modules?

Yes, this approach works with CUTLASS and CuTe DSL modules. The Skill confirms at least one usable backend—cuda-cpp, cute-dsl, cutlass, or triton—during environment checks, and applies its Nsight Compute profiling workflow to classify bottlenecks across these different GPU kernel implementations.

What's the best way to compare GPU kernel variants for occupancy and memory stalls?

The best way to compare GPU kernel variants for occupancy and memory stalls is to profile them under fixed dimensions and settings using Nsight Compute. This Skill collects runtime timing via CUDA events and generates ncu_details.md, allowing you to evaluate different kernel implementations against consistent metrics.