Skip to content

ggml-cpu : fix conv_transpose_2d for multiple batches#26132

Open
tekinertekin wants to merge 1 commit into
ggml-org:masterfrom
tekinertekin:conv-transpose-2d-batch
Open

ggml-cpu : fix conv_transpose_2d for multiple batches#26132
tekinertekin wants to merge 1 commit into
ggml-org:masterfrom
tekinertekin:conv-transpose-2d-batch

Conversation

@tekinertekin

Copy link
Copy Markdown
Contributor

Overview

ggml_compute_forward_conv_transpose_2d_impl used to only calculate the first batch (ne[3] of the result), all batches after that remain to be zero. Both the src1 permutation and the main compute loop will now iterate over the batches of the result dimension, and the work buffer allocated via ggml_graph_plan will be scaled with the src1 batch count to accommodate the permuted additional batches. Added an additional multi-batch test case to the test-backend-ops suite. Fixes ggml-org/ggml#1448

Additional information

1 more test added. Tested locally and passed. Fixes ggml-org/ggml#1448

Requirements

AI helped develop and refine this fix, ported it into the tree, reproduced the bug, and ran the build and tests. I have reviewed and understood every line and I am fully responsible for the change.

ggml_compute_forward_conv_transpose_2d_impl only computed the first
batch (ne[3] of the destination); every batch after the first was left
as zero. Both the src1 permutation and the main compute loop now iterate
over the batch dimension, and the work buffer size in ggml_graph_plan is
scaled by the src1 batch count so the extra permuted batches fit. A
multi-batch test case is added to test-backend-ops.

Fixes ggml-org/ggml#1448
@tekinertekin
tekinertekin requested a review from ggerganov as a code owner July 26, 2026 08:47
@github-actions github-actions Bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning labels Jul 26, 2026
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.

ggml_conv_transpose_2d_p0 silently ignores batch dimension (ne[3] > 1)

1 participant