Vulkan: halve the pointwise conv spatial tile - #22781
Open
msluszniak wants to merge 1 commit into
Open
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22781
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
msluszniak
force-pushed
the
ms/vulkan-pw-tile-m2
branch
2 times, most recently
from
September 13, 2026 11:27
22f9761 to
41e4a5a
Compare
conv2d_pw_tiled is generated only at TILE_M=4. TILE_M=2 is faster on every model and both GPU vendors measured, and the tile size is otherwise unchanged, so this just moves the generated variant. Mali-G76 (Galaxy S10+), conv2d_pw / whole-graph GPU, median of interleaved rounds: lraspp-mobilenet-v3-large fp16 @520 71.5 -> 43.8 ms (1.63x) and 99.3 -> 71.7 ms (1.38x); selfie-segmentation fp16 @256 4.21 -> 2.32 ms (1.82x) and 8.46 -> 6.54 ms (1.29x). Adreno 840 (Galaxy S26 Ultra): lraspp 5.35 -> 5.00 ms (1.07x) and 10.95 -> 10.59 ms (1.03x); selfie 0.530 -> 0.435 ms (1.22x) and 1.050 -> 0.956 ms (1.10x); PP-OCRv6 fp16 neutral at 1.00x / 0.99x. Going the other way is much worse, which is what makes 2 the optimum rather than a local accident: TILE_M=1 is 0.97x, TILE_M=8 0.24x, TILE_N4=2 0.16x and TILE_N4=4 0.06x on Mali. Output is bit identical at every tile size tested.
msluszniak
force-pushed
the
ms/vulkan-pw-tile-m2
branch
from
September 13, 2026 21:22
41e4a5a to
bf7ef40
Compare
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.
Summary
conv2d_pw_tiledis generated only atTILE_M=4.TILE_M=2is faster on every model and both GPU vendors I measured, so this changes the generated variant and the matching global workgroup size. Nothing else about the shader, the tiling logic or the math changes.Measurements
Arms interleaved within one session, per-dispatch GPU timestamps from the query pool, median of interleaved rounds. Mali-G76 is a Galaxy S10+, Adreno 840 a Galaxy S26 Ultra.
conv2d_pwNo regression anywhere; the Mali gain is the large one.
Why 2 and not something else
The tile size was swept, not guessed. On Mali-G76 with lraspp, relative to the current
TILE_M=4:conv2d_pw2 is a genuine optimum: 1 gives each invocation too little work, and anything wider falls off a cliff. The magnitude of the wide variants (4x to 16x, not tens of percent) points at register spilling rather than occupancy, and it reproduces in both dispatch shapes I have - selfie is small-
N4/large-M, lraspp is large-N4/small-M.Note
TILE_M4is left at 1. It is declared in this shader's parameter list but none of the includesconv2d_pw_tiled.glslactually pulls in reference it, so it has no effect here.Correctness
Output is bit identical to the current shader at every tile size tested, on both devices,
max |diff| = 0.0.cc @SS-JIA @manuelcandales @digantdesai @cbilgin