Commit e07cd13
authored
Demo TinyViT compatibility with tiled Siracusa (#124)
### Key Changes:
1. **TinyViT Demo Support**: Successfully enables minimal TinyViT model on tiled Siracusa platform (running on as low as **4kB L1**!)
- New ReduceMean and Slice tiling constraints (But see #134 for its limitations)
- Added broadcasting handling and improved constraint logic for MatMul
- Changed to tanh approximation in the PULP GELU kernel
2. **Input Tiling for regular and DW Conv2D**: Feature enabling smaller L1 memory requirements
- Implemented input tiling on X and Y axes (not just channel-wise)
- Fixed padding computation using absolute offsets (now considering interior tiles for FP solution as well)
- Cleaned up constraints and reduced code duplication
- Added documentation explaining motivation for each constraint
3. **Bug Fixes**: Addresses critical bugs that would cause runtime failures
- Pointer Arithmetic Bugs - Byte offsets were being used with typed pointer arithmetic, causing 4x overflow for float32 types.
- Buffer Name Parsing Bug - A check matched intermediate buffers containing "input" or "output" in their names, causing IndexError.
4. **Test Coverage**: Adds 12+ new test configurations to CI
- Added minimal TinyViT to all test matrices (single/double buffer, different memory levels)
- Ohterwise, focus on updated Conv operators (regular & DW, with & without bias)
- Reduced L1 limit of existent tests, enabled by new input conv tiling
- Added skip connection test for tiled Siracusa
## Added
- Support for input and bias tiling for PULP FP regular and DW conv 2D.
- PULP ReduceMean and Slice tile constraints.
- Broadcast support for MatMul tiling constraints
- CI tests for tiled Siracusa FP regular and DW conv 2D, with and without bias, for skip connections, and for the demo version of TinyViT.
- Documentation for PULP FP regular and DW conv 2D and MatMul tile constraints.
## Changed
- Decreased L1 maximal memory limit for CI pipeline tests where compatible thanks to the implementation of Conv2D input tiling support.
## Fixed
- Fixed PULP FP32 regular and DW Conv2D, and MatMul tile constraints.
- Fixed type casting for tiling code generation.
- Fixed bug in buffer name identification in code generation for tests with L3 default memory level.
- Fixed PULP GELU kernel to use tanh approximation.1 parent 4795932 commit e07cd13
File tree
19 files changed
+846
-194
lines changed- .github/workflows
- DeeployTest/testUtils
- Deeploy
- Targets/PULPOpen
- TileConstraints
- TilingExtension
- CodeTransformationPasses
- TargetLibraries/PULPOpen/src
19 files changed
+846
-194
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
51 | 59 | | |
52 | | - | |
53 | 60 | | |
54 | 61 | | |
| 62 | + | |
| 63 | + | |
55 | 64 | | |
56 | 65 | | |
57 | 66 | | |
| |||
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
81 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
82 | 99 | | |
83 | | - | |
84 | 100 | | |
85 | 101 | | |
| 102 | + | |
| 103 | + | |
86 | 104 | | |
87 | 105 | | |
88 | 106 | | |
| |||
117 | 135 | | |
118 | 136 | | |
119 | 137 | | |
120 | | - | |
| 138 | + | |
121 | 139 | | |
122 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
123 | 143 | | |
124 | 144 | | |
125 | 145 | | |
| |||
148 | 168 | | |
149 | 169 | | |
150 | 170 | | |
151 | | - | |
| 171 | + | |
152 | 172 | | |
153 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
154 | 176 | | |
155 | 177 | | |
156 | 178 | | |
| |||
186 | 208 | | |
187 | 209 | | |
188 | 210 | | |
189 | | - | |
| 211 | + | |
190 | 212 | | |
191 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
192 | 216 | | |
193 | 217 | | |
194 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
| 483 | + | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
0 commit comments