Skip to content

Add native CPU backend and kernel autotuning - #3

Merged
fschlimb merged 7 commits into
mainfrom
backend
Nov 9, 2026
Merged

fschlimb merged 7 commits into
mainfrom
backend

Conversation

@fschlimb

@fschlimb fschlimb commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

This PR adds an experimental CPU backend for running cuTile kernels on Linux hosts, including NumPy-compatible arrays and CPU PyTorch tensors. Select it with ct.set_backend("cpu"); custom backends can be provided through the Backend protocol. CPU launches are synchronous, and their OpenMP thread count can be configured with ct.backend_options.

The backend interecepts TileIR and compiles them through tileir-to-mlir and upstream MLIR passes. It caches compiled kernels, and reuses cached launch argument packing for supported inputs. The PR also adds ct.autotune, which benchmarks configurations per input layout and reuses the best choice for kernels and multi-kernel factories.

CPU samples and backend/compiler tests are included. The CPU backend requires a separate CUTILE_BUILD_VARIANT=cpu build and is experimental; performance and correctness should be evaluated for each workload.

@fschlimb
fschlimb merged commit edc0fc8 into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant