Implement 2D pooling operation with max and average pooling options#195
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for GGML’s GGML_OP_POOL_2D operation in the HSA backend by introducing an IRON/AIE implementation (Python orchestration + external C++ core) and extending the MNIST backend-ops test suite to exercise max and average 2D pooling.
Changes:
- Add a new HSA kernel entry point for
POOL_2Dand wire it into the kernel build/dispatch map. - Implement an IRON design for plane-wise 2D pooling plus an AIE external C++ core function.
- Add MNIST-oriented pooling test cases (max pooling without padding; avg pooling with padding).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ggml-hsa/test-backend-ops-mnist.cpp | Adds new POOL_2D test cases to exercise max/avg pooling configurations. |
| src/ggml-hsa/kernels/pool_2d.py | Introduces the top-level KernelSpec entry point for GGML_OP_POOL_2D. |
| src/ggml-hsa/kernels/iron_kernels/pool_2d.py | Adds the IRON design that streams channel-planes through an external core function. |
| src/ggml-hsa/kernels/iron_kernels/pool_2d.cc | Implements the AIE-side pooling compute for a single channel-plane. |
| src/ggml-hsa/kernels/iron_kernels/CMakeLists.txt | Includes the new IRON pool_2d sources in the copied/installed file list. |
| src/ggml-hsa/kernels/CMakeLists.txt | Includes the new top-level pool_2d kernel module when JIT compilation is enabled. |
| src/ggml-hsa/kernels/build.py | Registers POOL_2D in the operation-to-kernel dispatch map. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…a types and add support for bfloat16 in Python implementation; include new test case for F16 input.
- Updated docstrings across various kernel files to enhance clarity and consistency. - Improved parameter descriptions for functions in scale, softmax, unary_ops, and other kernel files. - Simplified explanations and removed redundant information to streamline understanding. - Ensured that all docstrings follow a consistent format, making it easier for developers to comprehend the purpose and usage of each function.
…ons, strides, and padding; update documentation; add new test cases for padding and F16 input.
ypapadop-amd
added a commit
that referenced
this pull request
Jul 12, 2026
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.
No description provided.