IntelPython / numba-dpex

Data Parallel Extension for Numba
https://intelpython.github.io/numba-dpex/
Apache License 2.0
75 stars 33 forks source link

Gaps in RNG function supported by numba_dpex.kernel v/s numba.cuda #159

Open akharche opened 3 years ago

akharche commented 3 years ago

Evaluate the RNG feature supported by numba.cuda and develop a plan on how to include support for similar functionality for numba_dpex.kernel.

Feature numba.cuda numba_dpex
New device array initialized for n random number generators numba.cuda.random.create_xoroshiro128p_states(n, seed, subsequence_start=0, stream=0) no
Initialize RNG states on the GPU for parallel generators numba.cuda.random.init_xoroshiro128p_states(states, seed, subsequence_start=0, stream=0) no
Return a float32 in range [0.0, 1.0) and advance states[index] numba.cuda.random.xoroshiro128p_uniform_float32(states, index) no
Return a float64 in range [0.0, 1.0) and advance states[index] numba.cuda.random.xoroshiro128p_uniform_float64(states, index) no
Return a normally distributed float32 and advance states[index] numba.cuda.random.xoroshiro128p_normal_float32(states, index) no
Return a normally distributed float64 and advance states[index] numba.cuda.random.xoroshiro128p_normal_float64(states, index) no

UPDATE: The issue was updated to only capture the missing RNG functionality in numba_dpex.kernel API.

PokhodenkoSA commented 3 years ago

Could be related:

diptorupd commented 7 months ago

@ZzEeKkAa I believe that the missing functionality is more or less implemented by in sklearn-numba-dpex in https://github.com/soda-inria/sklearn-numba-dpex/blob/main/sklearn_numba_dpex/common/random.py. We may be able to close the issue by simply porting over the file to numba-dpex.