Releases: IntelPython/mkl_random
1.4.0
Overview
This release introduces NumPy compatibility through a new patching system and dedicated interface module. mkl_random can now seamlessly replace NumPy's random number generation while maintaining full API compatibility. The release includes extensive test coverage from NumPy's test suite, numerous bug fixes, and improvements to align with modern NumPy behavior. Python 3.9 support has been dropped.
Highlights
🔄 NumPy Patching System
- New context manager and explicit patch/restore functions to replace
numpy.randomwithmkl_randomimplementations - Query patching status with
is_patched()function - Seamless drop-in replacement for NumPy's random number generation
🎯 Strict NumPy API Interface
- New
mkl_random.interfaces.numpy_randommodule provides pure NumPy-compatible API - Aliases mkl_random functionality while dropping non-standard arguments and functions
- Better alignment with NumPy's API contracts
✅ Enhanced Test Coverage
- Third-party tests from
numpy.randomintegrated to validate compatibility - Additional vendored NumPy tests for comprehensive validation
- Improved reliability and correctness
🐛 Bug Fixes & Improvements
- Fixed hang in
zipfwhen called withnp.nan - Fixed size-1 1D arrays being incorrectly cast to scalars
- Multiple implementation updates to align with newer NumPy versions
📦 Flexible Build Configuration
- Conda recipe now supports configurable NumPy dependency via
USE_NUMPY_BASEenvironment variable
- Python 3.9 support dropped - Minimum supported version is now Python 3.10+
mkl_random.RandomStatedeprecated - Usemkl_random.MKLRandomStateinstead.RandomStatenow delegates to thenumpy_randominterface for compatibility.
Python Version Support
- ✅ Python 3.10, 3.11, 3.12, 3.13, 3.14
- ❌ Python 3.9 and earlier
Detailed Changes
Added
-
Added
mkl_randompatching for NumPy, withmkl_randomcontext manager,is_patchedquery, andpatch_numpy_randomandrestore_numpy_randomcalls to replacenumpy.randomcalls with calls frommkl_random.interfaces.numpy_randomgh-90 -
Added
mkl_random.interfaceswithmkl_random.interfaces.numpy_randominterface, which aliasesmkl_randomfunctionality to more strictly adhere to NumPy's API (i.e., drops arguments and functions which are not part of standard NumPy) gh-92 -
Added third-party tests from
numpy.randomwhich tests themkl_random.interfaces.numpy_randominterface gh-103
Changed
- Updates to
mkl_randomimplementations to better align with newer versions ofnumpy.randomgh-103, gh-115 - Made conda recipe dependency on numpy configurable through
USE_NUMPY_BASEenvironment variable gh-105
Fixed
- Various bugfixes including a hang in
zipfwhen called withnp.nanand size-1 1D arrays being cast to scalars gh-103, gh-115
Removed
- Dropped support for Python 3.9 gh-81
Deprecated
- Deprecated
mkl_random.RandomStatein favor ofmkl_random.MKLRandomState, delegatingmkl_random.RandomStateto themkl_random.interfaces.numpy_randominterface gh-92
Contributors
- Anton Volkov (@antonwolfy)
- Nikita Grigorian (@ndgrigorian)
New Contributors
- Jordan Harlow (@jharlow-intel)
Full Changelog: v1.3.1...v1.4.0
1.3.1
v1.3.0
What's Changed
- Used
GIT_DESCRIBE_TAGandGIT_DESCRIBE_NUMBERinmeta.yamlinstead of manual stepping the numbers gh-75 - Extended conda build scripts with the use of
WHEELS_OUTPUT_FOLDERvariable to build wheel packages gh-74 - Updated
meta.yamlto have a run dependency onnumpy-basepackage gh-73
Contributors
Full Changelog: v1.2.11...1.3.0
v1.2.10
This release
- Adds support for
mkl_randomout-of-the-box from virtual environment on Windows
v1.2.8
Incremental bug fix release: updated installation instructions, reverted work-around for a problem in MKL 2024.2.0
v1.2.7
This release addresses technical debt, and fixes the project to work with NumPy 2.0 on both Windows and Linux.
- Removed use of vendored
numpy.pxd, replaced with recommendedcimport numpy. This resolved the warning of changes struct size for Cython classbroadcast. - Fixed warnings from
clangcompiler - Corrected data types for allocation made in Cython which were responsible for test failures with NumPy 2.0 on Windows.
v1.2.6
This is a bug fix release updates mkl_random to support NumPy 2.0
v1.2.5
Transition testing suite to pytest to enable support for Python 3.12
v1.2.4
Change to fix build on mkl_random with clang with new build system introduced in v1.2.3.