-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Dp4MatMulNBits accuracy level 4 matmul for WebGPU EP #23365
Open
sushraja-msft
wants to merge
16
commits into
main
Choose a base branch
from
user/sushraja/dp4_matmul
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+323
−1
Conversation
This file contains 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
sushraja-msft
changed the title
Dp4MatMulNBits low accuracy matmul for WebGPU EP
WIP: Dp4MatMulNBits low accuracy matmul for WebGPU EP
Jan 14, 2025
sushraja-msft
changed the title
WIP: Dp4MatMulNBits low accuracy matmul for WebGPU EP
WIP: Dp4MatMulNBits accuracy level 4 matmul for WebGPU EP
Jan 17, 2025
…79s for 500 tk prompt. 126tps or 7.9s for 1k prompt. On latest driver around 140tps for 500tk
…et because model is not made with accuracy level 4.
no subgroup Prompt processing (time to first token): avg (us): 4.11989e+06 avg (tokens/s): 121.605 with subgroup Prompt processing (time to first token): avg (us): 2.77983e+06 avg (tokens/s): 180.227
…ing the write out of lane output.
sushraja-msft
force-pushed
the
user/sushraja/dp4_matmul
branch
from
January 17, 2025 20:23
0dd9e67
to
73ee5d1
Compare
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.
Description
This change implements accuracy level 4 - quantize A to int8 matmul for the WebGPU EP. The matmul kernel here uses DP4A for matrix multiplication, in order to keep the DP4A fed co-operative matrix multiplication is implemented which preloads the row/col into local variables before the multiplication operation.
Credits to @qjia7 for help with the quantizer shader.
Performance metrics on intel ADL/TGL GPU.
This kernel is 2.10x faster than its F16 counterpart for a 500 token prefill. Previous prefill record is 86tks/s.
In order to support devices with subgroup size 8/32, a no subgroup version of the same shader is included. Performance is slower than the subgroup version on ADL.