Repository navigation
Commit 94a7536
Vulkan: use the 1x1 depthwise output tile for 5x5 kernels on Mali too
The 3x3 depthwise shader already drops to a 1x1 output tile on Mali. The 5x5 one
kept the default 4x2 tile, so each invocation held 8 accumulators and gathered a
separate 25 tap window for every one of them. That spills, and the cost is easy
to see next to a 3x3 in the same model: a 5x5 dispatch covering 6000 work items
took 4.6 ms while a 3x3 covering 20000 took 0.27 ms, roughly 57x the time per
work item for 2.8x the arithmetic.
Same rule as 3x3, so Adreno and every other device are untouched.
Measured on a Mali-G76 (Galaxy S10+), fp16, interleaved GPU timestamps over 3 to
4 rounds. Depthwise convolution time, median:
| model | before | after |
| --- | --- | --- |
| ssdlite320_mobilenet_v3_large | 19.05 ms | 12.08 ms |
| lraspp_mobilenet_v3_large | 15.04 ms | 11.49 ms |
| deeplabv3_mobilenet_v3_large | 14.93 ms | 11.52 ms |
Ranges do not overlap on any of the three. The individual 5x5 dispatches go from
4.52-4.68 ms to 1.42-1.46 ms (3.2x) and from 0.87-1.12 ms to 0.34-0.44 ms (2.6x).
Output is bit identical before and after.
(cherry picked from commit a344e8a)1 parent 1802bcf commit 94a7536
2 files changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
90 | | - | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
0 commit comments