Registry / ai-ml / onemkl-sycl-rng

onemkl-sycl-rng

JSON →
library2026.0.0pypypiunverified

Intel® oneAPI Math Kernel Library (oneMKL) Random Number Generators (RNG) component for SYCL. Provides high-performance pseudorandom and quasi-random number generation on Intel GPUs and CPUs. Current version 2026.0.0. Released as part of the Intel oneAPI 2026.0 toolkit. Follows Intel's release cadence (yearly).

pip install onemkl-sycl-rng
INSTALL
IMPORT
SIG · ONEMKL-SYCL-RNG
O
onemkl-sycl-rng
ai-mlpythonv2026.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rng
✓ import onemkl_sycl_rng
✗ import onemkl._sycl_rng.rng as mkl_rng

Basic usage: create engine, create distribution, generate random numbers into a dpnp array.

import dpctl import dpnp as np from onemkl._sycl_rng import rng as mkl_rng # Create a SYCL queue (e.g., GPU) queue = dpctl.SyclQueue("gpu") # Create an RNG engine and distribution engine = mkl_rng.create_engine(queue, mkl_rng.brng.mrg32k3a) dist = mkl_rng.create_distribution(mkl_rng.distribution.uniform, 0.0, 1.0) # Generate random numbers result = np.empty(1000, dtype=np.float64) mkl_rng.generate(queue, engine, dist, result) print(result[:5])
Debug
Known issues
breakingTop-level import path changed: use onemkl._sycl_rng.rng (not onemkl.sycl_rng.rng). The underscore prefix indicates private module – no stability guaranteed.
fix
Update import to: from onemkl._sycl_rng import rng as mkl_rng
affects: >=2025.0.0
deprecatedThe mkl_random module (from older mkl-random package) is deprecated. Use onemkl-sycl-rng for SYCL-based random number generation.
fix
Replace mkl_random imports with onemkl._sycl_rng.rng and use dpnp arrays.
affects: all
gotchaAll data buffers must be dpnp arrays (or usm_ndarray). NumPy arrays are not supported and will cause runtime errors.
fix
Use dpnp.array(...) or dpctl.tensor.usm_ndarray to allocate memory.
affects: all
gotchaEngine and distribution objects must be re-created for each queue. Attempting to reuse an engine on a different device queue may cause silent failures.
fix
Create engine and distribution per queue.
affects: all
Upgrade
Version history
2026.0.0latest on PyPI · released Apr 24, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Resources
onemkl-sycl-rng — pip install onemkl-sycl-rng · libregistry