Skip to content

Implement 2D pooling operation with max and average pooling options#195

Merged
ypapadop-amd merged 9 commits into
hsa-backendfrom
ypapadop-amd/pool2d-op
Jul 8, 2026
Merged

Implement 2D pooling operation with max and average pooling options#195
ypapadop-amd merged 9 commits into
hsa-backendfrom
ypapadop-amd/pool2d-op

Conversation

@ypapadop-amd

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 02:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_2D and 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.

Comment thread src/ggml-hsa/kernels/iron_kernels/pool_2d.cc Outdated
Comment thread src/ggml-hsa/kernels/iron_kernels/pool_2d.py
Copilot AI review requested due to automatic review settings July 8, 2026 03:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread tests/ggml-hsa/test-backend-ops-mnist.cpp Outdated
Copilot AI review requested due to automatic review settings July 8, 2026 03:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 8, 2026 03:10
ypapadop-amd and others added 2 commits July 7, 2026 23:13
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comment thread tests/ggml-hsa/test-backend-ops-mnist.cpp Outdated
Comment thread src/ggml-hsa/kernels/iron_kernels/pool_2d.py
Comment thread src/ggml-hsa/kernels/iron_kernels/pool_2d.cc Outdated
Comment thread src/ggml-hsa/kernels/iron_kernels/pool_2d.cc Outdated
…a types and add support for bfloat16 in Python implementation; include new test case for F16 input.
Copilot AI review requested due to automatic review settings July 8, 2026 04:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 36 out of 37 changed files in this pull request and generated 2 comments.

Comment thread src/ggml-hsa/kernels/iron_kernels/pool_2d.py Outdated
Comment thread src/ggml-hsa/kernels/iron_kernels/pool_2d.py
- 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.
Copilot AI review requested due to automatic review settings July 8, 2026 04:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 36 out of 37 changed files in this pull request and generated no new comments.

…ons, strides, and padding; update documentation; add new test cases for padding and F16 input.
@ypapadop-amd ypapadop-amd merged commit 1649e61 into hsa-backend Jul 8, 2026
2 checks passed
@ypapadop-amd ypapadop-amd deleted the ypapadop-amd/pool2d-op branch July 8, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants