Gaussian Filter - Edge NN-padding support and QA test updates#639
Gaussian Filter - Edge NN-padding support and QA test updates#639kiritigowda merged 30 commits intoROCm:developfrom
Conversation
Gaussian filter padding updates with QA support
There was a problem hiding this comment.
Pull Request Overview
This PR adds nearest-neighbor padding support for the Gaussian filter augmentation to prevent border pixels from fading out. The changes include API updates, kernel optimizations for both HIP and HOST backends, and enhanced QA test support.
Key Changes
- Added
borderTypeparameter to gaussian filter API functions with REPLICATE (nearest-neighbor) support - Introduced
RpptImageBorderEdgeenum for identifying image border edges - Templated helper functions on HIP backend (reduced from 36 functions to 3 templated functions)
- Updated QA test suite to enable gaussian filter testing for F32 and U8 formats
- Performance optimizations showing 37-82% improvement for specific F32 PKD3 variants on kernel sizes 5, 7, and 9
Reviewed Changes
Copilot reviewed 9 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| api/rppt_tensor_filter_augmentations.h | Added borderType parameter to gaussian filter API signatures |
| api/rppdefs.h | Introduced RpptImageBorderEdge enum for edge identification |
| utilities/test_suite/rpp_test_suite_image.h | Removed GAUSSIAN_FILTER from nonQACases to enable QA testing |
| utilities/test_suite/HOST/Tensor_image_host.cpp | Added borderType validation and parameter passing |
| utilities/test_suite/HIP/Tensor_image_hip.cpp | Added borderType validation and parameter passing |
| src/modules/tensor/rppt_tensor_filter_augmentations.cpp | Added borderType parameter validation |
| src/modules/tensor/hip/kernel/gaussian_filter.cpp | Major refactoring with templated functions and NN padding logic |
| src/modules/tensor/cpu/kernel/gaussian_filter.cpp | Enhanced with templated load functions and padding support |
| src/include/common/cpu/rpp_cpu_simd_load_store.hpp | Added store24 functions for various data types |
| docs/data/doxygenOutputs/*.png | Updated documentation images |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| rpp_hip_load24_pkd3_to_uchar8_pln3(srcPtr + srcIdx, src_smem_channel); | ||
| } | ||
| if ((id_x_i > roiBeginX) && ((id_x_i + 7 + padLength) < roiWidth) && (id_y_i > roiBeginY) && (id_y_i < roiHeight)) |
There was a problem hiding this comment.
The condition id_x_i > roiBeginX uses strict inequality, but should use >= for proper boundary checking. When id_x_i == roiBeginX, this is a valid position that doesn't need padding, but the current condition forces it into the padding path.
| if ((id_x_i > roiBeginX) && ((id_x_i + 7 + padLength) < roiWidth) && (id_y_i > roiBeginY) && (id_y_i < roiHeight)) | |
| if ((id_x_i >= roiBeginX) && ((id_x_i + 7 + padLength) < roiWidth) && (id_y_i > roiBeginY) && (id_y_i < roiHeight)) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #639 +/- ##
===========================================
- Coverage 88.33% 88.13% -0.19%
===========================================
Files 195 195
Lines 82723 82479 -244
===========================================
- Hits 73068 72692 -376
- Misses 9655 9787 +132
🚀 New features to boost your workflow:
|
Copilot comment and documentation updates - gaussian filter
|
@r-abishek please resolve conflicts |
rrawther
left a comment
There was a problem hiding this comment.
@SundarRajan28 : Would like to review this PR with you before merging
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Gaussian Filter ROI Fixes
* Updated gaussian filter padding logic HOST and updated bin files for QA U8 and F32 * Updated gaussian filter for HIP backend with the border padding fix * Updated docs image for gaussian filter * Template helper load functions * Update changes with enum for clear distinction * Compilation fixes * Fixes for enum changes * Remove unwanted pixel checks * Add modifications to run and update 3x3 kernel * Remove filter load functions for 3x3 kernel * Standardize store function calls * Changes to outer API and variable renaming * Changes to outer API in headers * Additional comments * Update the load function with further comments * Modifications to edge enum * Minor documentation updates - gaussian filter * Update conditions for gaussian filter * Fix ROI issues with gaussian filter * Fix compilation issues * Update src/modules/tensor/hip/kernel/gaussian_filter.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: HazarathKumarM <hazarathkumar@multicorewareinc.com> Co-authored-by: Srihari-mcw <srihari@multicorewareinc.com> Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com> Co-authored-by: hmaddise <HazarathKumar.Maddisetty@amd.com> Co-authored-by: Srihari-mcw <96763064+Srihari-mcw@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR adds nearest neighbors padding for gaussian filter augmentation.
This is similar to the fixes in box/median already in ToT.
Current gaussian filter ToT version had border pixels fading out without NN padding, the PR attempts to fix the same.
Performance profiling to ensure no significant changes in performance due to addition of computation on nearest neighbor padding.
(Significant performance boost in the F32 PKD3 HIP variant observed)