Vulkan: use the 1x1 depthwise output tile for 5x5 kernels on Mali too - #22784
Open
msluszniak wants to merge 1 commit into
Open
Vulkan: use the 1x1 depthwise output tile for 5x5 kernels on Mali too#22784msluszniak wants to merge 1 commit into
msluszniak wants to merge 1 commit into
Conversation
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.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22784
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.
cc @SS-JIA @manuelcandales @digantdesai @cbilgin