Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Converts cuTile Python @ct.kernel GPU kernels to Julia cuTile.jl kernels, handling indexing, layout, broadcasting and launch API changes.
Use this skill ↓41% 86%+45 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 9 of 22 without it.
3 of 3 safety checks passed
Not used yet
1-based indexing everywhere: ct.bid, ct.num_tiles axis, dims for reductions, permutedims axes, ct.extract indices, ct.cat axis — ALL shifted +1 from Python.
for loops work in kernels (cuTile 0.2+): for k in Int32(1):n and for k in Int32(0):n - Int32(1) are fully supported. Step ranges also work: for i in start:step:stop. The while pattern still works but for is preferred for simple iteration.
Explicit broadcasting: Python cuTile auto-broadcasts +, -, *, / between different shapes. Julia requires .+, .-, .*, ./ for shape-mismatched tiles. Same-shape +/- and scalar *// work without dots.
Left-aligned broadcasting: Julia broadcasts from dimension 1 (left), Python/NumPy from last dimension (right). A (N,) tile cannot broadcast with (M, N). Use reshape(a, (1, N)) first.
Constants at launch, not signature: Python annotates param: ct.Constant[int] in kernel signature. Julia uses plain param::Int in signature and wraps with ct.Constant(val) at the ct.launch call site.
Kernel must return nothing: Every Julia cuTile kernel must end with return or return nothing.
Column-major memory layout: Julia arrays are column-major. For multi-dimensional data that was row-major in Python, consider transposing the logical layout or using batch-last ordering (e.g., (M, K, Batch) instead of Python's (Batch, M, K)).
Reduction keeps dims: sum(tile; dims=2) produces (M, 1) not (M,). Use dropdims(result; dims=2) to remove the singleton.
Type names: ct.float32 → Float32, ct.float16 → Float16, ct.int32 → Int32, ct.bfloat16 → BFloat16, ct.tfloat32 → ct.TFloat32.
Integer types in loops: Loop counters and increments must have matching types. Use Int32 consistently. Preferred: for k in Int32(1):n (handles types automatically). The while pattern also works: k = Int32(1); while k <= n; ...; k += Int32(1); end.
ct.launch arg order is positional: Kernel args after the grid in ct.launch(kernel, grid, arg1, arg2, ...) map 1:1 to the kernel's parameter list. If the kernel signature is (output, input, ...), you MUST pass output first. Swapping arguments silently produces wrong results (the kernel reads from the output buffer and writes to the input buffer).
Element-wise max/min between tiles: Use max.(a, b) (broadcast syntax), NOT max(a, b). The non-broadcast max(a, b) on two tiles is not supported in kernel IR and will fail with IRError: Unsupported function call: max. Similarly min(a, b) → min.(a, b).
IRStructurizer / compiler errors should be reported: If you encounter IRError, MethodError mentioning IRStructurizer.BlockArg, or other internal compiler errors, these are bugs in the cuTile.jl compiler pipeline — do not work around them. Write a minimal reproducer and file it upstream.
Tile-size limits for ct.load: TMA-based ct.load has hardware limits on how much data can be loaded at once (~16K elements). For large tensors, use chunked or online algorithms that iterate over the data in fixed-size tiles, using either ct.load/ct.store with column indices or ct.gather/ct.scatter with index tiles.
ct.Constant parameters work as shape arguments: The shape tuple in ct.arange(N) and fill(val, (N,)) can use ct.Constant kernel parameters — cuTile.jl's const-seeded inference pipeline resolves them at compile time. Pass tile sizes as ct.Constant(val) at the ct.launch call site and use the corresponding ::Int parameter directly in shape tuples. No @eval metaprogramming needed.
function my_kernel(output::ct.TileArray{T, 2}, input::ct.TileArray{T, 2},
TILE_SIZE::Int) where {T}
ct.@compiler_options occupancy=2
bid = ct.bid(1)
tile = ct.load(input; index=(bid, Int32(1)), shape=(1, TILE_SIZE)) # TILE_SIZE from ct.Constant
# ...
end
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.