一键导入
kernel-dev
CUDA kernel development workflow. Use when writing, testing, or optimizing GPU kernels. Follows the Edit-Build-Validate-Benchmark-Commit cycle.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
CUDA kernel development workflow. Use when writing, testing, or optimizing GPU kernels. Follows the Edit-Build-Validate-Benchmark-Commit cycle.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run matmul performance benchmarks. Use when user wants to measure TFLOPS, compare kernel performance, or verify correctness after code changes.
SM120 (Blackwell) CUDA expert. Use for wgmma/mma PTX inline assembly, TMA, narrow precision (FP4/FP6/FP8), and block-scaled GEMM development.
View and analyze build logs. Use when user wants to see build errors, check previous build output, or debug build failures.
Run LLM inference tests with Qwen or other models. Use when testing model loading, inference, CUDA Graph, or generation quality.
Run all checks including lint, typecheck, and tests. Use before creating PRs or for comprehensive validation.
Run Ruff linter and formatter on Python code. Use before commits or when checking code style and quality issues.
| name | kernel-dev |
| description | CUDA kernel development workflow. Use when writing, testing, or optimizing GPU kernels. Follows the Edit-Build-Validate-Benchmark-Commit cycle. |
Workflow for developing and optimizing CUDA kernels.
Edit -> Build -> Validate -> Benchmark -> Commit
ALWAYS commit after validation/benchmark, regardless of results.
# 1. Build (from Git Bash)
./build.sh 86 # RTX 3090 Ti
./build.sh 120a # RTX 5090
# 2. Validate correctness
python -c "
import numpy as np
import _pygpukit_native as native
A = np.random.randn(1024, 1024).astype(np.float32)
B = np.random.randn(1024, 1024).astype(np.float32)
C = native.matmul(native.from_numpy(A), native.from_numpy(B)).to_numpy()
expected = A @ B
error = np.max(np.abs(C - expected)) / np.max(np.abs(expected))
print(f'Relative error: {error:.2e}')
print('PASS' if error < 1e-3 else 'FAIL')
"
# 3. Benchmark
python scripts/benchmark.py --quick
# 4. Commit (MANDATORY)
git add -A && git commit -m 'wip(kernel): description'
wip(tf32): <summary of changes>
Benchmark results (RTX 5090):
- 2048x2048: XX.XX TFLOPS
- 4096x4096: XX.XX TFLOPS
- 8192x8192: XX.XX TFLOPS
Correctness: <PASS/FAIL>
Path: native/ops/matmul/{gemm|gemv}/{input}/{output}/{arch}/{compute}_{suffix}.cu
| Path | Description |
|---|---|
gemm/bf16/bf16/sm120/ | BF16 GEMM for SM120 |
gemm/fp8/f32/sm90/ | FP8->F32 GEMM for SM90 |
gemm/nvf4/bf16/sm120/ | NVF4->BF16 GEMM for SM120 |
gemv/bf16/bf16/sm120/ | GEMV kernels for SM120 |
gemm/f32/f32/generic/ | F32/TF32 generic kernels |
common/ | Shared utilities |
native/core/ | Core CUDA utilities |
| Kernel | Target TFLOPS |
|---|---|
| FP32 naive | ~18 |
| TF32 TensorCore | ~35 |
| cuBLAS | ~59 |