Skip to content

Conversation

@r-abishek
Copy link
Member

@r-abishek r-abishek commented Oct 8, 2025

RPP was originally also responsible for host to hip buffer conversions. This was removed during the course of tensor implementations to ensure all RPP HOST API only have HOST buffers, and GPU API only have HIP buffers (or pinned memory for smaller argument buffers).

The following functionality were still using the old style host->hip memcopy within RPP, and this is now being removed. After this, RPP tensor API will no longer be responsible for any HOST -> HIP buffer copy. The user is responsible to provide HOST buffers for HOST API, and HIP/Pinned memory for GPU API.

copy_param_float(), copy_param_uint() etc perform these copies and are now eliminated.
Just like all other tensor functionalities, pinned memory allocation from test suite is used for samller argument buffers.

These are the changed functionalities:
exposure
blend
brightness
color cast
color twist
constrast
crop mirror normalize
gamma_correction
gaussian_filter
noise
non_linear_blend
resize_mirror_normalize
water

@rrawther Please note equivalent changes in MIVisionX would need to be merged together with this PR.
A patch version change has been done for this tentatively from 2.1.0 to 2.1.2

HazarathKumarM and others added 23 commits September 17, 2025 08:29
@r-abishek r-abishek requested a review from a team as a code owner October 8, 2025 06:41
@r-abishek r-abishek changed the title Ar/device memcpy removal Consistent HOST and HIP/pinned buffers for respective API Oct 8, 2025
@kiritigowda kiritigowda self-assigned this Oct 9, 2025
@kiritigowda kiritigowda requested a review from rrawther October 9, 2025 17:56
@codecov
Copy link

codecov bot commented Oct 11, 2025

Codecov Report

❌ Patch coverage is 98.22485% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...les/tensor/rppt_tensor_geometric_augmentations.cpp 87.76% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #628      +/-   ##
===========================================
- Coverage    88.22%   88.18%   -0.04%     
===========================================
  Files          195      195              
  Lines        82768    82874     +106     
===========================================
+ Hits         73017    73081      +64     
- Misses        9751     9793      +42     
Files with missing lines Coverage Δ
src/modules/tensor/hip/kernel/blend.cpp 98.63% <100.00%> (ø)
src/modules/tensor/hip/kernel/brightness.cpp 98.63% <100.00%> (ø)
src/modules/tensor/hip/kernel/color_cast.cpp 98.63% <100.00%> (ø)
...rc/modules/tensor/hip/kernel/color_temperature.cpp 98.51% <100.00%> (ø)
src/modules/tensor/hip/kernel/color_twist.cpp 98.77% <100.00%> (ø)
src/modules/tensor/hip/kernel/contrast.cpp 98.63% <100.00%> (ø)
...odules/tensor/hip/kernel/crop_mirror_normalize.cpp 98.97% <100.00%> (ø)
src/modules/tensor/hip/kernel/exposure.cpp 98.55% <100.00%> (ø)
src/modules/tensor/hip/kernel/flip.cpp 100.00% <100.00%> (ø)
src/modules/tensor/hip/kernel/gamma_correction.cpp 98.75% <100.00%> (ø)
... and 14 more

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

RpptDescPtr srcDescPtr,
T *dstPtr,
RpptDescPtr dstDescPtr,
Rpp32f *alphaTensor,
Copy link
Contributor

Choose a reason for hiding this comment

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

How did the kernel get alpha and beta values before?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this also change the external API?

Choose a reason for hiding this comment

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

Previously the alpha and beta values were stored in handle using copy_param API and kernel in turn fetches the values from the handle.

This change won't affect the external API

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

This PR needs api changes from MIVisionX. Corresponding changes from MIVisionX needs to be merged along with this

RpptDescPtr srcDescPtr,
T *dstPtr,
RpptDescPtr dstDescPtr,
Rpp32u *horizontalTensor,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest naming all the tensor pointer *horizontalTensorPtr etc to be consistent

Choose a reason for hiding this comment

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

Renaming all the tensor pointer parameters for consistency will result in changes across 10 or more files. We'll handle this as a separate PR.

T *dstPtr,
RpptDescPtr dstDescPtr,
Rpp32f *shotNoiseFactorTensor,
RpptXorwowStateBoxMuller *xorwowInitialStatePtr,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this xorwow is a user parameter which changes dynamically or a constant?

Copy link

@hmaddise hmaddise Oct 16, 2025

Choose a reason for hiding this comment

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

xorwowInitialState is initialized based on the user-provided seed and changes dynamically based on the seed

std::mt19937 gen(rd()); // Seeding rd() to fast mersenne twister engine
Rpp32u maskLocArrHostX[dstDescPtr->n], maskLocArrHostY[dstDescPtr->n];
Rpp32u *maskLocArrHostX = nullptr, *maskLocArrHostY = nullptr;
CHECK_RETURN_STATUS(hipHostMalloc(&maskLocArrHostX, dstDescPtr->n * sizeof(Rpp32u)));
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to discuss how this can be avoided

CHANGELOG.md Outdated
Full documentation for RPP is available at [https://rocm.docs.amd.com/projects/rpp/en/latest](https://rocm.docs.amd.com/projects/rpp/en/latest)

## RPP 2.1.0 for ROCm 7.1.0
## RPP 2.1.2 for ROCm 7.1.0
Copy link
Contributor

@LakshmiKumar23 LakshmiKumar23 Oct 13, 2025

Choose a reason for hiding this comment

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

we cannot change the version for rocm7.1. Please add another line RPP 2.1.2 (Unreleased) and mention the changes under it

@LakshmiKumar23
Copy link
Contributor

@r-abishek please resolve merge conflicts

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