torch-compile
Use torch.compile to JIT-compile PyTorch code into optimized kernels, then validate speedups with warmups and graph-break audits.
Profile →npx skills add majiayu000/claude-skill-registry --skill torch-compile --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
--- name: torch-compile description: Optimize PyTorch with torch.compile (TorchDynamo/Inductor), focusing on compile overhead, graph breaks, and benchmark methodology. Use when speeding up PyTorch models or debugging compile behavior; triggers: torch.compile, torchdynamo, inductor, graph break, pytorch optimization. --- # Torch Compile ## Overview Use `torch.compile` to JIT-compile PyTorch code into optimized kernels, then validate speedups with warmups and graph-break audits. ## When to Use Use this skill only when the frontmatter triggers apply; otherwise keep eager mode. ## Decision Tree 1. Do you need to reduce Python overhead in hot paths? - Yes: compile and benchmark. 2. Are first runs much slower than eager? - Yes: warm up and re-measure after caching. 3. Are graph breaks frequent? - Yes: audit with `torch._dynamo.explain` or logging and reduce non-tensor logic. ## Workflows ### 1. Compile Benchmark With Warmup 1. Run a short eager baseline. 2. Compile the model and run warmup iterations. 3. Measure steady-state latency after warmup. 4. Compare the eager and compiled timings. ### 2. Graph Break Audit 1. Run `torch._dynamo.explain` on the target function. 2. Record graph brea
- Overview
- When to Use
- Decision Tree
- Workflows
- 1. Compile Benchmark With Warmup
- 2. Graph Break Audit
- 3. Speedup Expectation Check
- Non-Obvious Insights
- Evidence
- Scripts
- Dependencies
- References
What does the torch-compile skill do?
Use torch.compile to JIT-compile PyTorch code into optimized kernels, then validate speedups with warmups and graph-break audits.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill torch-compile --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.