CUDA Tile Compiler
Actively maintained. Last release 3 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install cuda-tilecuTile Python
cuTile Python is a programming language for NVIDIA GPUs. The official documentation can be found on docs.nvidia.com, or built from source located in the docs folder.
Example
# This examples uses CuPy which can be installed via `pip install cupy-cuda13x`
# Make sure cuda toolkit 13.1+ is installed: https://developer.nvidia.com/cuda-downloads
import cuda.tile as ct
import cupy
import numpy as np
TILE_SIZE = 16
# cuTile kernel for adding two dense vectors. It runs in parallel on the GPU.
@ct.kernel
def vector_add_kernel(a, b, result):
block_id = ct.bid(0)
a_tile = ct.load(a, index=(block_id,), shape=(TILE_SIZE,))
b_tile = ct.load(b, index=(block_id,), shape=(TILE_SIZE,))
result_tile = a_tile + b_tile
ct.store(result, index=(block_id,), tile=result_tile)
# Generate input arrays
rng = cupy.random.default_rng()
a = rng.random(128)
b = rng.random(128)
expected = cupy.asnumpy(a) + cupy.asnumpy(b)
# Allocate an output array and launch the kernel
result = cupy.zeros_like(a)
grid = (ct.cdiv(a.shape[0], TILE_SIZE), 1, 1)
ct.launch(cupy.cuda.get_current_stream(), grid, vector_add_kernel, (a, b, result))
# Verify the results
result_np = cupy.asnumpy(result)
np.testing.assert_array_almost_equal(result_np, expected)
More examples can be found at Samples and TileGym.
System Requirements
cuTile Python generates kernels based on Tile IR
which requires NVIDIA Driver r580 or later to run.
Furthermore, the tileiras compiler (version 13.2) only supports Blackwell GPU and Ampere/Ada
GPU. Hopper GPU will be supported in the coming versions.
Checkout the prerequisites
for full list of requirements.
Installing from PyPI
cuTile Python is published on PyPI under the
cuda-tile package name and can be installed with pip:
pip install cuda-tile[tileiras]
The optional tileiras dependency installs the tileiras compiler directly into your python
environment.
If you do not want to have inside the python environment, run