Skip to content

Conversation

@Maetveis
Copy link

@Maetveis Maetveis commented Jul 7, 2022

rocRAND google benchmark integration

This pull request includes an initiative to replacing the current benchmark system with Google benchmark. Google benchmark has a number of advantages over the current benchmark system, like integrated options for filtering benchmarks by regex, and outputting machine-readable results in json or csv format. Furthermore, google benchmark is also used by a number of other ROCm repositories, such as rocPRIM and hipCUB, and so this reduces the total amount of custom benchmark processing scripts required.

The changes in this pull request have the following implications:

  • Google benchmark is automatically downloaded during the build process if required, similar to google test and similar to the other repositories.
  • The amount of parameter-handling code required is minimized, this is now handled by the --benchmark_filter option of Google benchmark.
  • Some additional information about the benchmark is gathered and included in the benchmark output. This mostly consists of the hipDeviceProp_t of the device that the benchmarks were executed on, and can be useful during futher processing of the results.

Additional changes

There are some minor changes included mainly addressing the gitlab CI

  • the URL of the hipRAND submodule is changed to be relative going back only one level (removing the explicit ROCmSoftwarePlatform part) so the submodule works in a fork of rocRAND as long as hipRAND is also forked
  • Updated .clang-format file and commit hooks for rejecting incorrectly formatted commits
  • A workaround for the packaging test for the hip headers on the NVIDIA platform. (It is fixed in master but not yet in the latest rocm release)

@Maetveis Maetveis force-pushed the googlebenchmark-integration branch from c94865a to 4191b49 Compare August 4, 2022 07:37
@Maetveis
Copy link
Author

Maetveis commented Aug 4, 2022

Restored the legacy generate benchmark, and added an option to enable building them (on by default). The default can be changed to OFF in later versions, before the legacy benchmarks are removed.

If legacy benchmarks are enabled a deprecation warning is printed to warn users, it can be disabled by passing -Wno-deprecated as documented for CMAKE_WARN_DEPRECATED

Additional changes:
The commit hook script is made more portable by using env

@Maetveis
Copy link
Author

Maetveis commented Aug 4, 2022

Dropped the compiler workaround in Dependencies.cmake, as the cause is fixed in googlebenchmark since 1.4.5 (the PR already requires 1.6.1)

mfep and others added 12 commits September 12, 2022 09:46
Instead of an ad-hoc reporting format, use the googlebenchmark library to define, filter and execute benchmarks.
Custom context information is also added to the benchmark for archival reasons similar to rocPRIM.
Googlebenchmark is automatically downloaded if not found when benchmarks are enabled.
…test

The hip headers have device only code visible to the host compiler on
the nvcc path. Package test is compiled with just the host compiler
because its only using the host api of rocrand. This workaround sets it
to CUDA mode in the nvcc path until the fix for hip headers is released.

Modernize to CUDA language instead of FindCuda.cmake.
The underlying issue has been fixed in latest rocm-cmake.
On some distributions (notable ones include alpine and nixos) `bash`
is not part of the base installation, therefore its not installed in `/bin`.
Use `env` to find bash in the `PATH` which is portable on most *nix
systems.
Restore the old `bencmark_rocrand_generate` for backwards compatibility.
Add the googlebenchmark based version as `benchmark_rocrand_host_api`.
Building the old benchmark can be enabled by setting `BUILD_LEGACY_BENCHMARK`
to `ON` (on by default).
A later change can change the default and then finally remove the old
benchmarks giving users time to adjust to the changes.
The underlying issue has been fixed in v1.5.5 with
google/benchmark#1174. The workaround is no
longer needed.
@nolmoonen nolmoonen force-pushed the googlebenchmark-integration branch from a37ac5d to 76fa592 Compare September 12, 2022 10:57
@nolmoonen
Copy link
Collaborator

Rebased the branch.

* Update windows compiler for googlebenchmark

* Fix line indentations
@stanleytsang-amd stanleytsang-amd self-requested a review September 27, 2022 18:12
@stanleytsang-amd stanleytsang-amd merged commit 622e20e into develop Sep 27, 2022
neon60 pushed a commit that referenced this pull request Jan 10, 2024
Added docs on generating dynamic ordering configs

Closes #277

See merge request amd/libraries/rocRAND!287
Naraenda pushed a commit to StreamHPC/rocRAND that referenced this pull request Jan 16, 2024
Added docs on generating dynamic ordering configs

Closes ROCm#277

See merge request amd/libraries/rocRAND!287
mfep added a commit to StreamHPC/rocRAND that referenced this pull request Jan 23, 2024
Added docs on generating dynamic ordering configs

Closes ROCm#277

See merge request amd/libraries/rocRAND!287
mfep added a commit to StreamHPC/rocRAND that referenced this pull request Feb 19, 2024
Added docs on generating dynamic ordering configs

Closes ROCm#277

See merge request amd/libraries/rocRAND!287
mfep added a commit to StreamHPC/rocRAND that referenced this pull request Feb 23, 2024
Added docs on generating dynamic ordering configs

Closes ROCm#277

See merge request amd/libraries/rocRAND!287
ammallya pushed a commit that referenced this pull request Oct 28, 2025
* Fix CI

* add clang format file and ci lint stage

* Use googlebenchmark for the generate benchmark

Instead of an ad-hoc reporting format, use the googlebenchmark library to define, filter and execute benchmarks.
Custom context information is also added to the benchmark for archival reasons similar to rocPRIM.
Googlebenchmark is automatically downloaded if not found when benchmarks are enabled.

* Workaround broken hip headers included from host compiler in package test

The hip headers have device only code visible to the host compiler on
the nvcc path. Package test is compiled with just the host compiler
because its only using the host api of rocrand. This workaround sets it
to CUDA mode in the nvcc path until the fix for hip headers is released.

Modernize to CUDA language instead of FindCuda.cmake.

* Revert workaround for `ROCM_SYMLINK_LIBS`

The underlying issue has been fixed in latest rocm-cmake.

* Fix shebang of check-format.sh using env

On some distributions (notable ones include alpine and nixos) `bash`
is not part of the base installation, therefore its not installed in `/bin`.
Use `env` to find bash in the `PATH` which is portable on most *nix
systems.

* Separate new and legacy benchmarks with a cmake option

Restore the old `bencmark_rocrand_generate` for backwards compatibility.
Add the googlebenchmark based version as `benchmark_rocrand_host_api`.
Building the old benchmark can be enabled by setting `BUILD_LEGACY_BENCHMARK`
to `ON` (on by default).
A later change can change the default and then finally remove the old
benchmarks giving users time to adjust to the changes.

* Use the new benchmark name for the host api benchmark

* Add deprecation for BUILD_LEGACY_BENCHMARK

* Drop googlebenchmark compiler override

The underlying issue has been fixed in v1.5.5 with
google/benchmark#1174. The workaround is no
longer needed.

* Fixes to enable benchmark build on Windows (#282)

* add new generators to changed benchmarks

* Windows googlebench ci fix (#294)

* Update windows compiler for googlebenchmark

* Fix line indentations

Co-authored-by: Lőrinc Serfőző <lorinc@streamhpc.com>
Co-authored-by: Nol Moonen <nol@streamhpc.com>
Co-authored-by: Bibrak Qamar <bibrak@streamhpc.com>
Co-authored-by: Máté Ferenc Nagy-Egri <mate@streamhpc.com>
Co-authored-by: Stanley Tsang <stanley.tsang@amd.com>

[ROCm/rocRAND commit: 622e20e]
ammallya pushed a commit that referenced this pull request Oct 28, 2025
Added docs on generating dynamic ordering configs

Closes #277

See merge request amd/libraries/rocRAND!287

[ROCm/rocRAND commit: 6806ae8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants