Commit 2617205
fix(promote): re-enable graph I/O promote with optimizer sharing guard
The OOB crash (commit f50ac0f) was caused by the optimizer network
sharing weight buffer pointers with the training network. When
PromoteTensorsToL2 moved a training weight to L2 (pi_l2_malloc), the
optimizer's closure_L3 used the shared L2 pointer as the ext argument
to pi_cl_ram_copy_2d (HyperRAM DMA), which is only valid for L3
addresses → out-of-bound crash.
Fix: _patch_shared_buffers in codeGenerateTraining.py now checks
whether the training buffer was allocated with pi_l2_malloc (L2). If
so, it keeps the optimizer's own cl_ram_malloc allocation instead of
sharing, so the optimizer's L3 DMA closures see a valid L3 address.
The training harness's l3_aware_copy handles the L2→L3 data transfer
at runtime.
Also re-enables the graph I/O promote loop in MemoryLevelAnnotation-
Passes.py (was disabled by f50ac0f).
Results (full promote: const + activation + graph I/O):
MobileNetV1: 332M cycles (-19.9%), 0/4 PASS
CCT: 450M cycles (-14.8%), 4/4 (baseline match)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f50ac0f commit 2617205
2 files changed
Lines changed: 18 additions & 3 deletions
File tree
- DeeployTest/testUtils
- Deeploy/MemoryLevelExtension/OptimizationPasses
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
| 506 | + | |
| 507 | + | |
507 | 508 | | |
508 | 509 | | |
509 | 510 | | |
| |||
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
561 | 571 | | |
562 | 572 | | |
563 | 573 | | |
| 574 | + | |
| 575 | + | |
564 | 576 | | |
565 | 577 | | |
566 | 578 | | |
| 579 | + | |
| 580 | + | |
567 | 581 | | |
568 | 582 | | |
569 | 583 | | |
| |||
887 | 901 | | |
888 | 902 | | |
889 | 903 | | |
890 | | - | |
| 904 | + | |
| 905 | + | |
891 | 906 | | |
892 | 907 | | |
893 | 908 | | |
| |||
0 commit comments