Commit 45694c4
committed
Fix DW ConvGradX weight tile size (L1 OOB in MobileNet backward)
DWConvGradX2DTileConstraint shares serializeTilingSolution with the
regular-conv base class, which built the per-tile weight cube as
(Cout, dxCube.dims[1], P, Q). That is right for regular conv where
W[1] == Cin, but depthwise weight layout is [C, 1, P, Q]: dim 1 is
always 1 and the per-channel slice should track dim 0 (Cout == C).
For MobileNetV1 block_12 (C=256, 3x3 DW) the base formula produced a
2.36MB weight cube instead of the real 9KB, and the resulting DMA copy
flooded L1 past all 16 banks starting at bank offset 0x4000, crashing
the first backward pass.
Extract the weight-cube construction into a _make_weight_cube hook
on the base class and override it in DWConvGradX2DTileConstraint to
produce ([offset_c, 0, 0, 0], [c_size, 1, P, Q]). With this, MobileNet
training now runs 4 steps through gvsoc without OOB; ResNet8 (regular
conv only) is unaffected.1 parent a9b0242 commit 45694c4
1 file changed
Lines changed: 24 additions & 9 deletions
Lines changed: 24 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
272 | 282 | | |
273 | 283 | | |
274 | 284 | | |
| |||
371 | 381 | | |
372 | 382 | | |
373 | 383 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
383 | 387 | | |
384 | 388 | | |
385 | 389 | | |
| |||
526 | 530 | | |
527 | 531 | | |
528 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
529 | 544 | | |
530 | 545 | | |
531 | 546 | | |
| |||
0 commit comments