Skip to main content

NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality

Project description

mkl_random -- a NumPy-based Python interface to Intel® oneAPI Math Kernel Library (OneMKL) Random Number Generation functionality

Conda package using conda-forge

mkl_random started as a part of Intel® Distribution for Python optimizations to NumPy.

Per NumPy's community suggestions, voiced in https://github.com/numpy/numpy/pull/8209, it is being released as a stand-alone package.

Prebuilt mkl_random can be installed into conda environment from Intel's channel using:

  conda install -c https://software.repos.intel.com/python/conda mkl_random

or from conda forge channel:

   conda install -c conda-forge mkl_random

To install mkl_random PyPI package please use following command:

   python -m pip install -i https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_random

If command above installs NumPy package from the Pypi, please use following command to install Intel optimized NumPy wheel package from Intel Pypi Cloud:

   python -m pip install -i https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_random numpy==<numpy_version>

Where <numpy_version> should be the latest version from https://software.repos.intel.com/python/conda/


mkl_random is not fixed-seed backward compatible drop-in replacement for numpy.random, meaning that it implements sampling from the same distributions as numpy.random.

For distributions directly supported in Intel® OneMKL, method keyword is supported:

   mkl_random.standard_normal(size=(10**5, 10**3), method='BoxMuller')

Additionally, mkl_random exposes different basic random number generation algorithms available in MKL. For example to use SFMT19937 use

   mkl_random.RandomState(77777, brng='SFMT19937')

For generator families, such that MT2203 and Wichmann-Hill, a particular member of the family can be chosen by specifying brng=('WH', 3), etc.

The list of supported by mkl_random.RandomState constructor brng keywords is as follows:

  • 'MT19937'
  • 'SFMT19937'
  • 'WH' or ('WH', id)
  • 'MT2203' or ('MT2203', id)
  • 'MCG31'
  • 'R250'
  • 'MRG32K3A'
  • 'MCG59'
  • 'PHILOX4X32X10'
  • 'NONDETERM'
  • 'ARS5'

To build mkl_random from sources on Linux:

  • install a recent version of MKL, if necessary;
  • execute source /path_to_oneapi/mkl/latest/env/vars.sh;
  • execute python -m pip install .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

mkl_random-1.2.11-21-cp312-cp312-win_amd64.whl (326.6 kB view details)

Uploaded CPython 3.12Windows x86-64

mkl_random-1.2.11-21-cp312-cp312-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

mkl_random-1.2.11-21-cp311-cp311-win_amd64.whl (344.2 kB view details)

Uploaded CPython 3.11Windows x86-64

mkl_random-1.2.11-21-cp311-cp311-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

mkl_random-1.2.11-21-cp310-cp310-win_amd64.whl (340.2 kB view details)

Uploaded CPython 3.10Windows x86-64

mkl_random-1.2.11-21-cp310-cp310-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

mkl_random-1.2.11-1-cp39-cp39-win_amd64.whl (341.8 kB view details)

Uploaded CPython 3.9Windows x86-64

mkl_random-1.2.11-1-cp39-cp39-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

File details

Details for the file mkl_random-1.2.11-21-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-21-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 25af10e5bdf26f957b42069e232cfcec279e466ef13b5acb1d30ba01478b8ece
MD5 9752c2e591f762a1b18821ee2ce26644
BLAKE2b-256 51946f77f888240c6c1f65414f0af9563d56ec52c06608a84316ec4b9a48c9c3

See more details on using hashes here.

File details

Details for the file mkl_random-1.2.11-21-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-21-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 992223e354ecdd254136637494e7a54b719d6e1247a6b72c88c4fb49989e3f71
MD5 5e6993fa9c1a709e4a9689f7a3e5cc1f
BLAKE2b-256 318a5ac7010cf92b8a6cf23f619641b4e85da68ef1cbad94051cc7ded7ccac97

See more details on using hashes here.

File details

Details for the file mkl_random-1.2.11-21-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-21-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 db202552af697c5c2b1957c1438cbad3e9048a2320eab26457539e83d63b2b76
MD5 de713dbaec1cf0d0b312d617600c93b2
BLAKE2b-256 4369fd20e9d95fa37e36c91895520593c0dd3f51cbb1c3f9d0f430ecd17cc8bf

See more details on using hashes here.

File details

Details for the file mkl_random-1.2.11-21-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-21-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7ba898f706e8c8dd9db411542d29494a24af32d838e3d18f6ca97cbddf60bd1e
MD5 d7035a5168e7f6e707d25a7337954e73
BLAKE2b-256 690c6dea88b9470ff6f45fb5213b6f8925bbf075325eba3b9dc5ea968e471b0c

See more details on using hashes here.

File details

Details for the file mkl_random-1.2.11-21-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-21-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2b4511a805ebc92f5aeda659cc77f56d174c49fb3d373aaeba3e97ad351a2f8d
MD5 f7dc31fbef83b532235b0fce9adedf4a
BLAKE2b-256 fce442be736fa9a382924e5c7aaf5ce4a5457de5dc76c1c608db7d8c641fc2e8

See more details on using hashes here.

File details

Details for the file mkl_random-1.2.11-21-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-21-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 69dae4f0fd5375cef998d579a1ce3f9c17365e910b23458372344b932cd1279a
MD5 61fca50ab4c1edd99353457284dc0abc
BLAKE2b-256 6ee19d0569d34ebc6813691e72fa978a2c82f1fce7cffb757b80df187ffa5e7a

See more details on using hashes here.

File details

Details for the file mkl_random-1.2.11-1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6290815f0c1cf36f2fa34ad5c4d9d844700ed8a841a6b8e19a5a0583bc71e10e
MD5 3fb6846282a1856a4848ed29f2a3217d
BLAKE2b-256 2c2e917db3b669e032508e66f970dee879f85af927f74a4e77ea9f71f68dcd5e

See more details on using hashes here.

File details

Details for the file mkl_random-1.2.11-1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mkl_random-1.2.11-1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6606f0eb099e88b89e770fb2860a39a62d5c19b760efb387090c8fd86e18a99f
MD5 088ff26454be346ca985e84e5aab06e8
BLAKE2b-256 2ccc183a57e73a2104e18f46fb8432b18de6309fa439be36d26230475619fca7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page