kernel-cute-writing

Write and implement GPU kernels using NVIDIA CuTe DSL for element-wise, GEMM, and reduction operations.

Updated May 23, 2026
One-click install
npx skills add https://github.com/yo-steven/skills-exploration-20260522 --skill kernel-cute-writing-yo-steven
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kernel-cute-writing
Source: https://github.com/yo-steven/skills-exploration-20260522/tree/main/skills/TensorRT-LLM/kernel-cute-writing
Command: npx skills add https://github.com/yo-steven/skills-exploration-20260522 --skill kernel-cute-writing-yo-steven

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write and implement GPU kernels using NVIDIA CuTe DSL (CUTLASS 4.x Python API) so you can produce efficient kernels without dropping into Triton, CUDA C++, or purely conceptual explanations.

Core Features & Use Cases

  • CuTe DSL kernel implementation: Use cute.jit/cute.kernel, cute.compile, and from_dlpack-based execution.
  • Performance-focused patterns: Covers element-wise kernels, GEMM tiling, reductions, memory hierarchy (global/shared/register/TMA), MMA tensor core operations, and software pipelining.
  • Safe operational guidance: Includes guardrails like when to pre-compile, how to handle dynamic shapes, and how to avoid common CuTe-specific pitfalls (e.g., early return in @cute.kernel, scalar type promotion, missing assumed_align).

Quick Start

Ask the AI to help you create a CuTe DSL kernel for your specific operation and GPU (SM80/SM90/SM100), including the exact tensor shapes/dtypes and whether you want element-wise, GEMM, or reduction behavior.

Frequently Asked Questions about kernel-cute-writing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement GPU kernels using CuTe DSL in Python?

To implement GPU kernels with CuTe DSL, use cute.jit or cute.kernel for definition and cute.compile for pre-compilation. This approach manages memory hierarchy and tensor core MMA execution on Ampere+ GPUs using the CUTLASS 4.x Python API.

How do I pass tensors to a CuTe kernel without dropping into CUDA C++?

You can pass tensors to a CuTe kernel using from_dlpack with assumed_align hints. This allows performance-oriented control over memory hierarchy directly in Python without writing Triton or CUDA C++ code.

What is the correct way to handle control flow and dynamic shapes in a CuTe kernel?

When writing a CuTe kernel, enforce kernel-safety constraints by using predication instead of early returns inside @cute.kernel. Use cute.compile pre-compilation with dynamic layout support to handle dynamic shapes safely.

Does CuTe DSL support software pipelining and GEMM tiling for Ampere and Hopper GPUs?

Yes, CuTe DSL supports software pipelining, GEMM tiling, and reductions. It provides performance-focused patterns for tensor core MMA operations across global, shared, and register memory hierarchies for SM80, SM90, and SM100 GPUs.

Why does my CuTe kernel break when I use an early return inside the @cute.kernel function?

Using an early return inside a @cute.kernel function breaks CuTe DSL because it violates kernel-safety constraints. You must replace early returns with predication to safely handle boundary conditions within the CUTLASS 4.x Python API.