Caten is a Python-based Polyhedral Compiler framework designed for deep learning and high-performance computing education and experimentation. It provides Python bindings for the Integer Set Library (ISL) and high-level abstractions for tensor scheduling and optimization.
Caten aims to bridge the gap between high-level tensor operations (like in PyTorch/NumPy) and low-level loop optimizations (Tiling, Fusion, Vectorization). By leveraging the Polyhedral Model, Caten allows users to:
- Visualize and manipulate loop structures as mathematical objects (Schedule Trees).
- Perform complex transformations like Conv+Pool Fusion or Symbolic Tiling using a Pythonic API.
- Generate optimized code for various backends (CPU, CUDA, Metal).
caten.isl: Auto-generated, type-safe Python bindings for ISL. No manual C-types management required.caten.polyhedral(Planned): A high-level DSL for schedule construction and manipulation.- Implicit Context: ISL context is managed automatically; no boilerplate code.
- Operator Overloading: Use standard Python operators (
|,&,-,+) for set/map operations.
- Project Overview & Architecture
- Polyhedral Loop Transformation Spec
- IR & Class Design
- ISL API Coverage
Check out examples/isl_tutorial.ipynb for a hands-on introduction to using ISL bindings in Python.
Requirements: libisl must be installed (e.g., brew install isl).
# Clone the repository
git clone https://github.com/hikettei/Caten.py.git
cd Caten.py
# Install dependencies
uv sync- ISL Bindings: Complete
caten.isl. - Polyhedral DSL: Implement
caten.polyhedral. - IR & Kernel: Implement
caten.opsandcaten.kernel. - Runtime & Renderer: Code generation for CPU/C.
- Auto-Scheduler: Basic search for optimal schedules.
MIT