Skip to content

webgpu: add POOL_2D support - #32250

Merged
ggerganov merged 4 commits into
ggml-org:masterfrom
SS1618:webgpu_pool2d
Nov 19, 2026
Merged

ggerganov merged 4 commits into
ggml-org:masterfrom
SS1618:webgpu_pool2d

Conversation

@SS1618

@SS1618 SS1618 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Added WebGPU support for POOL_2D with contiguous F32 input.

Additional information

Tested on an NVIDIA GeForce RTX 4090 with Dawn WebGPU.

test-backend-ops test -o POOL_2D -b WebGPU
test-backend-ops perf -o POOL_2D -b WebGPU

All 144 tests pass.

Used llama-mtmd-cli on gemma-3 4B IT with Q4_K_M weights and mmproj f16 to get a rough comparison against the baseline.

Ran 10 measured runs for baseline v. this PR. The measurement is image encoding time.

llama-mtmd-cli -hf ggml-org/gemma-3-4b-it-GGUF --image tools/mtmd/test-1.jpeg -p "Describe this image." -n 64 -ngl 99 -dev WebGPU -mmdev WebGPU -fa off -t 2 -tb 2 -c 1024 -b 512 -ub 512 -s 1234 --temp 0

Results:
Baseline: mean = 794.9 ms, std = 35.00 ms
PR: mean = 752.8 ms, std = 59.20 ms

Observed a 1.05x speedup.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES (used AI to help set up dependencies, catch syntax errors, find tools, and research).

@SS1618
SS1618 requested a review from a team as a code owner November 14, 2026 08:09
@ggml-gh-bot

ggml-gh-bot Bot commented Nov 14, 2026

Copy link
Copy Markdown

Hi @SS1618, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • AI-generated content: While code is allowed to be generated by AI, please write the PR description and commit messages on your own without the help of AI.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning WebGPU documentation Improvements or additions to documentation labels Nov 14, 2026
@SS1618

SS1618 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Please let me know if I should update my PR description or include additional metrics. I based the PR description and supporting evidence on other WebGPU op PRs since it's my first PR.

@yomaytk

yomaytk commented Nov 17, 2026

Copy link
Copy Markdown
Member

Thanks! Overall, the changes look good to me. Could you rebase onto master since two files have conflicts?

Please let me know if I should update my PR description or include additional metrics. I based the PR description and supporting evidence on other WebGPU op PRs since it's my first PR.

Basically, when you add support for new ops, it is better to show which models use them, and also some performance changes, so we can see the value of the new support. I think this PR already shows enough information.

@SS1618

SS1618 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@yomaytk rebased

@SS1618

SS1618 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@yomaytk sorry, I had to reformat to fit the formatting rules. Should be good to go now.

@yomaytk yomaytk added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Nov 19, 2026
@ggerganov
ggerganov merged commit 4db8b76 into ggml-org:master Nov 19, 2026
27 checks passed
Annieren pushed a commit to Annieren/llama.cpp-upstream that referenced this pull request Nov 23, 2026
* Shader, pipeline, and launcher

* Update docs and add newline to wgsl

* Formatting fixes
Nindaleth pushed a commit to Nindaleth/llama.cpp that referenced this pull request Nov 26, 2026
* Shader, pipeline, and launcher

* Update docs and add newline to wgsl

* Formatting fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. WebGPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants