warp-compile-time-optimizer
БесплатноЗапускает вложенные скриптыНе проверенUse when compile time or startup time is the problem in code that uses Warp: a request to improve, optimize, or cut compile times; an app that is slow to…
от NVIDIA★ 4 269 звёзд на GitHubОб этом скилле
Warp cold-start compile time
Start with a runnable command
The probe runs the target in a subprocess, writes only to temporary directories, and needs no network, external tool servers, or Warp checkout.
| Script | Purpose | Arguments |
|---|---|---|
scripts/warp_compile_probe.py |
Measure isolated cold/warm compilation and launches. | measure [OPTIONS] -- COMMAND...; use --help. |
Use run_script("scripts/warp_compile_probe.py", args=[...]) when supported;
otherwise use the Python command below. The target must run to completion.
Compilation model
Warp compiles modules, not individual kernels. A module's identity is:
(live kernel & function set) x (module options) x (CUDA block_dim) x (generic instances)
Each identity requires code generation and native compilation for the full module.
Cold-start cost is roughly:
number of distinct module identities you touch x size of each module
Reduce it in two ways:
- Stop identity churn. A module that changes after loading compiles again.
- Stop source duplication. A module used at three block dimensions compiles every kernel three times.
Deleting one kernel from a module that still builds saves only part of one build. Removing an unnecessary module identity saves the full build.
When neither applies, overlap independent CUDA builds (CS-13). This changes when work happens, not how much is compiled, so judge it on elapsed time.
When a module's options are fixed
Options have two deadlines:
- Module creation (Python import). The module copies
enable_backward,max_unroll,lineinfo,deterministic,deterministic_max_records, andcompile_time_tracefromwarp.config. Setting a global later is silently ignored by that module.default_grid_strideis the exception. - First load. Before compilation, change the existing module with
wp.set_module_options()orwp.get_module(name).options. Changing an option after load creates a new identity and rebuilds the module (CS-3).
| Missed deadline | Symptom | Cost |
|---|---|---|
wp.config.* set after import |
hash unchanged, option silently absent | the entire benefit, invisibly |
| module options set after load | a second hash, module builds twice | one extra build, visible in the trace |
After changing an option, confirm the hash moved for every target module. An unchanged hash means the option never arrived.
Preserve behavior
Change how Warp compiles the code, not the workload.
Do not delete or merge kernels to claim a gain. Apparently redundant stages may preserve ownership, aliasing, retained outputs, numerical boundaries, or API behavior. Fix duplication at the module level.
Preserve every launch and its order, dimensions, dtypes, devices, block dimensions, gradients, numerical modes, dynamic/plugin behavior, and public API signatures. Keep kernel names when moving definitions to module scope because logs, cache artifacts, and external tools expose them.
Instructions
1. Find the real cost, and confirm it is compilation
Ask what command the user actually waits on, then measure it cold:
python scripts/warp_compile_probe.py measure --samples 3 \
--json baseline.json -- <the user's command>
The probe gives each sample private WARP_CACHE_PATH, WARP_CACHE_ROOT, and
CUDA_CACHE_PATH directories, enables module timers, and records launches. It
creates those directories under the system temporary directory and removes
them itself, so isolating a sample never requires writing a cache into the
project or deleting anything to re-measure. Isolate a hand-rolled sample the
same way. Never clear a live cache with wp.clear_kernel_cache() or
wp.clear_lto_cache(); clearing is not isolated and can disrupt other
processes.
Read the probe output before source. If compilation is a small part of wall time, report the real bottleneck and stop. For libraries and tests, use the smallest command that compiles the workload's modules.
Modules that each compiled once, with no repeated hashes, block-dimension variants, or LTO, have no structural churn. This rules out redundant builds, not oversized builds; still check cache reuse (CS-2), backward codegen (CS-10), unrolling (CS-11), the precompiled header (CS-12), and overlap when several CUDA modules remain (CS-13).
Every sample also re-runs the command against the cache it just populated. If warm module work is not near zero, diagnose cache reuse (CS-2) before changing module structure.
2. Ask about runtime tradeoffs when needed
Apply ordering fixes, lifecycle grouping, and option hoists without asking.
Ask before changing fast_math, max_unroll, or a MathDx/tile implementation:
Some of these knobs cut compile time but can make the compiled kernels slower or change numerics. Are you optimizing a fast edit-run loop (where slower kernels are usually fine), or production startup (where they usually are not)?
If the user is u
Установить warp-compile-time-optimizer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadEditWriteGlobGrepenvВложенные файлы
FAQ
Что делает скилл warp-compile-time-optimizer?
Use when compile time or startup time is the problem in code that uses Warp: a request to improve, optimize, or cut compile times; an app that is slow to start or stalls at the first wp.launch; seconds of compiling before real work begins; JIT modules recompiling on every run or every CI job. Only applies when the code being optimized uses Warp kernels. Not for steady-state kernel runtime, memory, correctness, building Warp itself from source, or nvcc/C++ build times.
Как установить скилл warp-compile-time-optimizer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл warp-compile-time-optimizer запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic