RepoNVIDIANVIDIApublished Nov 5, 2025seen Jun 26

NVIDIA/cuda-tile

C++

Open original ↗

Captured source

source ↗
published Nov 5, 2025seen Jun 26captured Aug 30http 200method plain

NVIDIA/cuda-tile

Description: CUDA Tile IR is an MLIR-based intermediate representation and compiler infrastructure for CUDA kernel optimization, focusing on tile-based computation patterns and optimizations targeting NVIDIA tensor core units.

Language: C++

License: NOASSERTION

Stars: 1019

Forks: 89

Open issues: 6

Created: 2025-11-05T18:01:57Z

Pushed: 2026-08-28T17:00:29Z

Default branch: main

Fork: no

Archived: no

README:

CUDA Tile IR

CUDA Tile IR is an MLIR-based intermediate representation and compiler infrastructure for CUDA kernel optimization, focusing on tile-based computation patterns and optimizations targeting NVIDIA tensor core units. The project provides a comprehensive ecosystem for expressing and optimizing tiled computations for NVIDIA GPUs, simplifying the development of high-performance CUDA kernels through abstractions for common tiling patterns, memory hierarchy management, and GPU-specific optimizations.

This open-source release is aligned with the CUDA Toolkit 13.1 release. For more information about CUDA Tile, visit https://developer.nvidia.com/cuda/tile.

Core Components

CUDA Tile is composed of:

  • CUDA Tile Dialect: A domain-specific MLIR dialect that provides

first-class operations and types for tile-based computations

  • Python Bindings: Complete Python API for programmatic IR construction,

manipulation, and transformation

  • Bytecode:: Efficient binary representation with support for serialization

and de-serialization between the CUDA Tile dialect and binary format.

  • Conformance Test Suite: Comprehensive tests ensuring compliance with the

CUDA Tile specification and validation of dialect semantics

CUDA Tile Specification

CUDA Tile development is driven by the CUDA Tile IR specification, which defines the formal semantics, operations, and type system for tile-based computations on NVIDIA GPUs. For detailed information about the CUDA Tile IR specification, including dialect operations, type system, and transformation passes, please refer to the CUDA Tile Specification.

Building CUDA Tile

Prerequisites

  • CMake 3.20.0 or higher
  • C++17 compatible compiler
  • Python 3.6+ (for Python bindings)
  • MLIR/LLVM sources or pre-built libraries at a compatible commit (see

[cmake/IncludeLLVM.cmake](cmake/IncludeLLVM.cmake#L29) for the exact version)

  • Ninja build system (optional)

Quick Start

For a quick start, use the following commands from the top of the repository to configure and build a release version of CUDA Tile with Python bindings enabled. MLIR/LLVM sources will be automatically downloaded from https://github.com/llvm/llvm-project:

# Configure
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DCUDA_TILE_ENABLE_BINDINGS_PYTHON=ON \
-DCUDA_TILE_ENABLE_TESTING=ON

# Build
cmake --build build

# Run tests
cmake --build build --target check-cuda-tile

Build Configuration Options

MLIR/LLVM Build Configuration

CUDA Tile requires MLIR/LLVM at a specific compatible commit. The exact commit hash is specified in [cmake/IncludeLLVM.cmake](cmake/IncludeLLVM.cmake#L29). CUDA Tile can be built with MLIR/LLVM in three different ways:

1. Automatic Download from GitHub (Default): CMake automatically downloads MLIR/LLVM sources from the official GitHub repository and builds them at the compatible commit. This is the slowest option but requires no manual LLVM setup.

cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release

2. Use Local LLVM Sources: CMake builds MLIR/LLVM from existing sources on your system. The commit hash of the source must be compatible with commit specified in [cmake/IncludeLLVM.cmake](cmake/IncludeLLVM.cmake#L29).

cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCUDA_TILE_USE_LLVM_SOURCE_DIR=/path/to/llvm/sources

3. Use Pre-built LLVM Libraries: CMake links against pre-compiled LLVM libraries. The commit hash of the source must be compatible with commit specified in [cmake/IncludeLLVM.cmake](cmake/IncludeLLVM.cmake#L29).

cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCUDA_TILE_USE_LLVM_INSTALL_DIR=/path/to/llvm/install

Python Bindings

CUDA Tile provides Python bindings for programmatic IR manipulation (disabled by default). To enable them, add the -DCUDA_TILE_ENABLE_BINDINGS_PYTHON=ON flag to your cmake configuration:

cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCUDA_TILE_ENABLE_BINDINGS_PYTHON=ON

When building MLIR/LLVM from sources, MLIR Python bindings will be automatically enabled. However, when using pre-built LLVM libraries, you must ensure they were built with -DMLIR_ENABLE_BINDINGS_PYTHON=ON.

Ccache

To build with ccache enabled, add -DCUDA_TILE_ENABLE_CCACHE=ON to your cmake configuration:

cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCUDA_TILE_ENABLE_CCACHE=ON

When building LLVM from sources, this setting is automatically propagated to the LLVM build.

Testing

CUDA Tile uses LLVM's lit testing infrastructure for comprehensive testing. Testing is disabled by default. Enable it by adding -DCUDA_TILE_ENABLE_TESTING=ON to your cmake configuration. To run the test suite:

cmake --build build --target check-cuda-tile

Integrating CUDA Tile Into Your Project

CUDA Tile can be integrated into your project in two ways, depending on your build system and requirements.

Option 1: Using Pre-built CUDA Tile Libraries

To use pre-built CUDA Tile libraries in your project, include the necessary headers and link against the required libraries based on your use case. For example:

include_directories(${CUDA_TILE_INSTALL_DIR}/include)

# CUDA Tile dialect
target_link_libraries(your_target PRIVATE
CudaTileDialect # CUDA Tile dialect operations and types
)

# Bytecode support.
target_link_libraries(your_target PRIVATE
CudaTileBytecodeReader # Read bytecode format
CudaTileBytecodeWriter # Write bytecode format
)

Option 2: Integrating CUDA Tile Sources

To build CUDA Tile from source as part of your project:

1. Integrate CUDA Tile sources into your project with CMake's FetchContent, Git submodules, or any other integration method. Example using FetchContent:

include(FetchContent)

# Define CUDA Tile directories
set(CUDA_TILE_SOURCE_DIR...

Excerpt shown — open the source for the full document.

Notability

Cautious optimism about CUDA Tile IR open-source, tempered by fears of vendor lock-in.

NVIDIA has a repo signal matching infrastructure.