Skip to content

fix(rpp): Ensure RppStatus propagation through kernel dispatcher - #11311

Merged
zacharyvincze merged 23 commits into
developfrom
users/zacharyvincze/rpp-status-propagation-fix
Sep 24, 2026
Merged

zacharyvincze merged 23 commits into
developfrom
users/zacharyvincze/rpp-status-propagation-fix

Conversation

@zacharyvincze

Copy link
Copy Markdown
Contributor

Motivation

This PR resolves #11235 and general issues where RppStatus would not be properly propagated to the caller, incorrectly returning RPP_SUCCESS even when an error had been raised.

Technical Details

  • Largely a mechanical change which ensures RppStatus is not silently discarded at higher levels of the kernel dispatchers.
  • Some kernel calls were missing a proceeding HIP_CHECK_LAUNCH_RETURN() which is responsible for catching launch errors (such as no matching binary mentioned in the issue linked above).
  • Most operators required a straightforward return before calling their respective dispatcher, or, if there was work required afterwards, wrapped in RPP_RETURN_IF_ERROR(x) which will only return if call x return a non-success code.

Test Plan

  • Compiled lib with a gfx ID that wasn't supported on the system and ran the test suite.

Test Result

The failure described in the issue now seems to be propagating the status, whereas before it would report a pixel mismatch. Example:

HIP kernel launch error: returned 200 at .../hip/kernel/brightness.cpp:286
Running brightness_f32_Tensor_HIP_PKD3_toPKD3 ...
The functionality brightness_f32_Tensor_HIP_PKD3_toPKD3 returned an error status on run number 1 of 1 runs.
exit=228     # RPP_ERROR_HIP_LAUNCH (-28)

Submission Checklist

@zacharyvincze
zacharyvincze requested a review from a team as a code owner August 26, 2026 17:24
@zacharyvincze zacharyvincze added project: rpp test:rpp Run full tests for rpp labels Aug 26, 2026
@zacharyvincze zacharyvincze changed the title fix(rpp) Ensure RppStatus propagation through kernel dispatcher fix(rpp): Ensure RppStatus propagation through kernel dispatcher Aug 26, 2026
@kiritigowda kiritigowda added the test_type:full If enabled, the PR will run full tests label Aug 26, 2026
@kiritigowda kiritigowda self-assigned this Aug 26, 2026
@therock-pr-bot

therock-pr-bot Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/rpp/api/rppdefs.h, projects/rpp/src/modules/tensor/hip/kernel/audio_tensor_add_tensor.cpp, projects/rpp/src/modules/tensor/hip/kernel/audio_tensor_mul_scalar.cpp, projects/rpp/src/modules/tensor/hip/kernel/bitwise_and.cpp, projects/rpp/src/modules/tensor/hip/kernel/bitwise_not.cpp (+90 more); no test file found
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

LakshmiKumar23
LakshmiKumar23 previously approved these changes Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Ensures RPP dispatcher and HIP kernel failures propagate to public API callers instead of being reported as success.

Changes:

  • Adds RPP_RETURN_IF_ERROR for nested status propagation.
  • Returns dispatcher statuses from tensor APIs and ROI conversions.
  • Adds HIP launch checks to previously unchecked kernels.

Reviewed changes

Copilot reviewed 81 out of 83 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
projects/rpp/api/rppdefs.h Adds nested status propagation macro.
projects/rpp/src/modules/tensor/rppt_tensor_statistical_operations.cpp Forwards statistical dispatcher statuses.
projects/rpp/src/modules/tensor/rppt_tensor_morphological_operations.cpp Forwards morphology statuses.
projects/rpp/src/modules/tensor/rppt_tensor_filter_augmentations.cpp Forwards filter dispatcher statuses.
projects/rpp/src/modules/tensor/rppt_tensor_data_exchange_operations.cpp Forwards data-exchange statuses.
projects/rpp/src/modules/tensor/rppt_tensor_bitwise_operations.cpp Partially forwards bitwise statuses.
projects/rpp/src/modules/tensor/rppt_tensor_audio_augmentations.cpp Forwards audio operation statuses.
projects/rpp/src/modules/tensor/rppt_tensor_arithmetic_operations.cpp Partially forwards arithmetic statuses.
projects/rpp/src/modules/tensor/hip/kernel/water.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/warp_perspective.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/warp_affine.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/vignette.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/threshold.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/tensor_sum.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/tensor_stddev.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/tensor_min.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/tensor_mean.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/tensor_max.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/tensor_bitwise_binary_operations.cpp Checks launches and propagates dispatch errors.
projects/rpp/src/modules/tensor/hip/kernel/tensor_binary_operations.cpp Checks arithmetic kernel launches.
projects/rpp/src/modules/tensor/hip/kernel/spatter.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/solarize.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/sobel_filter.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/snow.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/slice.cpp Propagates fill-kernel failures.
projects/rpp/src/modules/tensor/hip/kernel/saturation.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/ricap.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/resize.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/resize_mirror_normalize.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/resize_crop_mirror.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/remap.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/random_erase.cpp Checks launches and ROI conversion.
projects/rpp/src/modules/tensor/hip/kernel/rain.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/posterize.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/phase.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/normalize.cpp Propagates mean/stddev failures.
projects/rpp/src/modules/tensor/hip/kernel/non_linear_blend.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/noise_shot.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/noise_salt_and_pepper.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/noise_gaussian.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/median_filter.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/magnitude.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/lut.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/lens_correction.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/jpeg_compression_distortion.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/jitter.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/hue.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/histogram_equalize.cpp Checks all histogram launches.
projects/rpp/src/modules/tensor/hip/kernel/gridmask.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/grid_dropout.cpp Checks dropout kernel launches.
projects/rpp/src/modules/tensor/hip/kernel/glitch.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/gaussian_filter.cpp Propagates setup and ROI failures.
projects/rpp/src/modules/tensor/hip/kernel/gamma_correction.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/fog.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/flip.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/fisheye.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/exposure.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/erode.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/erase.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/emboss.cpp Checks setup and filter launches.
projects/rpp/src/modules/tensor/hip/kernel/dilate.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/crop.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/crop_mirror_normalize.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/crop_and_patch.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/contrast.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/color_twist.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/color_temperature.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/color_space_conversion.cpp Checks color-conversion launches.
projects/rpp/src/modules/tensor/hip/kernel/color_cast.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/coarse_dropout.cpp Checks dropout kernel launches.
projects/rpp/src/modules/tensor/hip/kernel/channel_dropout.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/brightness.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/box_filter.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/blend.cpp Checks launches and ROI conversion.
projects/rpp/src/modules/tensor/hip/kernel/bitwise_xor.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/bitwise_or.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/bitwise_not.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/bitwise_and.cpp Propagates ROI conversion failures.
projects/rpp/src/modules/tensor/hip/kernel/audio_tensor_mul_scalar.cpp Checks audio kernel launch.
projects/rpp/src/modules/tensor/hip/kernel/audio_tensor_add_tensor.cpp Checks audio kernel launch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rrawther rrawther left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added review comments

@zacharyvincze
zacharyvincze requested a review from rrawther August 26, 2026 20:35
@kiritigowda

Copy link
Copy Markdown
Contributor

@zacharyvincze -- your PR is still failing with mismatch error

./Tensor_misc_hip 11 0 0 3 3 1 BitDepthTestMode.F32_TO_F32 1
Running tensor_divide_tensor_3d_f32_broadcast_input2 1 times (each time with a batch size of 3) and computing mean statistics...
Results for Test case: tensor_divide_tensor_3d_f32_broadcast_input2
FAILED! 0/3 outputs are matching with reference outputs
------------------------------------------------------------------------------------------
./Tensor_misc_hip 11 0 0 3 3 1 BitDepthTestMode.U8_TO_F32 1
Running tensor_divide_tensor_3d_u8_f32_broadcast_input2 1 times (each time with a batch size of 3) and computing mean statistics...
Results for Test case: tensor_divide_tensor_3d_u8_f32_broadcast_input2
FAILED! 0/3 outputs are matching with reference outputs
------------------------------------------------------------------------------------------
./Tensor_misc_hip 11 0 0 3 3 1 BitDepthTestMode.F32_TO_F32 2
Running tensor_divide_tensor_3d_f32_broadcast_input1 1 times (each time with a batch size of 3) and computing mean statistics...
Results for Test case: tensor_divide_tensor_3d_f32_broadcast_input1
FAILED! 0/3 outputs are matching with reference outputs

@kiritigowda

Copy link
Copy Markdown
Contributor

@zacharyvincze this PR should explicitly fail for this use case

8: tensor_multiply_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_multiply_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_multiply_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_multiply_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_multiply_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_multiply_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_multiply_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: tensor_divide_tensor_f16_ - Returned non-zero exit status : -13  ( RPP_ERROR_INVALID_SRC_OR_DST_DATATYPE ) 
8: 217 functionality variants requested by test_suite_misc_hip were not executed since these sub-variants are not currently supported in RPP.
8: 
8: -----------------------------------------------------------------------------------------------
8/8 Test #8: rpp_qa_tests_tensor_misc_hip_test_type_1 ....   Passed  577.59 sec

@kiritigowda
kiritigowda dismissed LakshmiKumar23’s stale review August 31, 2026 19:58

We need to get all use cases on the CI fail before my PR merges in

@kiritigowda

Copy link
Copy Markdown
Contributor

@zacharyvincze failing ci

The following tests FAILED:
	  5 - rpp_qa_tests_tensor_misc_host_test_type_1 (Failed)
	  8 - rpp_qa_tests_tensor_misc_hip_test_type_1 (Failed)
Errors while running CTest
Traceback (most recent call last):
  File "/__w/rocm-libraries/rocm-libraries/build_tools/github_actions/test_executable_scripts/test_rpp.py", line 121, in <module>
    execute_tests(env)
  File "/__w/rocm-libraries/rocm-libraries/build_tools/github_actions/test_executable_scripts/test_rpp.py", line 116, in execute_tests
    subprocess.run(cmd, cwd=RPP_TEST_DIR, check=True, env=env)
  File "/__w/_tool/Python/3.12.14/x64/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ctest', '--extra-verbose', '--output-on-failure']' returned non-zero exit status 8.

======================================================================
Resource Summary - Test rpp
======================================================================
Duration:     39.3 min (79 samples)
Memory:       9% peak (203.2 GB), 6% avg
CPU:          16/192 cores avg, 72 peak
Storage:      11070 GB min free
======================================================================
Max memory usage was 9%
======================================================================

@zacharyvincze

Copy link
Copy Markdown
Contributor Author

@kiritigowda error was due to test suite testing unsupported F16 dtype on a couple operators. Removing those from the test suite, will wait to see if CI passes.

@rrawther rrawther left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can be merged after CI passing all the tests

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The change is very broad (many HIP kernels and API entry points), so despite the improvements being mostly mechanical, it warrants a final human review to ensure no edge-case status/behavior regressions slipped in.

Review details
  • Files reviewed: 93/95 changed files
  • Comments generated: 1
  • Review effort level: Lite

@zacharyvincze
zacharyvincze enabled auto-merge (squash) September 23, 2026 17:12
@zacharyvincze
zacharyvincze merged commit 8111f9c into develop Sep 24, 2026
85 of 86 checks passed
@zacharyvincze
zacharyvincze deleted the users/zacharyvincze/rpp-status-propagation-fix branch September 24, 2026 06:12
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

spolifroni-amd added a commit that referenced this pull request Oct 15, 2026
JIRA ID : AIROCDOC-4468

Created a 10.2 entry for the rpp changelog. There is no rpp version. A
version bump would be required. The exact version is up to the rpp team.

Entry was ai-generated. This is where it came from:

The SIMDE build for non-x86 architectures comes from [pull request
12661](#12661), merged 13
October 2026. benrichard-amd added it so RPP can build where the code
was using x86 SIMD intrinsics. x86 builds stay on the native intrinsics.
It is part of [TheRock issue
5518](ROCm/TheRock#5518).

rppGetStatusString() comes from [pull request
11631](#11631), merged 30
September 2026. zacharyvincze added the helper to the public API so
callers can turn an RppStatus value into its enumerator name. It
resolves issue 11633.

gfx1250-strict comes from [pull request
12576](#12576), merged 25
September 2026. LakshmiKumar23 added that GPU target in the RPP HIP
CMake target list. The tracking ID on the pull request is AICV-307.

RPP_RETURN_IF_ERROR comes from [pull request
11311](#11311), merged 24
September 2026. zacharyvincze added the macro in rppdefs.h so a nested
RppStatus failure returns from the caller instead of being dropped.

The simde CMake dependency is the same change as the SIMDE build note,
[pull request 12661](#12661).
On non-x86, CMake finds simde with pkg-config and exports it to users of
the rpp package.

The rppt_log status fix comes from [pull request
12872](#12872), merged 6
October 2026. LakshmiKumar23 changed an unsupported source datatype so
it returns RPP_ERROR_INVALID_SRC_DATATYPE instead of
RPP_ERROR_INVALID_DST_DATATYPE.

The HIP dispatcher fix is the other half of [pull request
11311](#11311). It resolves
issue 11235. A kernel launch failure now returns RPP_ERROR_HIP_LAUNCH.
Before that, the dispatcher returned RPP_SUCCESS and the test suite
reported a pixel mismatch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

organization: ROCm project: rpp test:rpp Run full tests for rpp test_type:full If enabled, the PR will run full tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rpp] HIP kernel launch failures (e.g. hipErrorNoBinaryForGpu) are swallowed — RPP returns RPP_SUCCESS instead of an error

5 participants