Implement WebGPU subgroup-size-control infrastructure - #32056
Merged
Jiajia Qin (qjia7) merged 2 commits intoAug 17, 2026
Merged
Conversation
Add support for the WebGPU subgroup-size-control extension, which allows compute pipelines to request a fixed subgroup size via WGSL @subgroup_size(N) attribute. As an example, the MatMulNBits kernel has been enforced to use a subgroup size of 32 on Intel.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Jie Chen (jchen10)
marked this pull request as draft
August 13, 2026 05:52
Contributor
Author
Jie Chen (jchen10)
marked this pull request as ready for review
August 14, 2026 01:11
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support in the WebGPU EP for the subgroup-size-control feature so WGSL compute entry points can request a fixed subgroup size via @subgroup_size(N), and wires that through program configuration, shader generation, and cache keys. It also applies the new capability to enforce subgroup size 32 for the WebGPU MatMulNBits subgroup-matrix path on Intel adapters.
Changes:
- Request
wgpu::FeatureName::SubgroupSizeControlduring device creation when available. - Add
ProgramBase::SetSubgroupSize()/SubgroupSize()and include subgroup size in shader generation (enable subgroup_size_control;+@subgroup_size(...)) and the program cache key. - Apply Intel-specific subgroup size 32 selection in
subgroup_matrix_matmul_nbits.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| onnxruntime/core/providers/webgpu/webgpu_context.cc | Requests SubgroupSizeControl feature when the adapter supports it. |
| onnxruntime/core/providers/webgpu/shader_helper.cc | Validates subgroup-size requests and emits WGSL feature enable + @subgroup_size. |
| onnxruntime/core/providers/webgpu/program.h | Adds subgroup-size API surface to ProgramBase. |
| onnxruntime/core/providers/webgpu/program.cc | Implements SetSubgroupSize and initializes the new member. |
| onnxruntime/core/providers/webgpu/program_cache_key.cc | Extends program cache key to include subgroup-size overrides. |
| onnxruntime/contrib_ops/webgpu/quantization/subgroup_matrix_matmul_nbits.cc | Enforces subgroup size 32 on Intel when supported. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jiajia Qin (qjia7)
approved these changes
Aug 14, 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.
Add support for the WebGPU subgroup-size-control extension, which allows compute pipelines to request a fixed subgroup size via WGSL @subgroup_size(N) attribute. As an example, the MatMulNBits kernel has been enforced to use a subgroup size of 32 on Intel.