Repository navigation
Add PCG64DXSM and MRG32k3a bit generators to dpnp.random - #3161
Open
ndgrigorian wants to merge 1 commit into
Open
ndgrigorian wants to merge 1 commit into
ndgrigorian wants to merge 1 commit into
Conversation
ndgrigorian
requested review from
antonwolfy and
vlad-perevezentsev
as code owners
November 4, 2026 19:46
This was referenced Nov 4, 2026
ndgrigorian
force-pushed
the
feature/device-rng-multivariate
branch
from
November 4, 2026 19:47
be00c84 to
742674f
Compare
ndgrigorian
force-pushed
the
feature/device-rng-bit-generators
branch
from
November 4, 2026 19:47
b5f1504 to
3565820
Compare
PCG64DXSM is a custom engine bit-identical with NumPy's for raw values, random, uniform and bytes, drawn in a sequential layout for the samplers taking a fixed number of draws. MRG32k3a uses oneMKL's device engine, with work-item w on substream w. sycl::mul_hi is replaced with a limb-based umul_hi, as DPC++ 2026.2 miscompiles it on Intel GPUs.
ndgrigorian
force-pushed
the
feature/device-rng-bit-generators
branch
from
November 4, 2026 19:50
3565820 to
e06fd8c
Compare
ndgrigorian
force-pushed
the
feature/device-rng-multivariate
branch
from
November 4, 2026 19:50
742674f to
9c726f8
Compare
Contributor
|
View rendered docs @ https://intelpython.github.io/dpnp/pull/3161/index.html |
Contributor
|
Array API standard conformance tests for dpnp=0.22.0dev0=np2py314h8d9cdd5_31 ran successfully. |
Collaborator
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds two more bit generators to
dpnp.random, as part of the series splitting #3147. It is stacked on #3160PCG64DXSM, a custom engine (oneMKL'spcg64_dxsmhas a hard-coded increment) that is bit-identical with NumPy's forrandom_raw,random(f32/f64),uniformandbytes, and exchanges states withnumpy.random.PCG64DXSM. The samplers taking a fixed number of draws per element use a new sequential layout, which reproduces NumPy's stream order; the others give work-itemwthe stream of NumPy'sjumped(w)MRG32k3a, on oneMKL's devicemrg32k3a, where work-itemwdraws from substreamw. Each work-item produces 128 elements, since moving to a substream costs a matrix product per digit, and 8 elements per work-item were 2x (GPU) to 10x (CPU) slower than Philoxitems_per_work_itemis now a per-engine trait, exposed to Python as_rng_impl.items_per_work_item