Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds WebGPU execution-provider support needed to run Qwen3.5 models by introducing two new contrib ops and wiring them into kernel registration.
Changes:
- Fixes boolean Expand vec4/bool-pack indexing in the WebGPU Expand shader generation.
- Adds WebGPU contrib kernels for
LinearAttentionandCausalConvWithState(C++ + WGSL templates) and registers them. - Implements fused recurrent linear attention and causal depthwise conv-with-state shaders for Qwen3.5-style decode/prefill.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| onnxruntime/core/providers/webgpu/tensor/expand.cc | Corrects boolx4 input offset calculation for vec4-path expand. |
| onnxruntime/contrib_ops/webgpu/webgpu_contrib_kernels.cc | Registers new WebGPU contrib kernels for LinearAttention and CausalConvWithState. |
| onnxruntime/contrib_ops/webgpu/bert/linear_attention.h | Declares LinearAttention kernel/program and update-rule parsing. |
| onnxruntime/contrib_ops/webgpu/bert/linear_attention.cc | Implements LinearAttention kernel setup, validation, dispatch, and shader templating. |
| onnxruntime/contrib_ops/webgpu/bert/linear_attention.wgsl.template | Adds fused linear attention WGSL implementation (incl. delta/gated-delta paths). |
| onnxruntime/contrib_ops/webgpu/bert/causal_conv_with_state.h | Declares CausalConvWithState kernel/program and activation parsing. |
| onnxruntime/contrib_ops/webgpu/bert/causal_conv_with_state.cc | Implements CausalConvWithState kernel setup, validation, and dispatch. |
| onnxruntime/contrib_ops/webgpu/bert/causal_conv_with_state.wgsl.template | Adds WGSL for depthwise causal convolution with optional state/bias/SiLU. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edgchen1
reviewed
Apr 8, 2026
hariharans29
reviewed
Apr 8, 2026
hariharans29
reviewed
Apr 8, 2026
hariharans29
previously approved these changes
Apr 8, 2026
edgchen1
reviewed
Apr 9, 2026
hariharans29
approved these changes
Apr 9, 2026
sanaa-hamel-microsoft
pushed a commit
that referenced
this pull request
Apr 21, 2026
webgpu support for qwen3.5, adding LinearAttention and CausalConvWithState ops based on this proposal: from onnx/onnx#7767 The model can be created with model builder from https://github.com/microsoft/onnxruntime-genai/blob/main/src/python/py/models/builder.py. For example for the text only flavor: ``` python builder.py -m Qwen/Qwen3.5-0.8B -o Qwen3.5-0.8B -e webgpu -p int4 --extra_options int4_accuracy_level=4 exclude_embeds=False ```
sanaa-hamel-microsoft
added a commit
that referenced
this pull request
Apr 24, 2026
Version bump to 1.25.1. This cherry-picks the following commits for the release: | Commit ID | PR Number | Commit Title | |-----------|-----------|-------------| | e532c21 | #27842 | linear attention signature | | 410f5a8 | #27752 | +rotemb, +rmsnorm, reshape->opset-25, transpose->opset-24 | | 0fedb26 | #27907 | Add LinearAttention and CausalConvState ops for Qwen3.5 | | 3ac6040 | #27996 | webgpu support for qwen3.5 | | c36c422 | #27998 | [WebGPU EP] Fuse QMoE 1-token decode path to reduce GPU dispatches | | 94f32ec | #27289 | [CORE]: Improve filesystem error messages during Linux device discovery | | dce77a3 | #28118 | Fix lack of auth on python packaging | --------- Co-authored-by: Akshay Sonawane <111780983+apsonawane@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: eserscor <erscor@microsoft.com> Co-authored-by: Sanaa Hamel <sanaahamel@microsoft.com> Co-authored-by: Guenther Schmuelling <guschmue@microsoft.com> Co-authored-by: Stephan Seitz <sseitz@nvidia.com> Co-authored-by: Jiajia Qin <jiajiaqin@microsoft.com>
This was referenced Apr 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.
webgpu support for qwen3.5, adding LinearAttention and CausalConvWithState ops based on this proposal:
from onnx/onnx#7767
The model can be created with model builder from https://github.com/microsoft/onnxruntime-genai/blob/main/src/python/py/models/builder.py.
For example for the text only flavor: