You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project aims to integrate TTL (Template Tiling Library) with MLIR to create an optimized pipeline from C code to TTL-optimized C code. The pipeline includes affine loop tiling and dialect conversions, with a focus on optimizing operations like sigmoid.
5
+
6
+
## Current Pipeline
7
+
```
8
+
C code with TTL DSL → MLIR → Optimized MLIR → EmitC → C code
9
+
```
10
+
11
+
## Technical Implementation
12
+
13
+
### Version Compatibility
14
+
- Using LLVM 20 for MLIR pipeline
15
+
- Polygeist (C → MLIR) is on LLVM 18
16
+
- Solution: Manually removing incompatible parts
17
+
- This is a manageable limitation for now
18
+
19
+
### Type System Integration
20
+
- Minor issue with unrealized conversion casts
21
+
- Can be fixed with a simple pass if needed
22
+
- Not a critical blocker
23
+
24
+
### TTL Integration Strategy
25
+
Two possible approaches:
26
+
1. Generate direct function calls to TTL's existing functions
27
+
2. Create a TTL dialect (if needed)
28
+
- Currently leaning towards function calls for simplicity
29
+
- Decision pending based on future requirements
30
+
31
+
## Next Steps
32
+
33
+
### 1. Frontend Definition
34
+
- Define Polygeist as the frontend
35
+
- Its output will feed into TTL optimizer passes (like tiling)
36
+
- Currently supporting minimal 2D loops and array access
37
+
- Will expand TTL DSL features in the frontend
38
+
39
+
### 2. Backend Generation
40
+
- Develop pipeline to generate TTL-specific code
41
+
- Focus on efficient memory operations and tiling
42
+
43
+
### 3. TTL DSL Development
44
+
- Currently minimal: 2D loops and array access
45
+
- Will expand based on requirements
46
+
- Starting with sigmoid as a test case
47
+
48
+
### 4. Immediate Focus
49
+
- Optimizing sigmoid function
50
+
- Using it as a test case for the complete pipeline
51
+
- Will use learnings to expand to other operations
52
+
53
+
## Technical Decisions
54
+
- Keeping things simple with function calls rather than new dialect
55
+
- Managing version compatibility manually for now
56
+
- Type conversion issues are minor and can be addressed if needed
57
+
58
+
## Current Limitations
59
+
1. Version mismatch between Polygeist and MLIR pipeline
60
+
2. Minimal TTL DSL features in frontend
61
+
3. Focus on sigmoid optimization only
62
+
63
+
## Future Work
64
+
1. Expand TTL DSL features
65
+
2. Add more optimization passes
66
+
3. Support more complex operations
67
+
4. Evaluate need for TTL dialect
68
+
5. Consider automating version compatibility fixes
0 commit comments