Skip to content

Updates and test coverage for hipGraph support in rocRAND (#439) <cherry-picked from develop> - #482

Merged
stanleytsang-amd merged 1 commit into
ROCm:release-staging/rocm-rel-6.2from
umfranzw:cherry_pick_test_hipgraphs
May 2, 2024
Merged

stanleytsang-amd merged 1 commit into
ROCm:release-staging/rocm-rel-6.2from
umfranzw:cherry_pick_test_hipgraphs

Conversation

@umfranzw

Copy link
Copy Markdown
Collaborator

This change allows device-side generators to be used inside of hipGraphs. More specifically, you can wrap calls to rocrand_generate_* inside of a hipGraph. There are a few things to be aware of:

  • Generator creation (rocrand_create_generator), initialization (rocrand_initialize_generator), and destruction (rocrand_destroy_generator) must still happen outside the hipGraph.
  • After the generator is created, you may call API functions to set its seed, offset, and order.
  • After the generator is initialized (but before stream capture or manual graph creation begins), use rocrand_set_stream to set the stream the generator will use within the graph.
  • A generator's seed, offset, and stream may not be changed from within the hipGraph. Attempting to do so may result in unpredicable behaviour.
  • API calls for the poisson distribution (eg. rocrand_generate_poisson) are not yet supported inside of hipGraphs.

I've added a note to the changelog that mentions these details. In addition to the changes necessary to support the behaviour described above, this change also:

  • updates the changelog to alert the user to the restrictions mentioned above
  • adds new unit test coverage to exercises generators and distributions within hipGraphs.

This change allows device-side generators to be used inside of hipGraphs.
More specifically, you can wrap calls to rocrand_generate_* inside of a hipGraph. There are a few things to be aware of:
  - Generator creation (rocrand_create_generator), initialization (rocrand_initialize_generator), and destruction (rocrand_destroy_generator) must still happen outside the hipGraph.
  - After the generator is created, you may call API functions to set its seed, offset, and order.
  - After the generator is initialized (but before stream capture or manual graph creation begins), use rocrand_set_stream to set the stream the generator will use within the graph.
  - A generator's seed, offset, and stream may not be changed from within the hipGraph. Attempting to do so may result in unpredicable behaviour.
  - API calls for the poisson distribution (eg. rocrand_generate_poisson) are not yet supported inside of hipGraphs.

I've added a note to the changelog that mentions these details.
In addition to the changes necessary to support the behaviour described above, this change also:
- updates the changelog to alert the user to the restrictions mentioned above
- adds new unit test coverage to exercises generators and distributions within hipGraphs.

@RobsonRLemos RobsonRLemos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@stanleytsang-amd

Copy link
Copy Markdown
Collaborator

@randyh62 Could you review this please? Need an approval from docs team.

@randyh62 randyh62 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just a spelling error.

Comment thread CHANGELOG.md Resolved
@stanleytsang-amd
stanleytsang-amd merged commit d8d8ec9 into ROCm:release-staging/rocm-rel-6.2 May 2, 2024
stanleytsang-amd added a commit that referenced this pull request Jul 16, 2024
* Update device-specific config headers with benchmark tuning results (#483)

I ran the benchmark tuning code and scripts on the remaining
architectures in our GPU support matrix. This change updates
the config headers with the results.

* Updates and test coverage for hipGraph support in rocRAND (#439) (#482)

This change allows device-side generators to be used inside of hipGraphs.
More specifically, you can wrap calls to rocrand_generate_* inside of a hipGraph. There are a few things to be aware of:
  - Generator creation (rocrand_create_generator), initialization (rocrand_initialize_generator), and destruction (rocrand_destroy_generator) must still happen outside the hipGraph.
  - After the generator is created, you may call API functions to set its seed, offset, and order.
  - After the generator is initialized (but before stream capture or manual graph creation begins), use rocrand_set_stream to set the stream the generator will use within the graph.
  - A generator's seed, offset, and stream may not be changed from within the hipGraph. Attempting to do so may result in unpredicable behaviour.
  - API calls for the poisson distribution (eg. rocrand_generate_poisson) are not yet supported inside of hipGraphs.

I've added a note to the changelog that mentions these details.
In addition to the changes necessary to support the behaviour described above, this change also:
- updates the changelog to alert the user to the restrictions mentioned above
- adds new unit test coverage to exercises generators and distributions within hipGraphs.

* workaround for regression in sobol kernel (#485) (#487)

introduced by generic codepath for host and device generator

Co-authored-by: Nol Moonen <nol@streamhpc.com>

* Rename test_config_dispatch.cpp to test_rocrand_config_dispatch.cpp (#496)

* fix(lfsr113,mgr,,mtgp32,philox4x32,threefry,xorwow): force inline generate function (#495) (#497)

A compiler change caused the generate function to no longer be inlined which caused a performance regression. Force inlining resolves this.

Co-authored-by: Nara <nara@streamhpc.com>

* cmake: don't set CMAKE_C_COMPILER, as rocRAND is a CXX project (#502)

* cherry picking documentation from develop into 6.2 (#507)

* organizing docs into subfolders

* update license and index

* Update LICENSE.txt

Co-authored-by: Nara <naraenda@prasetya.eu>

* removing what-is-rocRAND

* Update Read the Docs configuration to use Python 3.10 and latest rocm-docs-core (#503)

* Bump urllib3 from 2.2.1 to 2.2.2 in /docs/sphinx (#505)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Nara <naraenda@prasetya.eu>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add an option for using TBB for host-side generators

* Add package dependencies on TBB if used

* Correct dependencies for RHEL / SLES

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Wayne Franz <wayfranz@amd.com>
Co-authored-by: Nol Moonen <nol@streamhpc.com>
Co-authored-by: Nara <nara@streamhpc.com>
Co-authored-by: Steve Leung <Steve.Leung@amd.com>
Co-authored-by: srawat <120587655+SwRaw@users.noreply.github.com>
Co-authored-by: Nara <naraenda@prasetya.eu>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
ammallya pushed a commit that referenced this pull request Oct 28, 2025
* Update device-specific config headers with benchmark tuning results (#483)

I ran the benchmark tuning code and scripts on the remaining
architectures in our GPU support matrix. This change updates
the config headers with the results.

* Updates and test coverage for hipGraph support in rocRAND (#439) (#482)

This change allows device-side generators to be used inside of hipGraphs.
More specifically, you can wrap calls to rocrand_generate_* inside of a hipGraph. There are a few things to be aware of:
  - Generator creation (rocrand_create_generator), initialization (rocrand_initialize_generator), and destruction (rocrand_destroy_generator) must still happen outside the hipGraph.
  - After the generator is created, you may call API functions to set its seed, offset, and order.
  - After the generator is initialized (but before stream capture or manual graph creation begins), use rocrand_set_stream to set the stream the generator will use within the graph.
  - A generator's seed, offset, and stream may not be changed from within the hipGraph. Attempting to do so may result in unpredicable behaviour.
  - API calls for the poisson distribution (eg. rocrand_generate_poisson) are not yet supported inside of hipGraphs.

I've added a note to the changelog that mentions these details.
In addition to the changes necessary to support the behaviour described above, this change also:
- updates the changelog to alert the user to the restrictions mentioned above
- adds new unit test coverage to exercises generators and distributions within hipGraphs.

* workaround for regression in sobol kernel (#485) (#487)

introduced by generic codepath for host and device generator

Co-authored-by: Nol Moonen <nol@streamhpc.com>

* Rename test_config_dispatch.cpp to test_rocrand_config_dispatch.cpp (#496)

* fix(lfsr113,mgr,,mtgp32,philox4x32,threefry,xorwow): force inline generate function (#495) (#497)

A compiler change caused the generate function to no longer be inlined which caused a performance regression. Force inlining resolves this.

Co-authored-by: Nara <nara@streamhpc.com>

* cmake: don't set CMAKE_C_COMPILER, as rocRAND is a CXX project (#502)

* cherry picking documentation from develop into 6.2 (#507)

* organizing docs into subfolders

* update license and index

* Update LICENSE.txt

Co-authored-by: Nara <naraenda@prasetya.eu>

* removing what-is-rocRAND

* Update Read the Docs configuration to use Python 3.10 and latest rocm-docs-core (#503)

* Bump urllib3 from 2.2.1 to 2.2.2 in /docs/sphinx (#505)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Nara <naraenda@prasetya.eu>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add an option for using TBB for host-side generators

* Add package dependencies on TBB if used

* Correct dependencies for RHEL / SLES

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Wayne Franz <wayfranz@amd.com>
Co-authored-by: Nol Moonen <nol@streamhpc.com>
Co-authored-by: Nara <nara@streamhpc.com>
Co-authored-by: Steve Leung <Steve.Leung@amd.com>
Co-authored-by: srawat <120587655+SwRaw@users.noreply.github.com>
Co-authored-by: Nara <naraenda@prasetya.eu>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>

[ROCm/rocRAND commit: f3a8622]
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.

4 participants