Skip to content

(fix) rocthrust: Do not build rocRAND benchmarks when building rocThrust benchmarks - #10956

Merged
stanleytsang-amd merged 3 commits into
developfrom
users/stanleytsang-amd/fix-rocthrust-benchmark-build
Aug 18, 2026
Merged

stanleytsang-amd merged 3 commits into
developfrom
users/stanleytsang-amd/fix-rocthrust-benchmark-build

Conversation

@stanleytsang-amd

@stanleytsang-amd stanleytsang-amd commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

An oversight from the inclusion of the rocRAND dependency into rocThrust is that they both share common CMake options. When building rocThrust benchmarks, BUILD_BENCHMARK=ON must be set. This same CMake option is present in rocRAND. Thus, anytime rocThrust must download/clone rocRAND as a dependency and builds benchmarks, it also causes the local copy of rocRAND to build its benchmarks as well. This, in combination with the recent 5.0.0 version bump of rocRAND in rocThrust's dependencies, triggered a primbench.hpp not found error.

Technical Details

FetchContent runs in-process, so rocthrust's BUILD_BENCHMARK=ON leaks into rocrand and causes its benchmarks to build. I've suppressed that in rocThrust via an explicit set(BUILD_BENCHMARK OFF) immediatley before FetchContent_Declare(rocrand). Then turn BUILD_BENCHMARK=ON immediately after so that rocThrust's benchmarks build.

Test Plan

Ran the rocThrust benchmark build locally.

Test Result

it no longer build the rocRAND benchmark. The rocthrust benchmark build works.

Submission Checklist

JIRA ID: ROCM-29174

@therock-pr-bot

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

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 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.

@amd-jmahovsky amd-jmahovsky 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.

LGTM

@stanleytsang-amd
stanleytsang-amd force-pushed the users/stanleytsang-amd/fix-rocthrust-benchmark-build branch from c8489c8 to 6154626 Compare August 18, 2026 19:21
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #10956      +/-   ##
===========================================
+ Coverage    69.35%   69.42%   +0.07%     
===========================================
  Files         2777     2807      +30     
  Lines       457901   459846    +1945     
  Branches     67514    67824     +310     
===========================================
+ Hits        317547   319220    +1673     
- Misses      117221   117457     +236     
- Partials     23133    23169      +36     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 38.06% <ø> (ø) Carriedforward from 2a35abf
TensileLite-Unit 76.51% <ø> (ø) Carriedforward from 2a35abf
hipBLAS 90.62% <ø> (ø) Carriedforward from 2a35abf
hipBLASLt 34.89% <ø> (ø) Carriedforward from 2a35abf
hipCUB 82.68% <ø> (ø) Carriedforward from 2a35abf
hipDNN 86.78% <ø> (ø) Carriedforward from 2a35abf
hipFFT 43.60% <ø> (ø) Carriedforward from 2a35abf
hipRAND 76.12% <ø> (ø) Carriedforward from 2a35abf
hipSOLVER 69.03% <ø> (ø) Carriedforward from 2a35abf
hipSPARSE 86.99% <ø> (ø) Carriedforward from 2a35abf
rocBLAS 48.26% <ø> (ø) Carriedforward from 2a35abf
rocFFT 47.64% <ø> (ø) Carriedforward from 2a35abf
rocRAND 57.05% <ø> (ø) Carriedforward from 2a35abf
rocSOLVER 77.12% <ø> (ø) Carriedforward from 2a35abf
rocSPARSE 74.60% <ø> (ø) Carriedforward from 2a35abf
rocThrust 91.34% <ø> (-0.26%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.
see 328 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stanleytsang-amd
stanleytsang-amd merged commit cc70771 into develop Aug 18, 2026
60 of 63 checks passed
@stanleytsang-amd
stanleytsang-amd deleted the users/stanleytsang-amd/fix-rocthrust-benchmark-build branch August 18, 2026 21:51
marbre pushed a commit that referenced this pull request Aug 18, 2026
See #10956.

An oversight from the inclusion of the rocRAND dependency into rocThrust
is that they both share common CMake options. When building rocThrust
benchmarks, `BUILD_BENCHMARK=ON` must be set. This same CMake option is
present in rocRAND. Thus, anytime rocThrust must download/clone rocRAND
as a dependency and builds benchmarks, it also causes the local copy of
rocRAND to build its benchmarks as well. This, in combination with the
recent 5.0.0 version bump of rocRAND in rocThrust's dependencies,
triggered a primbench.hpp not found error.

JIRA ID: ROCM-29174

## Technical Details

FetchContent runs in-process, so rocthrust's BUILD_BENCHMARK=ON leaks
into rocrand and causes its benchmarks to build. I've suppressed that in
rocThrust via an explicit `set(BUILD_BENCHMARK OFF)` immediatley before
`FetchContent_Declare(rocrand)`. Then turn BUILD_BENCHMARK=ON
immediately after so that rocThrust's benchmarks build.

## Test Plan

Ran the rocThrust benchmark build locally.  CI ran on #10956

## Test Result

CI passed, benchmark build worked.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
stanleytsang-amd added a commit that referenced this pull request Aug 19, 2026
## Motivation

Further investigation revealed some bugs in the fetch_dep call that is
used to get rocPRIM and/or rocRAND as dependencies. Hardcoded references
to rocPRIM were used, which obviously breaks when trying to fetch
rocRAND. This was causing rocRAND installs not being found, specifically
in [TheRock CI for ROCm
10](https://github.com/ROCm/TheRock/actions/runs/32192515118/job/95906621978?pr=7330),
which in turn triggered rocThrust to download rocRAND, which in turn
triggers #10967 and #10956, and also other behaviour that will soon be
undesired, specifically the packaging of duplicate files in separate
library packages. Unfortunately for this last behaviour, the fix is
beyond the scope of ROCm 10.

## Technical Details

Fix the `fetch_dep` function in cmake/Dependencies.cmake to properly
handle both rocPRIM and rocRAND.

## Test Plan

Run ROCm/TheRock#7475 in advance to see if
TheRock CI passes completely.

## Test Result

While it is still running at the time of writing, the Validate Artifact
Structure job passed, which is what this PR aims to fix. I will check in
the morning on the status.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
marbre added a commit that referenced this pull request Aug 19, 2026
… 10.0 (#10991)

This PR cherry picks #10978 to the 10.0 release branch.

## Motivation

Further investigation revealed some bugs in the fetch_dep call that is
used to get rocPRIM and/or rocRAND as dependencies. Hardcoded references
to rocPRIM were used, which obviously breaks when trying to fetch
rocRAND. This was causing rocRAND installs not being found, specifically
in [TheRock CI for ROCm
10](https://github.com/ROCm/TheRock/actions/runs/32192515118/job/95906621978?pr=7330),
which in turn triggered rocThrust to download rocRAND, which in turn
triggers #10967 and #10956, and also other behaviour that will soon be
undesired, specifically the packaging of duplicate files in separate
library packages. Unfortunately for this last behaviour, the fix is
beyond the scope of ROCm 10.

## Technical Details

Fix the `fetch_dep` function in cmake/Dependencies.cmake to properly
handle both rocPRIM and rocRAND.

## Test Plan

Run ROCm/TheRock#7475 in advance to see if
TheRock CI passes completely.

## Test Result

While it is still running at the time of writing, the Validate Artifact
Structure job passed, which is what this PR aims to fix. The windows
jobs seem stuck but everything else passes.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

JIRA ID: ROCM-29174

---------

Co-authored-by: Marius Brehler <marius.brehler@amd.com>
NguyenNhuDi added a commit that referenced this pull request Aug 20, 2026
…ts (#11045)

## Motivation
Follow up on #10956. This one does the unit tests.

@skip-pr-bot

## Technical Details

See #10956 

## Test Plan



## Test Result


## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
stanleytsang-amd added a commit that referenced this pull request Sep 18, 2026
…ust benchmarks (#10956)

## Motivation

An oversight from the inclusion of the rocRAND dependency into rocThrust
is that they both share common CMake options. When building rocThrust
benchmarks, `BUILD_BENCHMARK=ON` must be set. This same CMake option is
present in rocRAND. Thus, anytime rocThrust must download/clone rocRAND
as a dependency and builds benchmarks, it also causes the local copy of
rocRAND to build its benchmarks as well. This, in combination with the
recent 5.0.0 version bump of rocRAND in rocThrust's dependencies,
triggered a primbench.hpp not found error.

## Technical Details

FetchContent runs in-process, so rocthrust's BUILD_BENCHMARK=ON leaks
into rocrand and causes its benchmarks to build. I've suppressed that in
rocThrust via an explicit `set(BUILD_BENCHMARK OFF)` immediatley before
`FetchContent_Declare(rocrand)`. Then turn BUILD_BENCHMARK=ON
immediately after so that rocThrust's benchmarks build.

## Test Plan

Ran the rocThrust benchmark build locally.

## Test Result

it no longer build the rocRAND benchmark. The rocthrust benchmark build
works.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

JIRA ID: ROCM-29174
stanleytsang-amd added a commit that referenced this pull request Sep 18, 2026
## Motivation

Further investigation revealed some bugs in the fetch_dep call that is
used to get rocPRIM and/or rocRAND as dependencies. Hardcoded references
to rocPRIM were used, which obviously breaks when trying to fetch
rocRAND. This was causing rocRAND installs not being found, specifically
in [TheRock CI for ROCm
10](https://github.com/ROCm/TheRock/actions/runs/32192515118/job/95906621978?pr=7330),
which in turn triggered rocThrust to download rocRAND, which in turn
triggers #10967 and #10956, and also other behaviour that will soon be
undesired, specifically the packaging of duplicate files in separate
library packages. Unfortunately for this last behaviour, the fix is
beyond the scope of ROCm 10.

## Technical Details

Fix the `fetch_dep` function in cmake/Dependencies.cmake to properly
handle both rocPRIM and rocRAND.

## Test Plan

Run ROCm/TheRock#7475 in advance to see if
TheRock CI passes completely.

## Test Result

While it is still running at the time of writing, the Validate Artifact
Structure job passed, which is what this PR aims to fix. I will check in
the morning on the status.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
stanleytsang-amd pushed a commit that referenced this pull request Sep 18, 2026
…ts (#11045)

## Motivation
Follow up on #10956. This one does the unit tests.

@skip-pr-bot

## Technical Details

See #10956 

## Test Plan



## Test Result


## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
NguyenNhuDi added a commit that referenced this pull request Sep 22, 2026
…not `ON` (#12391)

## Motivation
While building for `CUDA` backend with `hip-nv-dev` preset, `BUILD_TEST`
was getting set to `ON` even though preset sets it to `OFF`. This causes
build errors when building benchmarks for `rocthrust`.
## Technical Details

There was an issue where `BUILD_TEST` and `BUILD_BENCHMARK` was leaking
into `rocRAND` build. There was a fix in prs #11045 and #10956, however
these PRs just set set `BUILD_TEST` and `BUILD_BENCHMARK` to `ON`. In
cases where only `BUILD_TEST` was set to `ON` or only `BUILD_BENCHMARK`
was set to `ON` this would turn on the other no matter what. In the case
of `hip-nv-dev` preset this would set `BUILD_TEST` to `ON` even though
in this case we need it to be set `OFF`.

By storing the variables into temp variables before forcing them `OFF`
we can restore the original state after `rocRAND` is finished.

@skip-pr-bot
## Test Plan
Local compilation with `hip-nv-dev` preset. 

## Test Result

No more cmake errors.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
illsilin pushed a commit to igorluppi/rocm-libraries that referenced this pull request Oct 1, 2026
…ust benchmarks (ROCm#10956)

## Motivation

An oversight from the inclusion of the rocRAND dependency into rocThrust
is that they both share common CMake options. When building rocThrust
benchmarks, `BUILD_BENCHMARK=ON` must be set. This same CMake option is
present in rocRAND. Thus, anytime rocThrust must download/clone rocRAND
as a dependency and builds benchmarks, it also causes the local copy of
rocRAND to build its benchmarks as well. This, in combination with the
recent 5.0.0 version bump of rocRAND in rocThrust's dependencies,
triggered a primbench.hpp not found error.

## Technical Details

FetchContent runs in-process, so rocthrust's BUILD_BENCHMARK=ON leaks
into rocrand and causes its benchmarks to build. I've suppressed that in
rocThrust via an explicit `set(BUILD_BENCHMARK OFF)` immediatley before
`FetchContent_Declare(rocrand)`. Then turn BUILD_BENCHMARK=ON
immediately after so that rocThrust's benchmarks build.

## Test Plan

Ran the rocThrust benchmark build locally.

## Test Result

it no longer build the rocRAND benchmark. The rocthrust benchmark build
works.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

JIRA ID: ROCM-29174
illsilin pushed a commit to igorluppi/rocm-libraries that referenced this pull request Oct 1, 2026
## Motivation

Further investigation revealed some bugs in the fetch_dep call that is
used to get rocPRIM and/or rocRAND as dependencies. Hardcoded references
to rocPRIM were used, which obviously breaks when trying to fetch
rocRAND. This was causing rocRAND installs not being found, specifically
in [TheRock CI for ROCm
10](https://github.com/ROCm/TheRock/actions/runs/32192515118/job/95906621978?pr=7330),
which in turn triggered rocThrust to download rocRAND, which in turn
triggers ROCm#10967 and ROCm#10956, and also other behaviour that will soon be
undesired, specifically the packaging of duplicate files in separate
library packages. Unfortunately for this last behaviour, the fix is
beyond the scope of ROCm 10.

## Technical Details

Fix the `fetch_dep` function in cmake/Dependencies.cmake to properly
handle both rocPRIM and rocRAND.

## Test Plan

Run ROCm/TheRock#7475 in advance to see if
TheRock CI passes completely.

## Test Result

While it is still running at the time of writing, the Validate Artifact
Structure job passed, which is what this PR aims to fix. I will check in
the morning on the status.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
illsilin pushed a commit to igorluppi/rocm-libraries that referenced this pull request Oct 1, 2026
…ts (ROCm#11045)

## Motivation
Follow up on ROCm#10956. This one does the unit tests.

@skip-pr-bot

## Technical Details

See ROCm#10956 

## Test Plan



## Test Result


## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
stanleytsang-amd pushed a commit that referenced this pull request Oct 2, 2026
…not `ON` (#12391)

## Motivation
While building for `CUDA` backend with `hip-nv-dev` preset, `BUILD_TEST`
was getting set to `ON` even though preset sets it to `OFF`. This causes
build errors when building benchmarks for `rocthrust`.
## Technical Details

There was an issue where `BUILD_TEST` and `BUILD_BENCHMARK` was leaking
into `rocRAND` build. There was a fix in prs #11045 and #10956, however
these PRs just set set `BUILD_TEST` and `BUILD_BENCHMARK` to `ON`. In
cases where only `BUILD_TEST` was set to `ON` or only `BUILD_BENCHMARK`
was set to `ON` this would turn on the other no matter what. In the case
of `hip-nv-dev` preset this would set `BUILD_TEST` to `ON` even though
in this case we need it to be set `OFF`.

By storing the variables into temp variables before forcing them `OFF`
we can restore the original state after `rocRAND` is finished.

@skip-pr-bot
## Test Plan
Local compilation with `hip-nv-dev` preset.

## Test Result

No more cmake errors.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
Naraenda pushed a commit that referenced this pull request Oct 5, 2026
…not `ON` (#12391)

## Motivation
While building for `CUDA` backend with `hip-nv-dev` preset, `BUILD_TEST`
was getting set to `ON` even though preset sets it to `OFF`. This causes
build errors when building benchmarks for `rocthrust`.
## Technical Details

There was an issue where `BUILD_TEST` and `BUILD_BENCHMARK` was leaking
into `rocRAND` build. There was a fix in prs #11045 and #10956, however
these PRs just set set `BUILD_TEST` and `BUILD_BENCHMARK` to `ON`. In
cases where only `BUILD_TEST` was set to `ON` or only `BUILD_BENCHMARK`
was set to `ON` this would turn on the other no matter what. In the case
of `hip-nv-dev` preset this would set `BUILD_TEST` to `ON` even though
in this case we need it to be set `OFF`.

By storing the variables into temp variables before forcing them `OFF`
we can restore the original state after `rocRAND` is finished.

@skip-pr-bot
## Test Plan
Local compilation with `hip-nv-dev` preset.

## Test Result

No more cmake errors.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
Naraenda pushed a commit that referenced this pull request Oct 7, 2026
…not `ON` (#12391)

## Motivation
While building for `CUDA` backend with `hip-nv-dev` preset, `BUILD_TEST`
was getting set to `ON` even though preset sets it to `OFF`. This causes
build errors when building benchmarks for `rocthrust`.
## Technical Details

There was an issue where `BUILD_TEST` and `BUILD_BENCHMARK` was leaking
into `rocRAND` build. There was a fix in prs #11045 and #10956, however
these PRs just set set `BUILD_TEST` and `BUILD_BENCHMARK` to `ON`. In
cases where only `BUILD_TEST` was set to `ON` or only `BUILD_BENCHMARK`
was set to `ON` this would turn on the other no matter what. In the case
of `hip-nv-dev` preset this would set `BUILD_TEST` to `ON` even though
in this case we need it to be set `OFF`.

By storing the variables into temp variables before forcing them `OFF`
we can restore the original state after `rocRAND` is finished.

@skip-pr-bot
## Test Plan
Local compilation with `hip-nv-dev` preset.

## Test Result

No more cmake errors.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
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.

2 participants