-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[WebGPU] Unify core implementations of GEMM and MatMul #24586
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
base: main
Are you sure you want to change the base?
[WebGPU] Unify core implementations of GEMM and MatMul #24586
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing it with a bunch of models that use Gemm |
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 5 pipeline(s). |
I see some shader compile issue for couple of models in MatMul. Let me try to isolate it. |
In HandleMaybeBiasForMatMul: if (has_bias) { Surprised that no unit test runs into it. |
With the issue above fixed locally, 90 model test now reports only numerical issues: Simplest model with numerical issues: |
Thanks for the callout!!! I will add some test cases to cover the scenario. Before there is only small matrix(M,N,K<8) with bias test case. |
Thanks for helping with the testing! I'll look into why there's a problem. |
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 5 pipeline(s). |
Thanks Guenther! I have fixed the numerical issue and add more test to cover this scenario. Could you help me to run the 90 model test again with the latest commit? |
seems like build break with the following error:
|
Thanks. Done |
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 5 pipeline(s). |
let me kick the 90 model test |
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 5 pipeline(s). |
90 model test looks good now |
|
Description
This PR extract core implementations into gemm_utils.cc which is used to generate shader both GEMM and Matmul ops. The core implemenations included scalar and vec4 versions of GEMM and Matmul.
Motivation and Context
There are many common codes for GEMM and Matmul, so we want to extra common code to unify their implementations.
