
cuTile Python to cuTile.jl Conversion
OfficialFreeEfficiently convert cuTile Python kernels to Julia.
Free · Opens the source repo
What cuTile Python to cuTile.jl Conversion does
The cuTile Python to cuTile.jl Conversion skill facilitates the translation of cuTile Python GPU kernels, specifically those marked with @ct.kernel, into their Julia equivalents. This process encompasses various critical transformations such as adapting kernel syntax from Python to Julia's function definitions, converting array indexing from 0-based to 1-based, and addressing differences in memory layouts and type systems. The skill is particularly useful for developers and researchers who need to port existing Python kernels to Julia for performance optimization or to leverage Julia's capabilities in numerical computing.
The conversion workflow is structured to guide users through the necessary steps: analyzing the original Python kernel, writing the corresponding Julia kernel, and validating the output. Users can reference detailed documentation for debugging common errors, understanding critical rules that govern the conversion process, and testing their Julia implementations against established patterns. The skill also includes a set of example conversions that serve as practical references, showcasing how to handle various operations such as element-wise addition, matrix multiplication, and softmax computations.
This skill is ideal for data scientists, machine learning engineers, and developers who are transitioning projects from Python to Julia or who are looking to optimize GPU kernel performance in Julia. By providing a systematic approach to kernel conversion, it reduces the potential for errors and streamlines the development process, allowing users to focus on enhancing their applications rather than getting bogged down by syntax and operational differences between the two languages.
In summary, the cuTile Python to cuTile.jl Conversion skill is a valuable tool for anyone involved in GPU programming with cuTile, offering a clear pathway for translating Python code into Julia while ensuring compatibility and performance are maintained.
When to use it
Use this skill when you need to convert or port existing cuTile Python kernels to Julia for performance or compatibility reasons.
When not to use it
This skill is not suitable for projects that do not involve cuTile or for users unfamiliar with GPU programming concepts.
What you can build with it
Porting a Machine Learning Model
You have a machine learning model written in cuTile Python and want to optimize it using Julia's performance capabilities.
Debugging Kernel Errors
While translating a kernel, you encounter a MethodError; use the debugging resources to identify and fix the issue.
Learning Julia GPU Programming
You are transitioning from Python to Julia for GPU programming and need a structured way to convert existing kernels.
How to install cuTile Python to cuTile.jl Conversion
View source1. Install with the skills CLI
npx skills add nvidia/skills/tilegym-converting-cutile-to-julia --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by nvidiacuTile Python → cuTile.jl (Julia) Conversion
Convert @ct.kernel Python kernels to Julia function ... end cuTile.jl kernels.
Workflow Selection
- Standard conversion → Full workflow:
translations/workflow.md - Errors (
MethodError,IRError, numerical mismatch) →references/debugging.md - Quick reference →
references/api-mapping.md+references/critical-rules.md - Test patterns →
references/testing.md
Architecture
Julia kernels are standalone — no Python bridge, no pytest integration. The Julia sub-project
lives in julia/ at the repo root with its own Project.toml for dependency management.
julia/ # Self-contained Julia sub-project
├── Project.toml # Dependencies: CUDA.jl, cuTile.jl, NNlib.jl, Test
├── kernels/ # cuTile.jl kernel implementations
│ ├── add.jl # ← Ground-truth: 1D element-wise with alpha scaling (tensor+tensor, tensor+scalar)
│ ├── matmul.jl # ← Ground-truth: 2D tiled MMA, standard Julia layout (M,K)×(K,N)→(M,N)
│ └── softmax.jl # ← Ground-truth: 3 strategies (TMA, online, chunked) using ct.load/ct.store
└── test/ # Julia-native tests (using Test stdlib)
├── runtests.jl # Test runner entry point
├── test_add.jl
├── test_matmul.jl
└── test_softmax.jl
Ground-truth reference: Always consult julia/kernels/*.jl and julia/test/*.jl for patterns that compile and pass tests. These are the canonical examples of working cuTile.jl code.
Instructions
- Analyze the Python kernel: identify patterns, shapes, dtypes, operations
- Write Julia kernel —
julia/kernels/<op>.jlwith cuTile.jl kernel + bridge function(s) - Convert kernel signature (see
translations/workflow.mdPhase 2) - Convert kernel body (apply
references/api-mapping.md+references/critical-rules.md) - Write Julia test —
julia/test/test_<op>.jlusingTeststdlib +NNlib.jlfor reference - Register test — add
include(...)injulia/test/runtests.jl - Validate — run the bundled validator:
python <skill-dir>/scripts/validate_cutile_jl.py <file.jl> - Test — run
julia --project=julia/ julia/test/runtests.jl
Full conversion checklist with post-conversion verification → translations/workflow.md
⚠️ Top Pitfalls
The most dangerous translation errors. Full rules (17 total) in references/critical-rules.md.
| # | Pitfall | One-line fix |
|---|---|---|
| 1 | ct.full() doesn't exist in Julia | Use fill(val, shape), zeros(T, dims...), or ones(T, dims...) |
| 2 | max(a, b) on tiles → IRError | Use max.(a, b) (broadcast dot) |
| 3 | IRError / MethodError mentioning IRStructurizer | Compiler bug — file upstream with minimal reproducer |
| 4 | ct.launch arg order silently wrong | Args are positional — match kernel signature exactly |
| 5 | ct.load with order — index positions wrong | order remaps BOTH shape AND index (Critical Rule 16) |
Worked Examples
Side-by-side Python → Julia conversions matching the released Julia kernels in julia/kernels/. Each directory contains cutile_python.py (before) and cutile_julia.jl (after).
| # | Example | Key Patterns | When to Reference |
|---|---|---|---|
| 01 | add | 1D ct.load/ct.store, alpha scaling, scalar broadcast, fill/zeros, keyword load/store | Starting point; basic TMA + element-wise patterns |
| 02 | matmul | muladd, TF32 conversion, K-loop with for, 2D swizzle, standard Julia layout, ct.@compiler_options | MMA / tensor core operations |
| 03 | softmax | Persistent scheduling, for loops, gather/scatter, padding_mode, multi-pass | Large-tensor reduction patterns |
These match the released kernels in julia/kernels/ (add.jl, matmul.jl, softmax.jl). The examples are simplified teaching versions — always consult julia/kernels/*.jl for the canonical, tested implementations.
Reference Documents
| Category | Document | Content |
|---|---|---|
| Workflows | translations/workflow.md | Full conversion workflow with todo list, validation loop, checklist |
| Rules | references/critical-rules.md | 17 Critical Rules for cuTile Python → Julia conversion |
| API | references/api-mapping.md | Python↔Julia bidirectional API mapping + kernel patterns |
| Testing | references/testing.md | Julia-native test patterns, tolerances, failure diagnosis |
| Debugging | references/debugging.md | Julia-specific error diagnosis + IR debug commands |
| Scripts | scripts/validate_cutile_jl.py | Static validation for Julia anti-patterns (run it) |
| Ground Truth | julia/kernels/*.jl + julia/test/*.jl | Actual working implementations in the codebase |
Environment Setup
Prerequisite — Julia: this skill requires the Julia version declared in julia/Project.toml under [compat] julia. If julia --version is missing or older than that, install from the official Julia site at https://julialang.org/install/ following the verified installer instructions for your OS. Resume below once julia --version is compatible.
Then, from the repo root:
# Install Julia dependencies declared in julia/Project.toml
julia --project=julia/ -e 'using Pkg; Pkg.instantiate()'
# Run tests
julia --project=julia/ julia/test/runtests.jl
Requirements:
- Julia (minimum version declared in
julia/Project.tomlunder[compat] julia) - CUDA 13.1+ driver
- Blackwell GPU (compute capability 10+)
- Dependencies managed via
julia/Project.toml: CUDA.jl, cuTile.jl, NNlib.jl, Test
Frequently asked questions about cuTile Python to cuTile.jl Conversion
Similar skills
Rhino 3D Scripting
Streamline your Rhinoceros 3D scripting tasks.
MVVM Toolkit
Streamline ViewModel development with source generators.
FreeCAD Scripts
Generate Python scripts for FreeCAD automation and modeling.
Azure Architecture Builder
Design and deploy Azure infrastructure using natural language.
Command Development
Streamline your command creation for Claude Code.
Create Cowork Plugin
Easily build and package plugins through guided sessions.
