Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Use RAFT's RngState on APIs, DeviceState within kernels, and use specialized distributions for generating numbers #23

Description

@MatthiasKohl
  1. Any API generating random numbers should use raft::random::RngState instead of the direct values for seed etc.
  2. Implementations of these APIs should call RngState.advance accordingly so that they can be invoked several times without the user having to re-seed correctly (this is not trivial !)
  3. Kernels should use DeviceState constructed from RngState in their signatures
  4. Kernels should use <GeneratorClass>(device_state, subsequence) constructors instead of direct seed / subsequence constructors which are for advanced usage in RAFT
  5. Kernels should call the appropriate distributions. For example, both kernels in unweighted_sample_without_replacement_func.cuh use bounded integer generation. They should use the appropriate RAFT distribution (https://github.com/rapidsai/raft/blob/branch-23.08/cpp/include/raft/random/detail/rng_device.cuh#L183 in this case) which are more optimized
  6. Generation for unweighted_sample_without_replacement_kernel seems wrong: idx < M may be ==N which would lead to undefined behavior. Maybe this should be idx < N instead.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions