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
- 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, androcprofv3must be onPATH. Install withpip install "git+https://github.com/AMDResearch/intellikit.git#subdirectory=kerncap", which buildslibkerncap.soagainst the host ROCm. - 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 themake recompiletarget is not generated. Check this before extracting if the user wants to modify the kernel. - Choose execution path:
- If a Kerncap MCP server (
kerncap-mcp) is available, usekerncap-mcp:profile_kernelsto rank kernels,kerncap-mcp:extract_kernelto generate the reproducer, andkerncap-mcp:validate_reproducerto 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.
- If a Kerncap MCP server (