Skip to content

webgpu : add COL2IM_1D support - #31708

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
LeON-Nie-code:preview/webgpu-col2im-1d
Nov 20, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
LeON-Nie-code:preview/webgpu-col2im-1d

Conversation

@LeON-Nie-code

Copy link
Copy Markdown
Contributor

Overview

Add WebGPU support for F32 COL2IM_1D, used by the Qwen3-TTS and PocketTTS waveform decoders. Each output gathers overlapping input columns without floating-point atomics.

Includes correctness and performance tests, offset-view and 2D-dispatch coverage, and updated operation support documentation. Related to #14909.

Additional information

Tested on NVIDIA L4 with native WebGPU.

test-backend-ops test -b WebGPU -o COL2IM_1D
test-backend-ops perf -b WebGPU -o COL2IM_1D
  • All 16 supported F32 cases passed against the CPU reference, covering overlap, cropping, stride gaps, offset views and 16,777,217-element dispatch.
  • Release build of the test and TTS targets, targeted regression tests, clang-format 22 and EditorConfig checks passed.

Full TTS inference, 64 frames. Five runs per version, alternating execution order, with identical text, reference audio, seed and device settings. Times include reference-speaker encoding, prompt evaluation, generation and waveform decoding; model loading is excluded. Mean +/- SD.

Model Upstream (s) PR (s) Speedup
PocketTTS 1.158 +/- 0.035 0.838 +/- 0.075 1.38x
Qwen3-TTS 0.6B (Q4_K_M) 33.299 +/- 0.361 5.676 +/- 0.202 5.87x

Both versions produced byte-identical audio for each model. Traces confirm all COL2IM_1D executions moved from CPU to WebGPU: 32 for PocketTTS and 390 for Qwen3-TTS across each complete diagnostic run.

Qwen3-TTS benefits substantially because its waveform decoder repeatedly uses COL2IM_1D; keeping these operations on the GPU avoids CPU fallbacks and associated transfer and synchronization overhead.

Requirements

@github-actions github-actions Bot added documentation Improvements or additions to documentation testing Everything test related ggml changes relating to the ggml tensor library for machine learning WebGPU labels Nov 5, 2026
@LeON-Nie-code
LeON-Nie-code marked this pull request as ready for review November 5, 2026 11:23
@LeON-Nie-code
LeON-Nie-code requested review from a team and ggerganov as code owners November 5, 2026 11:23
Copilot AI balanced review requested due to automatic review settings November 5, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

yomaytk commented Nov 10, 2026

Copy link
Copy Markdown
Member

Please rebase on top of master since ggml-webgpu.cpp has conflicts.

@LeON-Nie-code
LeON-Nie-code force-pushed the preview/webgpu-col2im-1d branch from 8d2df2a to 562b6a7 Compare November 10, 2026 01:42

@yomaytk yomaytk left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebGPU changes look good to me.

@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 10, 2026
@ggerganov

Copy link
Copy Markdown
Member

Need rebase

@ggerganov ggerganov removed the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Nov 11, 2026
@LeON-Nie-code
LeON-Nie-code force-pushed the preview/webgpu-col2im-1d branch 2 times, most recently from adbf0eb to 792e9cf Compare November 18, 2026 05:24
@LeON-Nie-code

Copy link
Copy Markdown
Contributor Author

WebGPU changes look good to me.

Thanks for the review! I’ve rebased onto master and resolved the conflicts. Could you approve the CI runs?

@yomaytk

yomaytk commented Nov 19, 2026

Copy link
Copy Markdown
Member

@LeON-Nie-code Sorry, could you rebase again since there were other CI failures?

@LeON-Nie-code
LeON-Nie-code force-pushed the preview/webgpu-col2im-1d branch from 792e9cf to 7683cab Compare November 19, 2026 09:41
@LeON-Nie-code

Copy link
Copy Markdown
Contributor Author

@LeON-Nie-code Sorry, could you rebase again since there were other CI failures?

Rebased again. Could you approve the new CI runs? Thanks

@ggerganov ggerganov added merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. and removed merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. labels Nov 19, 2026
@yomaytk

yomaytk commented Nov 19, 2026

Copy link
Copy Markdown
Member

Ah, maybe this conflits with #32250. Could you rebase again?

@LeON-Nie-code
LeON-Nie-code force-pushed the preview/webgpu-col2im-1d branch from 7683cab to 0e7287c Compare November 19, 2026 12:50
@LeON-Nie-code

Copy link
Copy Markdown
Contributor Author

Ah, maybe this conflits with #32250. Could you rebase again?

Rebased

@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
@LeON-Nie-code

Copy link
Copy Markdown
Contributor Author

Ah, maybe this conflits with #32250. Could you rebase again?

All NVIDIA WebGPU tests passed, but the process aborted on exit with a heap corruption error. couldn’t reproduce it on my L4. Could you rerun just the NVIDIA WebGPU job? Thanks!

@ggerganov
ggerganov merged commit 2d8d003 into ggml-org:master Nov 20, 2026
28 of 29 checks passed
@sanmai

sanmai commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

test-backend-ops -o COL2IM_1D is failing for me after this PR:

ggml-vulkan-push-constants.h:995: GGML_ASSERT(!src0 || get_misalign_bytes(ctx, src0) == 0) failed

I used llvmpipe, and I think it also failed on 5090 with the same error.

It fails where minStorageBufferOffsetAlignment is larger than 4.

@LeON-Nie-code

Copy link
Copy Markdown
Contributor Author

Thanks for catching this.

I reproduced it on my L4. Looks like Vulkan accepts the 4-byte-offset view but trips over the alignment check when it runs COL2IM_1D

@0cc4m

0cc4m commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

I'll look into fixing it.

Kidplayer666 pushed a commit to Kidplayer666/llama.cpp that referenced this pull request Nov 20, 2026
Annieren pushed a commit to Annieren/llama.cpp-upstream that referenced this pull request Nov 23, 2026
Nindaleth pushed a commit to Nindaleth/llama.cpp that referenced this pull request Nov 26, 2026
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. testing Everything test related WebGPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants