Skip to content

vulkan: add col2im_1d op#24425

Merged
ServeurpersoCom merged 4 commits into
ggml-org:masterfrom
ServeurpersoCom:ggml/vulkan-col2im_1d
Jun 16, 2026
Merged

vulkan: add col2im_1d op#24425
ServeurpersoCom merged 4 commits into
ggml-org:masterfrom
ServeurpersoCom:ggml/vulkan-col2im_1d

Conversation

@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Overview

vulkan: add GGML_OP_COL2IM_1D

Vulkan backend follow-up to the CPU op ( #24206 ), same formulation: a gather shader, one invocation per output, each reading only the ceil(K/stride) columns that scatter into it. F32 / F16 / BF16, the BF16 path stores as uint16_t and converts through bf16_to_fp32 so it runs even on devices without native bf16.
A 2D dispatch maps invocations directly to (t_out, oc), so there is no flat index decomposition and no div/mod to begin with, unlike the CUDA side.

Additional information

Validated against the test-backend-ops grid merged with the CPU op, zero additional test code: 33/33 on Vulkan0 across the eight geometries and three types, plus the three perf entries. Wiring sits next to conv_transpose_1d: shader registration in vulkan-shaders-gen, pipelines, push constants, dispatch and the supports_op entry.

Optimization (2nd commit):

The shader now walks the bounded t_in range instead of scanning all K with a per step modulo, so it touches only the ceil(K/stride) useful columns. Measured around 7x on the cache resident K heavy vocoder stage shapes (F32 and F16), bringing Vulkan to parity with CUDA there; on the DRAM bound long shape it is a no op, as expected.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES Opus / MCP rootless container with Nvidia GPU

@ServeurpersoCom ServeurpersoCom requested a review from a team as a code owner June 10, 2026 16:17
@github-actions github-actions Bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Jun 10, 2026
Comment thread ggml/src/ggml-vulkan/ggml-vulkan.cpp Outdated
Comment thread ggml/src/ggml-vulkan/ggml-vulkan.cpp Outdated
Comment thread ggml/src/ggml-vulkan/ggml-vulkan.cpp Outdated
Comment thread ggml/src/ggml-vulkan/ggml-vulkan.cpp Outdated
Comment thread ggml/src/ggml-vulkan/ggml-vulkan.cpp Outdated
@0cc4m 0cc4m changed the title Ggml/vulkan col2im 1d vulkan: add col2im_1d op Jun 15, 2026
@ServeurpersoCom ServeurpersoCom merged commit ad39cca into ggml-org:master Jun 16, 2026
26 of 27 checks passed
papamoose pushed a commit to papamoose/llama.cpp that referenced this pull request Jun 27, 2026
* vulkan: add GGML_OP_COL2IM_1D, follow-up to the CPU op

* vulkan: col2im_1d bounded gather loop instead of full-K scan with modulo

* vulkan: col2im_1d address review from @jeffbolznv

* vulkan: col2im_1d return nullptr for unsupported types, address review from @0cc4m
adrianhoehne pushed a commit to adrianhoehne/llama.cpp that referenced this pull request Jul 5, 2026
* vulkan: add GGML_OP_COL2IM_1D, follow-up to the CPU op

* vulkan: col2im_1d bounded gather loop instead of full-K scan with modulo

* vulkan: col2im_1d address review from @jeffbolznv

* vulkan: col2im_1d return nullptr for unsupported types, address review from @0cc4m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants