Skip to content

Commit ccc40bc

Browse files
authored
Elegant Loop Fusion Method (#23)
1 parent fcd9bb5 commit ccc40bc

19 files changed

+6917
-160
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ help:
99
test: ## Runs test harness
1010
PYTHONPATH=. $(UV) run ruff check .
1111
PYTHONPATH=. $(UV) run mypy ./caten
12-
PYTHONPATH=. $(UV) run python -m pytest ./test
12+
PYTHONPATH=. $(UV) run python -m pytest ./test -s

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
**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)](https://libisl.sourceforge.io/) and high-level abstractions for tensor scheduling and optimization.
44

5+
## Usage
6+
7+
Everything is `caten/ir.py`.
8+
9+
```python
10+
import caten.ir as ir
11+
12+
outer = ir.Band((ir.Range(10, name="gid0"), ir.Range(10, name="gid1")))
13+
inner = ir.Band((ir.Range(10, name="gid2")))
14+
15+
i, j, k = outer[0], outer[1], inner[0] # Dims
16+
17+
18+
acc = ir.Polyhedral.schedule(inner, Store(...), fuse=True)
19+
out = ir.Polyhedral.schedule(outer, Store(...), fuse=True)
20+
print(out)
21+
```
22+
23+
TODO:
24+
25+
- [ ] Node: Equality or Inequality which is a subclass of Constraint.
26+
- [ ] Extend Fourier-Motzkin
27+
- [ ] test/test_union_map.py
28+
- [ ] Rewrite Everything in EGraph
29+
- Validity Computation
30+
- print("Profiling ...") in EGraph
31+
532
## Vision
633

734
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:
@@ -48,7 +75,3 @@ uv sync
4875
3. [ ] **IR & Kernel**: Implement `caten.ops` and `caten.kernel`.
4976
4. [ ] **Runtime & Renderer**: Code generation for CPU/C.
5077
5. [ ] **Auto-Scheduler**: Basic search for optimal schedules.
51-
52-
## License
53-
54-
MIT

caten/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
from .simplifier import * # noqa: F403, I001
33
from .tensor import * # noqa: F403, I001
44
from .runtime import cpu # noqa: I001, F401
5+
from .viz import render, to_dot # noqa: I001, F401

0 commit comments

Comments
 (0)