port-cuda-kernel-to-triton

port-cuda-kernel-to-triton is a skill for Claude Code, Codex from tensormux/kernel-skills. It costs 0 tokens per session (3,514 once invoked), scanned A, original, MIT.

A guide for converting an existing CUDA GPU kernel into a Python-callable Triton kernel. Triton is a language for writing GPU operations with a tile-based programming model, so the guide maps CUDA concepts while checking numerical results.

In plain words
What is it for?
Use it to port suitable tiled operations such as matrix multiplication, softmax, layer normalization, elementwise work, or reductions, then test correctness on supported NVIDIA or AMD hardware.
Why use it?
It helps avoid treating the two programming models as interchangeable and highlights CUDA patterns that require redesign rather than direct translation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to port suitable tiled operations such as matrix multiplication, softmax, layer normalization, elementwise work, or reductions, then test correctness on supported NVIDIA or AMD hardware.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tensormux/kernel-skills/port-cuda-kernel-to-triton
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tensormux/kernel-skills --skill port-cuda-kernel-to-triton
Clone the repo
git clone --depth 1 https://github.com/tensormux/kernel-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for port-cuda-kernel-to-triton

README.md
[![agentmods](https://agentmods.dev/badge/skills/tensormux/kernel-skills/port-cuda-kernel-to-triton/github.svg)](https://agentmods.dev/skills/tensormux/kernel-skills/port-cuda-kernel-to-triton)
Your own site
<a href="https://agentmods.dev/skills/tensormux/kernel-skills/port-cuda-kernel-to-triton"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/port-cuda-kernel-to-triton/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for port-cuda-kernel-to-triton

Your own site · 80×15
<a href="https://agentmods.dev/skills/tensormux/kernel-skills/port-cuda-kernel-to-triton"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/port-cuda-kernel-to-triton.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,514 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03514
Opus 5 $0.00000 $0.01757
Sonnet 5 $0.00000 $0.00703
Haiku 4.5 $0.00000 $0.00351

Measured 11d ago against content hash b394d1c8c580, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

port-cuda-kernel-to-triton scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/portability/port-cuda-kernel-to-triton/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: Port a CUDA Kernel to Triton

Purpose

Guide the agent through systematically porting an existing CUDA kernel to Triton, mapping the CUDA execution model to Triton's tile-based program model, preserving numerical correctness, and identifying the patterns that do not translate directly.

Use this when

  • An existing CUDA kernel must be made available as a Python-callable Triton kernel without rewriting the entire algorithm.
  • The CUDA kernel implements a well-defined tiled operation (GEMM, softmax, layernorm, elementwise, reduction) where the tile structure is already clear.
  • Prototyping speed matters and maintaining the Triton version is preferable to maintaining CUDA C++ for the target team.
  • The kernel needs to run on hardware with good Triton support (NVIDIA A-series, H-series; AMD MI-series via ROCm Triton).

Do not use this when

  • The CUDA kernel relies on warp shuffle instructions (__shfl_sync, __shfl_xor_sync) for its critical computation path. Triton has no direct warp shuffle API; the logic must be restructured to use tl.sum/tl.max or eliminated, which is a non-trivial redesign.
  • The CUDA kernel uses complex intra-block data exchange patterns (e.g., warp-level matrix multiply with explicit register fragments via WMMA) that have no natural Triton equivalent. Porting will require restructuring the algorithm, not just translating syntax.
  • The kernel depends on __threadfence, __threadfence_block, or other fine-grained memory fence semantics not present in Triton.
  • The CUDA kernel uses dynamic shared memory in a way that depends on runtime-determined offsets or aliased smem regions. Triton manages smem implicitly and cannot be directed at this level.
  • The kernel is already performance-critical and well-tuned in CUDA; a Triton port may not match its throughput without significant autotuning. Evaluate this tradeoff first.

Inputs the agent should gather first

  • The complete CUDA kernel source, including all device functions it calls.
  • The kernel's inputs and outputs: tensor shapes, dtypes, memory layouts (row-major, column-major, strided).
  • The block dimensions (blockDim.x/y/z) and grid dimensions (gridDim.x/y/z) used in the launch.
  • Which shared memory loads correspond to which input tensors, and which smem regions are reused across iterations.
  • Whether the kernel contains warp shuffles, atomics, or texture reads.
  • The target hardware architecture and Triton version (Triton API changes between versions for some ops).
  • Whether autotuning of BLOCK_M, BLOCK_N, BLOCK_K, num_warps, and num_stages is planned or if a fixed configuration is required.

Read the full file on GitHub · 154 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 154 lines · 0 tokens per session scan A b394d1c8c580

Subscribe to this mod's changes

port-cuda-kernel-to-triton is a skill published in the GitHub repository tensormux/kernel-skills (75 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,514 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

design-impl-audit

The Design-vs-Implementation Audit Copilot. A universal skill for any project, any language, any design document. Before work starts, it reminds engineers what must be delivered; after code lands, it checks what was actually delivered, what drifted, and what silently went beyond the design. Feed it a design doc plus a…

MagicKidd/Rokid-agentic-workflow · 0 tokens

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

MagicKidd/Rokid-agentic-workflow · 45 tokens

brainstorming

Brainstorming design process. Must be used before any creative work - creating features, building components, adding functionality, or modifying behavior. Transforms ideas into complete designs and specifications through collaborative dialogue. Trigger words: brainstorm, design discussion, requirement analysis…

MagicKidd/Rokid-agentic-workflow · 0 tokens

diagnose

Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.

MagicKidd/Rokid-agentic-workflow · 66 tokens

prompt-engineering

Prompt engineering techniques and patterns. Use when writing agent commands, hooks, skills, subagent prompts, or any LLM interaction: optimizing prompts, improving output reliability, and designing production-grade prompt templates. Trigger words: prompt engineering, prompt, prompt optimization, LLM interaction.

MagicKidd/Rokid-agentic-workflow · 0 tokens

setup-matt-pocock-skills

Sets up an ## Agent skills block in AGENTS.md/CLAUDE.md and docs/agents/ so the engineering skills know this repo's issue tracker (GitHub or local markdown), triage label vocabulary, and domain doc layout. Run before first use of to-issues, to-prd, triage, diagnose, tdd, improve-codebase-architecture, or zoom-out — or…

MagicKidd/Rokid-agentic-workflow · 124 tokens