Skip to content

ROI fixes - Box filter and Median filter#652

Merged
kiritigowda merged 4 commits intoROCm:developfrom
r-abishek:ar/bugfix_filters_box_median
Jan 6, 2026
Merged

ROI fixes - Box filter and Median filter#652
kiritigowda merged 4 commits intoROCm:developfrom
r-abishek:ar/bugfix_filters_box_median

Conversation

@r-abishek
Copy link
Copy Markdown
Member

This PR reflects the same minor ROI ouput fixes in Box and Median filter - the ones added for Gaussian filter in #639
(#639 (comment))

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 applies ROI (Region of Interest) handling fixes to Box Filter and Median Filter kernels, mirroring the corrections previously implemented in the Gaussian filter (#639). The changes improve boundary condition checks and coordinate clamping calculations for more accurate ROI processing.

Key changes:

  • Standardized ROI boundary checks to use zero-based coordinate comparisons
  • Fixed coordinate clamping to use relative offsets instead of absolute positions
  • Corrected source index calculations to remove redundant clamped Y coordinate usage

Reviewed changes

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

File Description
src/modules/tensor/hip/kernel/median_filter.cpp Updates ROI boundary checks and clamping logic across all median filter kernel variants (3x3, 5x5, 7x7, 9x9) for PKD, PLN, PKD3/PLN3, and PLN3/PKD3 formats
src/modules/tensor/hip/kernel/box_filter.cpp Updates ROI boundary checks and clamping logic across all box filter kernel variants (3x3, 5x5, 7x7, 9x9) for PKD, PLN, PKD3/PLN3, and PLN3/PKD3 formats

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #652      +/-   ##
===========================================
+ Coverage    88.16%   88.30%   +0.13%     
===========================================
  Files          195      195              
  Lines        82723    82731       +8     
===========================================
+ Hits         72932    73050     +118     
+ Misses        9791     9681     -110     
Files with missing lines Coverage Δ
src/modules/tensor/hip/kernel/box_filter.cpp 99.64% <ø> (ø)
src/modules/tensor/hip/kernel/median_filter.cpp 99.64% <ø> (ø)

... and 3 files with indirect coverage changes

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

@kiritigowda kiritigowda self-assigned this Jan 5, 2026
@kiritigowda kiritigowda merged commit 20b941f into ROCm:develop Jan 6, 2026
5 of 7 checks passed
RooseweltMcW pushed a commit to RooseweltMcW/rpp that referenced this pull request Jan 19, 2026
* Add Box and Median Filter ROI fixes after minor corrections

* Fix source index computation

---------

Co-authored-by: Mukesh <mukesh.jayakodi@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
rrawther pushed a commit that referenced this pull request Mar 16, 2026
* Optimized version of channel dropout HIP backend and working code for HOST AVX, SSE

* Modified name for dropout compute function

* Modified way of AVX and SSE version channel dropout to avoid if statments

* Modified Channel Dropout with generic compute code reused

* Parameters and name change for channel dropout

* Modified HIP for better performance

* Modified the code and made the channel dropout templated version for all the bitdepths

* Modified Erase kernel for grid and cutout dropout version for better performance

* Modified the .h file to have the dropout to effects and added output images in the docs

* Added output image and modified the .h file to effects for channel dropout

* Removed space

* added space

* Moved grid dropout .h to effects

* Modified channel dropout for I8 variant HOST side

* Resolved all review comments and modified code to produce results for i8 variant

* Removed empty line

* Resolved review comments

* Modified HOST after merge

* Made changes after merging and QA passed for dropout

* Channel dropout make_float 4 macro changes

* Updated QA with random generator and updated BIN files

* Modified QA name changes

* Modified RandomSeed value passed as parameter to the function call

* Update rppt_tensor_effects_augmentations.cpp

indentation modified

* Initial modified HIP backend Grid dropout with better performance

* Removed space and review comments resolved

* Added I8 support for grid dropout

* Updated and modified indentation

* Modified HIP backend test suite changes

* Host side modification for dropout to use init function in API level and have a seperate file for Grid dropout HOST backend

* Modified color buffer to use scratch Buffer Host

* colon removed

* Fixed linker issue and HIP backend passed

* Added random erase dropout functionality and modified the test suite

* channel dropout implementation

* Resolved all the review comments and modified the magic number to set as constant for better understanding, added required comments

* Removed other varients of dropout

* Removed rd inside kernel

* Update kernel and removed unwanted functions

* HOST modifications for randomErase

* Modified randomization in test suite

* Removed unwanted files and headers

* Resolved review comments

* Updated documentation and resolved comments

* updated random noise generation in test suite HOST implementation

* Updated kernel files for random erase to remove noise generation logic in test suite and pass buffer for random noise

* updated init dropout function

* Added break statement after merge conflicts

* ROI fixes - Box filter and Median filter (#652)

* Add Box and Median Filter ROI fixes after minor corrections

* Fix source index computation

---------

Co-authored-by: Mukesh <mukesh.jayakodi@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>

* Removed numBoxTensor parameter and resolved review comments

* Added early condition to check and return the invalid ROI region

* Updated kernel to use anchorBox info for random erase kernel

* Add unified api for random_erase

* Resolved review comments

* Updated param name for batchSize

* Resolved review comments

* Reverted modified changes

---------

Co-authored-by: sampath117 <snehaa@multicorewareinc.com>
Co-authored-by: RooseweltMcW <austin.roosewelt@multicorewareinc.com>
Co-authored-by: HazarathKumarM <hazarathkumar@multicorewareinc.com>
Co-authored-by: Mukesh <mukesh.jayakodi@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: HazarathKumarM <119284987+HazarathKumarM@users.noreply.github.com>
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.

6 participants