Enable WebGPU subgroup matrix path for WASM builds - #32269
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Enables subgroup-matrix acceleration for WebGPU WASM builds by removing WASM guards and updating Dawn.
Changes:
- Enables subgroup-matrix feature discovery and shaders on WASM.
- Enables optimized MatMul, Gemm, and quantized kernels.
- Updates Dawn to
v20260818.211311.
Reviewed changes
Copilot reviewed 18 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
webgpu_context.h |
Exposes subgroup configuration on WASM. |
webgpu_context.cc |
Enables feature discovery and adapter configuration. |
subgroup_matrix_tiling_selector.h/.cc |
Enables tiling selection on WASM. |
intel_device_info.h/.cc |
Enables Intel device metadata on WASM. |
shader_helper.cc |
Enables subgroup-matrix WGSL extensions. |
subgroup_matrix_matmul.h/.cc |
Enables optimized MatMul implementation. |
subgroup_matrix_gemm.h/.cc |
Enables optimized Gemm implementation. |
subgroup_matrix_config.h/.cc |
Enables configuration validation. |
matmul.cc |
Activates subgroup MatMul dispatch. |
gemm.cc |
Activates subgroup Gemm dispatch. |
compute_context.h |
Exposes subgroup configuration to kernels. |
subgroup_matrix_matmul_nbits.h/.cc |
Enables quantized subgroup kernels. |
matmul_nbits.cc |
Activates quantized subgroup dispatch. |
matmul_nbits_qkv.cc |
Enables subgroup eligibility for QKV. |
matmul_nbits_mlp.cc |
Enables subgroup eligibility for MLP. |
cmake/deps.txt |
Updates the Dawn dependency. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Remove the `#if !defined(__wasm__)` guards around the subgroup-matrix MatMul/GEMM path, its Intel tiling selector, and the WGSL `enable chromium_experimental_subgroup_matrix;` emission. Bump Dawn to v20260818.211311, the first tag whose dawn.json tags the subgroup-matrix API for emdawnwebgpu (CL 331255), so AdapterPropertiesSubgroupMatrixConfigs and friends exist under Emscripten. That Dawn revision removes the subgroupMatrixLoad/Store overloads taking a boolean `col_major`, so convert all 185 call sites across the six core and contrib templates to the majorness template form (`<T, row_major>` / `<col_major>`). Semantics are unchanged: majorness selects the same index-to-memory mapping the boolean did.
Jie Chen (jchen10)
force-pushed
the
sgmm_wasm
branch
from
August 26, 2026 03:07
e3c8c29 to
01c0671
Compare
Jiajia Qin (qjia7)
previously approved these changes
Aug 26, 2026
The subgroup-matrix templates moved to Dawn's majorness template form, which changes the generated output that tools/python/wgsl_template/test/test_in_tree_smoke.py compares against checked-in goldens, so InTreeTemplatesGoldenTest was failing in CI. Regenerated with `UPDATE_WGSL_GOLDEN=1 python wgsl_template/test/run_tests.py`.
Jiajia Qin (qjia7)
approved these changes
Aug 28, 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.
The subgroup-matrix code was compiled out of WASM builds via
#if !defined(__wasm__)guards, because emdawnwebgpu did not expose the Dawn subgroup-matrix API.Bump the Dawn dependency to v20260818.211311, which includes the needed support for the Dawn subgroup-matrix API in WASM builds.