Skip to content

Histogram Equalize augmentation for HOST and HIP#680

Merged
kiritigowda merged 35 commits intoROCm:developfrom
r-abishek:ar/histogram_equalize
Mar 27, 2026
Merged

Histogram Equalize augmentation for HOST and HIP#680
kiritigowda merged 35 commits intoROCm:developfrom
r-abishek:ar/histogram_equalize

Conversation

@r-abishek
Copy link
Copy Markdown
Member

  • Adds Histogram Equalize augmentation on HOST and HIP.
  • Adds relevant unit/perf/qa tests.

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 pull request adds histogram equalization augmentation support for both HOST (CPU) and HIP (GPU) backends. The implementation performs histogram equalization on RGB images by converting to YCbCr color space, equalizing the luminance (Y) channel, and converting back to RGB, which preserves chrominance information. For single-channel (greyscale) images, equalization is applied directly.

Changes:

  • Adds rppt_histogram_equalize API function supporting U8 datatype with NCHW/NHWC layouts for 1 or 3 channel images
  • Implements CPU version with AVX2 SIMD optimizations for color space conversion and LUT building
  • Implements GPU version with HIP kernels for parallel histogram computation, LUT generation, and application
  • Adds test suite integration and Python test configuration

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
api/rppt_tensor_color_augmentations.h Adds public API declaration and documentation for histogram_equalize function
src/modules/tensor/rppt_tensor_color_augmentations.cpp Implements main entry point with validation and backend dispatch logic
src/modules/tensor/cpu/kernel/histogram_equalize.cpp CPU implementation with RGB↔YCbCr conversion, histogram computation, and AVX2 optimizations
src/modules/tensor/hip/kernel/histogram_equalize.cpp HIP kernels for parallel histogram collection, CDF computation, LUT generation, and color space conversion
src/include/tensor/host_tensor_executors.hpp Adds function declaration for HOST backend executor
src/include/tensor/hip_tensor_executors.hpp Adds function declaration for HIP backend executor
utilities/test_suite/rpp_test_suite_image.h Adds enum value (102) and mapping for histogram_equalize test case
utilities/test_suite/common.py Adds test configuration for histogram_equalize in augmentation map and color group
utilities/test_suite/HOST/Tensor_image_host.cpp Integrates histogram_equalize test case into HOST test suite
utilities/test_suite/HIP/Tensor_image_hip.cpp Integrates histogram_equalize test case into HIP test suite
docs/data/doxygenOutputs/color_augmentations_histogram_equalize_img150x150.png Adds sample output image for documentation

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

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 96.06513% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...c/modules/tensor/cpu/kernel/histogram_equalize.cpp 95.88% 20 Missing ⚠️
...modules/tensor/rppt_tensor_color_augmentations.cpp 86.96% 6 Missing ⚠️
...c/modules/tensor/hip/kernel/histogram_equalize.cpp 98.54% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #680      +/-   ##
===========================================
+ Coverage    92.55%   92.57%   +0.02%     
===========================================
  Files          206      208       +2     
  Lines        92763    93500     +737     
===========================================
+ Hits         85851    86553     +702     
- Misses        6912     6947      +35     
Files with missing lines Coverage Δ
...c/modules/tensor/hip/kernel/histogram_equalize.cpp 98.54% <98.54%> (ø)
...modules/tensor/rppt_tensor_color_augmentations.cpp 94.52% <86.96%> (-0.25%) ⬇️
...c/modules/tensor/cpu/kernel/histogram_equalize.cpp 95.88% <95.88%> (ø)

... and 2 files with indirect coverage changes

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

@rrawther
Copy link
Copy Markdown
Contributor

please address all the review comments

Copy link
Copy Markdown
Contributor

@rrawther rrawther left a comment

Choose a reason for hiding this comment

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

@aryan can you review the HIP kernel. I am not sure why so many syncthreads are required

Copy link
Copy Markdown
Contributor

@rrawther rrawther left a comment

Choose a reason for hiding this comment

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

please resolve all review comments

@LakshmiKumar23
Copy link
Copy Markdown
Contributor

@kiritigowda kiritigowda merged commit 6aeb43f into ROCm:develop Mar 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:precheckin enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants