Repository navigation
Reimplement dpnp.random.RandomState on the device RNG - #3162
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-bit-generators
branch
from
November 4, 2026 19:47
b5f1504 to
3565820
Compare
ndgrigorian
force-pushed
the
feature/device-rng-random-state
branch
from
November 4, 2026 19:47
315889e to
142a3d8
Compare
RandomState and the module functions now delegate to the Generator samplers, keeping NumPy's legacy checks and messages, also for parameters on the device. The module keeps one RandomState per queue, and adds get_state, set_state, get_bit_generator and set_bit_generator. Enable the CuPy random tests the device RNG supports.
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-random-state
branch
from
November 4, 2026 19:50
142a3d8 to
160719a
Compare
Contributor
|
Array API standard conformance tests for dpnp=0.22.0dev0=np2py314h8d9cdd5_32 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 moves
dpnp.random.RandomStateand thedpnp.randommodule functions onto the device RNG, as part of the series splitting #3147. It is stacked on #3161RandomStatenow delegates to theGeneratorsamplers, with NumPy's legacy checks and error messages. UnlikeGenerator, it also checks parameters on the device, as CuPy does, which waits for the device. The module functions keep oneRandomStateper queue: the queue given bydevice/sycl_queue, or else that of the firstdpnp.ndarrayparameter, or else the default queueAdds
get_state,set_state,get_bit_generatorandset_bit_generator(per queue;seedreseeds in place)RandomStateRandomStatealso receives changesdevice,usm_typeandsycl_queueare keyword-onlyrandnno longer takesd0=uniformno longer takes an integer dtyperandint(dtype=int)returns int64shufflerequires adpnp.ndarrayAlso enables the CuPy
random_teststhe device RNG supports, with per-test skips for CuPy internals and the bit generators we don't provide, and drops the random entries of the skip lists. The ones inskipped_tests_cuda.tblare dropped too, but haven't been run on CUDAThe legacy Cython module is still built but no longer used; #3163 removes it