Skip to content

ggml: add conv3d op #15182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ggml: add conv3d op #15182

wants to merge 1 commit into from

Conversation

rmatif
Copy link
Collaborator

@rmatif rmatif commented Aug 8, 2025

This PR adds conv3d support for the CPU backend. This is required for tasks such as inferencing text to video models.

Since we are limited by the number of tensor dimensions, my idea was to unroll the depth dimension. The implementation flattens 3D input patches into columns, then performs a single matrix multiplication against the flattened kernel weights.

I did not seek for optimizations, and I'm not sure it is worth it (unless there are obvious ones), as this implementation will essentially serve as a ground truth to test against when implementing this op on other backends.

The correctness was checked against PyTorch's native conv3d

@github-actions github-actions bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning labels Aug 8, 2025
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 testing Everything test related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant