Skip to content

Add continuous distributions to dpnp.random.Generator - #3158

Open
ndgrigorian wants to merge 1 commit into
feature/device-rng-generatorfrom
feature/device-rng-continuous
Open

ndgrigorian wants to merge 1 commit into
feature/device-rng-generatorfrom
feature/device-rng-continuous

Conversation

@ndgrigorian

@ndgrigorian ndgrigorian commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds the continuous distributions to dpnp.random.Generator, as part of the series splitting #3147. It is stacked on #3157

The samplers are device ports of NumPy's algorithms:

  • exponential, standard_exponential, pareto, weibull, power, rayleigh
  • gamma, standard_gamma, beta, chisquare, standard_t, f
  • lognormal, standard_cauchy, wald, laplace, gumbel, logistic, triangular, vonmises

Parameters on the device aren't checked, since that would wait for the device. The rejection samplers instead return NaN for parameters that would make them loop forever, including valid ones that round badly in single precision

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

Port NumPy's continuous samplers to device kernels: exponential,
gamma, beta, chisquare, standard_t, f, lognormal, standard_cauchy,
wald, pareto, weibull, power, rayleigh, laplace, gumbel, logistic,
triangular and vonmises. The rejection samplers return NaN for device
parameters that would make them loop forever.
@ndgrigorian
ndgrigorian force-pushed the feature/device-rng-continuous branch from 0160558 to adf7178 Compare November 4, 2026 19:50
@ndgrigorian
ndgrigorian force-pushed the feature/device-rng-generator branch from 3963d20 to 6c3ff46 Compare November 4, 2026 19:50
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.22.0dev0=np2py314h8d9cdd5_28 ran successfully.
Passed: 1491
Failed: 0
Skipped: 6

@coveralls

coveralls commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage is 83.518% — feature/device-rng-continuous into feature/device-rng-generator. No base build found for feature/device-rng-generator.

This branch has not been deployed

No deployments
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.

2 participants