tilegym-improve-cutile-kernel-perf
БесплатноБез исполняемых скриптовНе проверенIteratively optimize cuTile kernel performance through systematic profiling, bottleneck analysis, IR comparison, and targeted tuning. Covers tile sizes…
от NVIDIA★ 4 269 звёзд на GitHubОб этом скилле
Iterative cuTile Kernel Performance Optimization
Systematically profile, diagnose bottlenecks, and iteratively tune a cuTile kernel's performance in the TileGym repository.
Instructions
Follow the three phases in order: Setup the environment and baseline, run the Experimentation loop with a tracked log, then iterate The experiment loop until perf goals are met or further gains plateau.
Setup
Work with user to prepare optimization environment:
Create a fresh git branch: Propose a branch name, e.g.,
cutile-perf-<kernel_name>-<date>from current branch. Checkoutgit checkout -b <branch name>Locate the target kernel:
- cuTile kernels live under
src/tilegym/suites/<suite>/cutile/orsrc/tilegym/ops/cutile/ - Read the kernel file and identify: the
@ct.kerneldecorated function(s), the launch wrapper (ct.launch()orct_experimental.autotune_launch()), the@register_implregistration, and current autotune configs (if any)
- cuTile kernels live under
Classify the kernel:
- Arithmetic Intensity < 10 -> Memory-bound
- Arithmetic Intensity 10-50 -> Balanced
- Arithmetic Intensity > 50 -> Compute-bound
Note: classification is only used to pick the optimization priority order in the experiment loop. The core metric is always
latency (ms).Check GPU environment:
- Ensure a GPU node (Blackwell or Ampere GPU) is available
- All subsequent benchmark commands should run on the GPU node
Study related references:
references/optimization-playbook.md: Step-by-step recipes for each optimization (A through J) with before/after code examplesreferences/perf-knobs-catalog.md: Complete catalog of all tunable parameters (TMA, persistent scheduling, occupancy, tile sizes, latency hints, etc.)references/cutile-api-reference.md: cuTile API reference and 18 critical rulesreferences/performance-model.md: Roofline/performance model, bottleneck diagnosis, autotuningreferences/ir-dump-guide.md: IR dump, analysis, and error diagnosisreferences/cutile-patterns-reference.md: Common cuTile patterns and conversion quick-reference
Create @sandbox/perf_results.md to track progress. The first run will write a baseline
Confirm and go: Once you get confirmation, kick off the experimentation
Experimentation
Every experiment iteration applies ONE optimization to the target kernel, verifies correctness, re-benchmarks, and records results. Each iteration should be enforced to finish within 10 minutes.
The goal
- Improve the core metric: reduce
latency (ms) - Subject to the core constraint: Correctness shall not regress — every optimization MUST preserve numerical correctness.
latency (ms)shall not regress > 2% compared to baseline.
What you can change
- The target kernel file under
src/tilegym/suites/<suite>/cutile/orsrc/tilegym/ops/cutile/: kernel body, tile sizes, occupancy, num_ctas, TMA usage, latency hints, flush_to_zero, autotune configs, persistent scheduling, and other cuTile-specific parameters - The kernel's launch wrapper: grid computation, autotune config space
- @sandbox/: Feel free to add new files or modify files created by you, but don't check to git
What you can NOT change
- Kernel functional semantics (inputs, outputs, and numerical behavior within tolerance)
- Test infrastructure and benchmark harness
- Anything not listed above
What to expect from experiment outputs
Correctness test:
python -m pytest tests/suites/.../test_<kernel_name>.py -k "test_ and cutile and not test_perf" -v
Performance benchmark:
For each iteration:
- Run pytest benchmark:
python -m pytest ... --print-record→ extract latency (ms) - Record latency in perf_results.md
Benchmark cmdlines:
python -m pytest tests/suites/.../test_<kernel_name>.py -k "test_perf and cutile" --print-record -v
latency sample:
Cutile: {'forward': {'mean': 3.7903138461538455, 'std': 0.0016941310873207053, 'rel_std': 0.044696327430505396, 'median': 3.789880999999999, 'min': 3.7883389999999992, 'max': 3.7941230000000004, 'nrep': 13, 'peak_mem_mb': 913}} ms
Track experiment progress
Use @sandbox/perf_results.md to record each iteration's results. It should only contain a Markdown table with 5 columns:
iteration: iteration number, starting from 0 (baseline)optimization: what was applied (e.g., "baseline", "TMA replace gather", "persistent scheduling")latency_ms: kernel latency in milliseconds, six decimal pointscorrectness: PASS or FAILstatus: Whether this iteration waskeep,revert, orcrash
Example content:
| iteration | optimization | latency_ms | correctness | status |
|----------:|:-------------------|-----------:|:------------|-------:|
| 0 | baseline | 0.820000 | PASS | keep |
| 1 | TMA replace gather | 0.390000 | PASS | keep |
Create the tabular header if the file was empty. Append o
Установить tilegym-improve-cutile-kernel-perf в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tilegym-improve-cutile-kernel-perf?
Iteratively optimize cuTile kernel performance through systematic profiling, bottleneck analysis, IR comparison, and targeted tuning. Covers tile sizes, occupancy, autotune configs, TMA, latency hints, persistent scheduling, num_ctas, flush_to_zero, and IR-level debugging. Use when asked to "optimize cutile kernel", "improve kernel perf", "tune cutile performance", "make kernel faster", or iteratively benchmark and refine a cuTile GPU kernel in the TileGym project.
Как установить скилл tilegym-improve-cutile-kernel-perf?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tilegym-improve-cutile-kernel-perf запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic