Skip to content

Channel Permute - Addition of 'permutationsList' argument#547

Merged
rrawther merged 29 commits intoROCm:developfrom
r-abishek:ar/opt_swap_channels
May 14, 2025
Merged

Channel Permute - Addition of 'permutationsList' argument#547
rrawther merged 29 commits intoROCm:developfrom
r-abishek:ar/opt_swap_channels

Conversation

@r-abishek
Copy link
Copy Markdown
Member

@r-abishek r-abishek commented Apr 22, 2025

The PR adds one argument to already existent swap_channels augmentation.
The new "permutationTensor" argument takes in any permutation to permute the RGB channels in any order.
Name of the function has been changed to channel_permute since swap_channels indicated only two channels being swapped.

  • Extend tensor support of channel_permute augmentation for all permutations with AVX2 on HOST backend.
  • Extend tensor support of channel_permute augmentation for all permutations on HIP backend.
  • Add relevant unit and performance tests.

@r-abishek r-abishek added enhancement New feature or request ci:precheckin labels Apr 22, 2025
@r-abishek r-abishek requested a review from Copilot April 22, 2025 23:21
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 extends the swap_channels augmentation to support all possible RGB channel permutations by introducing a new "permTensor" argument, which is propagated through both the HOST and HIP backends and reflected in the associated tests.

  • Added the new "permTensor" argument to swap_channels functions and updated kernels in both host and HIP code.
  • Updated unit and performance test scripts on HOST and HIP to loop over all six channel permutation orders.
  • Modified interface declarations and API documentation to include the new parameter.

Reviewed Changes

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

Show a summary per file
File Description
utilities/test_suite/rpp_test_suite_image.h Added SWAP_CHANNELS to additionalParamCases and branch for perm order string generation; introduced fill_perm_values for permutation setup.
utilities/test_suite/HOST/runImageTests.py Added new test branch (case "85") to iterate over all swap orders for host tests.
utilities/test_suite/HOST/Tensor_image_host.cpp Updated swap_channels calls to pass the permTensor and adjusted function naming accordingly.
utilities/test_suite/HIP/runImageTests.py Added new test branch (case "85") to iterate over swap orders for HIP tests.
utilities/test_suite/HIP/Tensor_image_hip.cpp Allocates and frees permTensor, and updates swap_channels GPU calls to include permTensor.
src/modules/tensor/rppt_tensor_data_exchange_operations.cpp Updated swap_channels function signatures to include the new permTensor parameter.
src/modules/tensor/hip/kernel/swap_channels.cpp Updated device kernel functions to pass permTensor to the swap_channels_hip_compute routine.
src/include/tensor/host_tensor_executors.hpp and src/include/tensor/hip_tensor_executors.hpp Updated function declarations to include permTensor.
api/rppt_tensor_data_exchange_operations.h Updated API documentation and function prototypes to include the new permTensor parameter.

@r-abishek r-abishek requested a review from a team as a code owner April 22, 2025 23:23
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 23, 2025

Codecov Report

❌ Patch coverage is 97.66234% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/modules/tensor/cpu/kernel/channel_permute.cpp 97.21% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #547      +/-   ##
===========================================
+ Coverage    54.81%   54.84%   +0.03%     
===========================================
  Files          293      293              
  Lines       118454   118516      +62     
===========================================
+ Hits         64921    64994      +73     
+ Misses       53533    53522      -11     
Files with missing lines Coverage Δ
src/modules/tensor/hip/kernel/channel_permute.cpp 100.00% <100.00%> (ø)
...es/tensor/rppt_tensor_data_exchange_operations.cpp 93.75% <100.00%> (+0.18%) ⬆️
src/modules/tensor/cpu/kernel/channel_permute.cpp 97.52% <97.21%> (ø)

... 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.

Copy link
Copy Markdown
Contributor

@spolifroni-amd spolifroni-amd left a comment

Choose a reason for hiding this comment

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

The changelog line needs some context.

@kiritigowda kiritigowda self-assigned this Apr 29, 2025
…Permute

RPP Channel Permute : Modified swap channels as Channel Permute
@r-abishek r-abishek changed the title Swap Channels - Addition of 'permTensor' argument Channel Permute - Addition of 'permTensor' argument Apr 29, 2025
@r-abishek r-abishek requested a review from Copilot April 29, 2025 19:28
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 renames the existing swap_channels augmentation to channel_permute and adds a new permTensor argument to allow any permutation of the RGB channels. Key changes include updating API functions for both HOST and HIP backends, modifying test suite cases and scripts, and updating related documentation and changelog entries.

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utilities/test_suite/rpp_test_suite_image.h Renamed augmentation key from "swap_channels" to "channel_permute"
utilities/test_suite/common.py Updated augmentation name to channel_permute in test mapping
utilities/test_suite/HOST/runImageTests.py Modified test invocation to iterate over 6 permutation orders
utilities/test_suite/HOST/Tensor_image_host.cpp Updated function name and handling for channel_permute augmentation
utilities/test_suite/HIP/runImageTests.py Updated test invocation for HIP backend using new channel_permute logic
utilities/test_suite/HIP/Tensor_image_hip.cpp Updated function name, parameter handling and memory management for channel_permute augmentation
src/modules/tensor/rppt_tensor_data_exchange_operations.cpp Renamed API functions and added the new permTensor parameter in host and GPU implementations
src/include/tensor/host_tensor_executors.hpp and hip_tensor_executors.hpp Updated declarations and documentation to reflect channel_permute changes
api/rppt_tensor_data_exchange_operations.h Updated API comments and function signature to include the new permTensor parameter
CHANGELOG.md Documented change to the API of the swap_channels augmentation
Comments suppressed due to low confidence (1)

utilities/test_suite/HOST/runImageTests.py:88

  • [nitpick] Consider renaming the local variable 'swapOrder' to 'permOrder' in the test scripts for clarity and to better reflect the updated channel_permute functionality.
for swapOrder in range(swapOrderRange):

@r-abishek r-abishek changed the title Channel Permute - Addition of 'permTensor' argument Channel Permute - Addition of 'permutationsList' argument Apr 30, 2025
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.

Added comments. Main idea is get rid of permutelist and take the permute channel order directly so the API will be more transparent to the user

@rrawther rrawther merged commit e792fd0 into ROCm:develop May 14, 2025
21 checks 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.

7 participants