ROI fixes - Box filter and Median filter#652
Merged
kiritigowda merged 4 commits intoROCm:developfrom Jan 6, 2026
Merged
Conversation
ROI fixes - Box filter and Median filter
Contributor
There was a problem hiding this comment.
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 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
🚀 New features to boost your workflow:
|
rrawther
approved these changes
Jan 6, 2026
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>
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.
This PR reflects the same minor ROI ouput fixes in Box and Median filter - the ones added for Gaussian filter in #639
(#639 (comment))