]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
metal: add col2im_1d op (f32/f16/bf16) (#25176)
authorPascal <redacted>
Mon, 6 Jul 2026 18:47:36 +0000 (20:47 +0200)
committerGitHub <redacted>
Mon, 6 Jul 2026 18:47:36 +0000 (20:47 +0200)
commitf36e5c348bc8795c34f9a038e58876e7a8423d4d
treef6bb4f62dd9d2ce7e8832ae0d2a95ff59c98bc56
parent74976e1aefd8d64845ae5510674b36079c855c0c
metal: add col2im_1d op (f32/f16/bf16) (#25176)

* metal: add col2im_1d op (f32/f16/bf16)

Gather kernel mirroring the CPU/CUDA path: each output (t_out, oc)
reads its ceil(K/s0) source columns with an F32 accumulator, a single
write and no atomics. One thread per output element, 256 per
threadgroup.

* metal: check dst contiguity and type match in supports_op for COL2IM_1D

Align the GGML_OP_COL2IM_1D predicate with the CPU, CUDA, and Vulkan
backends: the kernel writes dst with linear indexing and assumes the
same type as src0, so supports_op must also require a contiguous dst
and op->type == op->src[0]->type.

* Update ggml/src/ggml-metal/ggml-metal.metal

Co-authored-by: YiChen Lv <redacted>
---------

Co-authored-by: YiChen Lv <redacted>
ggml/src/ggml-metal/ggml-metal-device.cpp
ggml/src/ggml-metal/ggml-metal-device.h
ggml/src/ggml-metal/ggml-metal-device.m
ggml/src/ggml-metal/ggml-metal-impl.h
ggml/src/ggml-metal/ggml-metal-ops.cpp
ggml/src/ggml-metal/ggml-metal-ops.h
ggml/src/ggml-metal/ggml-metal.metal