Skip to content

metal: add CONV_3D #19927

Merged
ggerganov merged 4 commits intoggml-org:masterfrom
Ra5hidIslam:metal-add-conv3d
Mar 23, 2026
Merged

metal: add CONV_3D #19927
ggerganov merged 4 commits intoggml-org:masterfrom
Ra5hidIslam:metal-add-conv3d

Conversation

@Ra5hidIslam
Copy link
Copy Markdown
Contributor

Adds F32 and F16 weight support for the GGML_OP_CONV_3D operation in the Metal backend.
The implementation matches CPU semantics for 3D spatial convolutions (handling strides, padding, and dilation) and enables both weight types to pass functional tests.

Passed Tests

CONV_3D(N=1,IC=4,ID=8,IH=8,IW=8,OC=8,KD=1,KH=1,KW=1,s0=1,s1=1,s2=1,p0=0,p1=0,p2=0,d0=1,d1=1,d2=1,type_kernel=f16): OK
  258/258 tests passed
  Backend MTL0: OK
ggml_metal_free: deallocating

Performance tests don't exits.

Part of #14909

@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Feb 26, 2026
@Ra5hidIslam
Copy link
Copy Markdown
Contributor Author

Hi @ggerganov , just checking in to see if there is anything else needed from my side for this PR. I've rebased it with the latest master to ensure it's ready for review. Thanks!

Copy link
Copy Markdown
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

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

I guess a first version of the implementation is OK.

Rebase on latest master and address the comments.

Comment thread ggml/src/ggml-metal/ggml-metal-impl.h Outdated
Comment thread ggml/src/ggml-metal/ggml-metal.metal Outdated
@Ra5hidIslam Ra5hidIslam requested a review from a team as a code owner March 19, 2026 10:24
@Ra5hidIslam Ra5hidIslam requested review from a team, CISC, IMbackK, ngxson and pwilkin as code owners March 20, 2026 06:19
@CISC CISC removed request for a team and CISC March 20, 2026 06:22
@github-actions github-actions Bot added documentation Improvements or additions to documentation script Script related testing Everything test related Vulkan Issues specific to the Vulkan backend examples python python script changes devops improvements to build systems and github actions server Hexagon WebGPU labels Mar 20, 2026
@CISC
Copy link
Copy Markdown
Member

CISC commented Mar 20, 2026

@Ra5hidIslam Bad rebase. :)

@CISC CISC removed documentation Improvements or additions to documentation script Script related testing Everything test related Vulkan Issues specific to the Vulkan backend examples python python script changes devops improvements to build systems and github actions server Hexagon WebGPU labels Mar 20, 2026
Ra5hidIslam and others added 3 commits March 20, 2026 12:03
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Rebased with master and resolved conflicts.
@Ra5hidIslam
Copy link
Copy Markdown
Contributor Author

@ggerganov Hi, the ubuntu-cpu (s390x) job seems to have failed due to the self-hosted runner losing connection — doesn't appear to be a code issue. Would a re-run of the failed jobs fix this?

@ggerganov ggerganov merged commit 177c758 into ggml-org:master Mar 23, 2026
52 of 56 checks passed
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* Apply suggestions from code review

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* metal:add conv_3d backend

Rebased with master and resolved conflicts.

* Resolved issues related to changes in variable names

* kernel void kernel_upscale_bilinear_f32 was missing in my branch, added back, should pass all tests now

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
rsenthilkumar6 pushed a commit to rsenthilkumar6/llama.cpp that referenced this pull request May 1, 2026
* Apply suggestions from code review

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* metal:add conv_3d backend

Rebased with master and resolved conflicts.

* Resolved issues related to changes in variable names

* kernel void kernel_upscale_bilinear_f32 was missing in my branch, added back, should pass all tests now

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants