Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

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

@RobsonRLemos RobsonRLemos left a comment

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
Collaborator

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

Copy link

@randyh62 randyh62 left a comment

Choose a reason for hiding this comment

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

Just a spelling error.

@stanleytsang-amd stanleytsang-amd merged commit d8d8ec9 into ROCm:release-staging/rocm-rel-6.2 May 2, 2024
20 of 23 checks passed
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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Nara <[email protected]>
Co-authored-by: Sam Wu <[email protected]>
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] <[email protected]>
Co-authored-by: Wayne Franz <[email protected]>
Co-authored-by: Nol Moonen <[email protected]>
Co-authored-by: Nara <[email protected]>
Co-authored-by: Steve Leung <[email protected]>
Co-authored-by: srawat <[email protected]>
Co-authored-by: Nara <[email protected]>
Co-authored-by: Sam Wu <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lauren Wrubleski <[email protected]>
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