Repository navigation
webgpu : add MEAN support - #31591
Merged
Merged
Conversation
Assisted-by: Codex
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
yomaytk
approved these changes
Nov 4, 2026
yomaytk
left a comment
Member
There was a problem hiding this comment.
WebGPU changes look fine, thanks! Also, fixing the existing bug in sum_rows shader is nice.
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.
Overview
Add WebGPU support for F32
MEANwith contiguous rows, including offset views and strided higher dimensions. Reuse the row-sum shader and correct its output indexing for 2D dispatch.Includes correctness and performance tests, plus updated operation support documentation. Related to #14909.
Additional information
Tested on NVIDIA L4 with native WebGPU.
test-backend-ops test -b WebGPU -o MEAN,SUM_ROWS,SUM test-backend-ops perf -b WebGPU -o MEANMEANcases passed against the CPU reference; all 38 supported reduction cases passed together.SUM_ROWSregression fails on upstream and passes with this change.Full-model
llama-benchresults with Gemma3n E2B/E4B Q4_K_M. Five runs per version, alternating execution order, with in-process warmup. Both versions used the same weights, two CPU threads, batch/microbatch 512 and flash attention off. Model loading and warmup are excluded. Times are mean +/- SD for separate prompt-processing and decoding workloads.Both models execute
MEANin the first 10 FFN layers. Traces confirm all 1,280 calls in 128 decode steps move from CPU to WebGPU.Requirements