Commit 1a8ffa3
committed
Phase-2: unblock VariableBuffer promotion (IndexError fix + IO/arena filter)
Two structural fixes that together let PromoteTensorsToL2Greedy run
without --promoteOnlyConstants:
1. TilerExtension.computeMemoryMap was indexing
tilingSolution[idx].nodeConstraints[0] for every entry of the
combined memoryMap, which is inner_scheduler_entries (one per
pattern, len == len(tilingSolution)) followed by exactly one
outer_scheduler entry holding global/constant-style buffers. The
outer entry has no per-pattern node constraint. With
--promoteOnlyConstants the outer L2 entry was empty so the
'if len(...) != 0' check skipped it; promoting a VariableBuffer
into L2 populated the outer entry and the loop crashed with
IndexError at tilingSolution[len(tilingSolution)].nodeConstraints[0].
Pass None for the outer entry, same convention as the
default-memory-level branch already used.
2. PromoteTensorsToL2Greedy was including graph IO tensors (input_0,
output_0) and the MEMORYARENA_L3 meta-buffer in the candidate set
when --promoteOnlyConstants was off. Promoting those produced a
binary that crashed gvsoc with 'Platform returned an error
(exitcode: 1)' (the runtime contract for IO tensors and the arena
pointer requires a fixed memory level). Filter them out at
candidate-selection time.
End-to-end verified on the Phase-1 sweep, 2 KB cap kept on:
* IC100: const 2 389 072 cyc / var 2 389 051 cyc / PASS
* AD200: const 509 738 cyc / var 509 464 cyc / PASS
* ml1: const 3 475 925 cyc / var 3 475 840 cyc / PASS
* CCT_2: const 309 860 361 / var 309 890 036 / PASS
* miniMobileNet @ 16 KB L2: var 134 946 cyc / PASS
Cycle Δ between modes is in noise because the Phase-1 2 KB cap also
filters out VariableBuffer activations (all > 2 KB on these models).
The structural blocker is now removed; the practical perf benefit of
VariableBuffer promotion (where reuse > 1 lets cycle-aware actually
outrank smallest) awaits the codegen-side fix that lets the cap be
lifted.1 parent 5b26788 commit 1a8ffa3
2 files changed
Lines changed: 34 additions & 4 deletions
File tree
- Deeploy
- MemoryLevelExtension/OptimizationPasses
- TilingExtension
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
183 | 196 | | |
184 | 197 | | |
185 | 198 | | |
| |||
192 | 205 | | |
193 | 206 | | |
194 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
195 | 214 | | |
196 | 215 | | |
197 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
531 | 539 | | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
536 | 547 | | |
537 | 548 | | |
538 | 549 | | |
| |||
0 commit comments