pytorch-to-triton
Translate PyTorch implementations to Triton GPU kernels incrementally. Use when converting PyTorch code to Triton, optimizing GPU kernels, auditing/reviewing existing Triton code, or when user says "triton", "convert to triton", "gpu kernel", "pytorch to triton", "audit triton", or "review kernel".
npx skills add majiayu000/claude-skill-registry --skill pytorch-to-triton --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.
# PyTorch to Triton Conversion A skill for incrementally translating PyTorch implementations to Triton GPU kernels, progressing from simple/correct to optimized/efficient. ## Quick Start When invoked: 1. First, ensure Triton documentation is cached locally (see [triton-docs.md](triton-docs.md)) 2. Identify the PyTorch code to convert 3. Follow the 3-stage incremental conversion process 4. Validate correctness at each stage before optimizing ## Prerequisites: Triton Documentation Before starting any conversion, ensure documentation is available: ```bash # Check if docs exist ls docs/.triton_docs/ # If not present, create and fetch (see triton-docs.md for details) mkdir -p docs/.triton_docs ``` Use WebFetch to download and cache key Triton documentation to `docs/.triton_docs/`: - `triton-lang-guide.md` - Core language reference - `triton-tutorials.md` - Official tutorials (vector add, matmul, softmax, etc.) - `triton-best-practices.md` - Optimization patterns See [triton-docs.md](triton-docs.md) for complete fetching instructions. ## The 3-Stage Conversion Process ### Stage 1: Naive/Correct Implementation **Goal**: Get a working Triton kernel that produces correct results. **Approach
- Quick Start
- Prerequisites: Triton Documentation
- The 3-Stage Conversion Process
- Stage 1: Naive/Correct Implementation
- Stage 2: Basic Optimizations
- Stage 3: Advanced Tuning
- Validation Framework
- Benchmarking
- Reference Implementation
- Common Patterns
- Ring Buffer (from this codebase)
- Masked Operations
- Semiring Abstraction
- Instructions for Claude
Check if docs exist ls docs/.triton_docs/ If not present, create and fetch (see triton-docs.md for details) mkdir -p docs/.triton_docs
What does the pytorch-to-triton skill do?
Translate PyTorch implementations to Triton GPU kernels incrementally. Use when converting PyTorch code to Triton, optimizing GPU kernels, auditing/reviewing existing Triton code, or when user says "triton", "convert to triton", "gpu kernel", "pytorch to triton", "audit triton", or "review kernel".
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill pytorch-to-triton --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.
