webgpu: Optimize DP4A SmallM MatMulNBits tiling#27910
Merged
Conversation
Change default DP4A SmallM tile parameters from tile_size_k_vec=16, tile_size_n=32 to tile_size_k_vec=32, tile_size_n=4, increasing K-parallelism (32 threads along K vs 16) at the cost of fewer concurrent B rows (4 vs 32). This was previously Intel-only and is now the default for all vendors. On Qualcomm, improving token generation from ~20 tps to ~25 tps. Changes: - dp4a_matmul_nbits.cc: Default tile params to k_vec=32, tile_n=4; remove Intel-specific override (now redundant).
guschmue
approved these changes
Mar 31, 2026
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.
This pull request adjusts the tiling strategy for small matrix sizes in the DP4A matmul kernel. The changes are aimed at improving performance and compatibility, especially for specific GPU vendors.
On Qualcomm, improving token generation from ~20 tps to ~25 tps.