Skip to content

[New Operator] Average Blur operator#145

Open
paveltc wants to merge 6 commits intoROCm:developfrom
paveltc:avg_blur
Open

[New Operator] Average Blur operator#145
paveltc wants to merge 6 commits intoROCm:developfrom
paveltc:avg_blur

Conversation

@paveltc
Copy link
Copy Markdown
Contributor

@paveltc paveltc commented Apr 8, 2026

Motivation

This adds the the C++ and Python implementations of the Average Blur operator.

Technical Details

The Average Blur operator is a convolution operator that takes the average over a group of pixels and writes the average to the target pixel (typically the center pixel in the middle of the convolution).
The GPU implementation has two different implementations.

  • The first implementation is a simple 2D convolution, which works better for smaller kernels such as 3x3, 5x5 and 7x7.
  • The second implementation does a horizontal and a vertical pass and uses tiling and shared memory to optimize the operation. This works better for larger kernels like 9x9 and 11x11.

Test Plan

  • A C-Model is included with this PR along with a number of tests to check different configurations.
  • A Python test is also included with different combinations of inputs.

Test Result

All C++ and Python tests pass.

Submission Checklist

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 70.37037% with 56 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/op_avg_blur.cpp 69.46% 27 Missing and 24 partials ⚠️
include/kernels/host/avg_blur_host.hpp 77.27% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #145      +/-   ##
===========================================
- Coverage    74.40%   74.10%   -0.30%     
===========================================
  Files           79       81       +2     
  Lines         3355     3544     +189     
  Branches       738      770      +32     
===========================================
+ Hits          2496     2626     +130     
- Misses         378      407      +29     
- Partials       481      511      +30     
Files with missing lines Coverage Δ
include/kernels/host/avg_blur_host.hpp 77.27% <77.27%> (ø)
src/op_avg_blur.cpp 69.46% <69.46%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants