intellikit-kerncap-isolate

Installation
SKILL.md

Kerncap: GPU Kernel Isolation

Profile a running application, capture one kernel dispatch's complete runtime state (full device memory snapshot, kernarg buffer, HSACO), and generate a standalone reproducer that replays the kernel in isolation at its original virtual addresses. With source available, the reproducer becomes an edit-recompile-validate project for that single kernel.

When to Use

  • User wants to pull the hottest (or a named) kernel out of a large HIP or Triton application (e.g. llama.cpp, PyTorch/Triton, Composable Kernel)
  • Need a minimal, standalone reproducer for a kernel bug or performance report
  • Iterating on one kernel's performance without rebuilding or rerunning the whole application
  • Checking that an edited kernel still produces byte-identical outputs to the captured original

Instructions

  1. Ensure prerequisites: ROCm 7.2.x or later, Ubuntu 22.04/24.04, Python 3.10+, and an AMD GPU (Instinct MI300X, MI325X, MI355X recommended; Radeon supported). hipcc, cmake, and rocprofv3 must be on PATH. Install with pip install "git+https://github.com/AMDResearch/intellikit.git#subdirectory=kerncap", which builds libkerncap.so against the host ROCm.
  2. To edit and rebuild a HIP kernel, the application's build must provide compile_commands.json (configure CMake with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON). Without it, capture, replay, and validate still work, but the make recompile target is not generated. Check this before extracting if the user wants to modify the kernel.
  3. Choose execution path:
    • If a Kerncap MCP server (kerncap-mcp) is available, use kerncap-mcp:profile_kernels to rank kernels, kerncap-mcp:extract_kernel to generate the reproducer, and kerncap-mcp:validate_reproducer to check it. There is no MCP replay tool; use the CLI or Python API for replay and timing.
    • Otherwise use the CLI or Python API from the environment where Kerncap is installed.
Installs
23
Repository
amd/skills
GitHub Stars
525
First Seen
1 day ago