CUDA: add COL2IM_1D op#25151
Open
Ssamdeman wants to merge 1 commit into
Open
Conversation
Implements GGML_OP_COL2IM_1D on the CUDA backend (inverse of IM2COL), the missing counterpart to the merged CPU reference. Output-centric gather kernel templated over f32/f16/bf16 with fp32 accumulation. Passes 33/33 test-backend-ops cases; full regression suite clean. Regenerated docs/ops.md.
|
Hi @Ssamdeman, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
Author
|
Thanks. I clarified it more! |
Contributor
|
remove the ops.csv changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Implements
GGML_OP_COL2IM_1Don the CUDA backend — the inverse of IM2COL and the missing counterpart to the CPU reference merged in #24206. Uses an output-centric gather kernel (no atomics), templated over f32/f16/bf16 with fp32 accumulation. The host wrapper readsop_params = [s0, OC, p0]and derivesK = src->ne[0] / OC.Testing:
test-backend-ops -o COL2IM_1D→ 33/33 OK across all dtype × kernel/stride/padding casestest-backend-opsregression clean (12868/12868)docs/ops.mdviascripts/create_ops_docs.pyAdditional information
The kernel math was verified line-by-line against the CPU
_implreference.col2im_1d.cu/.cuhare self-contained; the siblingim2colfiles are untouched.Requirements
I have read and agree with the contributing guidelines
AI usage disclosure:
AI usage disclosure: YES. I authored the code in this PR myself — I wrote the CUDA kernel, host wrapper, and backend wiring based on my own understanding of the col2im_1d math and the ggml backend structure. I used AI assistively in two ways: (1) to explain ggml architecture and help me verify my indexing/memory-layout assumptions against the merged CPU reference, and (2) when my tests failed, I gave the AI my code and the errors, and it helped me understand why they were failing and what to correct. I reviewed and applied the fixes myself, I understand every line in the final code, and I take full responsibility for all submitted changes.