Skip to content

[FEA]: Implement new random number generators #5679

Closed

Description

@RAMitchell

Is this a duplicate?

Area

Thrust

Is your feature request related to a problem? Please describe.

Thrust currently implements the following random number generators:

thrust::random::minstd_rand
thrust::random::ranlux24_base
thrust::random::ranlux48
thrust::random::default_random_engine
thrust::random::ranlux24
thrust::random::taus88
thrust::random::ranlux48_base
thrust::random::minstd_rand0

These leave a little to be desired in either performance (either generation or advancing) or robustness in comparison to some recent developments in the field.

Describe the solution you'd like

I propose adding:
https://en.cppreference.com/w/cpp/numeric/random/philox_engine.html
https://en.wikipedia.org/wiki/Permuted_congruential_generator (PCG64 as used in numpy).

Furthermore, I think documentation could be improved in the following areas:

  • Example code of how generators are expected to be used in a parallel environment (e.g. generate/for_each).
  • Documentation of complexity of discard method for generators. This is critical for evaluating the performance of generators in parallel launches.
  • Documentation of the relative 'strength' of each generator on standardised benchmarks to help users make a selection. I suspect the current default random generator minstd would not hold up here and thus we could guide users to a stronger generator for more sensitive applications (e.g. Monte Carlo).

Describe alternatives you've considered

No response

Additional context

Related issues #758, #2510, @djns99

Activity

  1. miscco commented on Aug 27, 2025

    @miscco
    Contributor

    Thanks a lot for the suggestions.

    Random number generation is definitely something we are interested in, but its also something that is relatively low priority.

    Mind that we would rather move new features into cuda aka libcu++ rather than Thrust

  2. alliepiper commented on Sep 2, 2025

    @alliepiper
    Contributor

    I've wanted us to have PCG for a while, it'd be a very welcome addition.

  3. gevtushenko commented on Oct 10, 2026

    @gevtushenko
    Collaborator

    Closing: cuda::std::philox_engine and cuda::pcg64 are now in libcu++. The remaining documentation ideas (parallel usage examples, discard complexity, and generator quality guidance) are tracked separately.

  4. moved this from Todo to Done in CCCLon Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions