NumPy-based Python interface to Intel® oneAPI Math Kernel Library (oneMKL) Fourier Transform Functions
Repo IntelPython/mkl_fft, read from GitHub 31 min ago. IntelPython has not joined Take My Repo.
The release enables free-threaded (GIL-disabled) CPython builds and adds support for Python 3.15. It also fixes a group of long-standing correctness bugs: norm="forward" and norm="ortho" scaling was wrong whenever an N-D transform covered only a subset of
axes, and transforms writing into a user-provided out array produced wrong results — or wrote past the end of out — for non-contiguous out, for Fortran-ordered input, and for input of dtypes that have to be cast. Several memory leaks and unchecked backend statuses in the C layer are fixed as well. Building from source now requires a newer Cython.
🧵 Free-Threaded CPython
freethreading_compatible=True, so importing mkl_fft no longer re-enables the GIL. The free-threaded configuration is built and tested in CI on 3.14t.python-gil constraint is gone from the conda recipes, which previously pinned mkl_fft to GIL-enabled Python 3.14 builds.🐍 Python 3.15 Support
scipy_interface and test extras cannot be installed from PyPI on 3.15 yet, because mkl-service publishes neither a 3.15 wheel nor an sdist there; conda packages are unaffected.🧮 Correct norm Scaling for Partial N-D Transforms
norm="forward"/"ortho" in fftn, ifftn, rfftn, irfftn and the fft2 family scaled by the full array shape instead of by the transformed axes, so results were wrong whenever axes or s covered only part of the array.irfftn and irfft2 normalized over the input length n instead of the complex-to-real output length 2 * (n - 1).🎯 out= Correctness
fft, ifft and the fftn/fft2 family silently returned out unmodified when the input dtype was not float32, float64, complex64 or complex128.fft/ifft, ifft/ifftn of real input, and rfft/rfftn of cast input produced wrong results, and could write outside of out, when out was non-contiguous or Fortran-ordered.⚡ Performance
norm="forward"/"ortho" scaling.rfft no longer makes a slow reordering copy of Fortran-ordered input that needs a cast.scipy_fft hfft/hfftn adapters, and the GIL is released during the final conjugation of 1-D ifft of real input.⚠️ Behavior Changes
DFTI_MEMORY_ERROR) now raise MemoryError instead of ValueError. Code catching ValueError around large transforms will no longer catch them.float32/float64, the result of rfft, rfft2, rfftn and of their numpy_fft/scipy_fft counterparts is now Fortran- rather than C-contiguous.📦 Build Requirement Changes
Cython requirement is raised to 3.1.0, the first release providing the freethreading_compatible directive.freethreading_compatible=True; the free-threaded configuration is built and tested in CI on 3.14t gh-357scipy_interface and test extras cannot be installed from PyPI on 3.15 yet, because mkl-service publishes neither a 3.15 wheel nor an sdist thereCython requirement to 3.1.0, the first release providing the freethreading_compatible directive gh-357python-gil constraint from the conda recipes, which pinned mkl_fft to GIL-enabled Python 3.14 builds gh-357DFTI_MEMORY_ERROR) are now raised as MemoryError instead of ValueError gh-373hfft and hfftn adapters of mkl_fft.interfaces.scipy_fft gh-382norm="forward"/"ortho" scaling by computing the scale factor without numpy.prod gh-384rfft now casts input of dtypes other than float32/float64 to float64 keeping its memory order instead of making it C-contiguous, avoiding a slow reordering copy for Fortran-ordered input gh-389float32/float64, the result of rfft, rfft2, rfftn and of their counterparts in the numpy_fft and scipy_fft interfaces is now Fortran- rather than C-contiguous: the output order follows the input, Fortran for Fortran-contiguous input and C otherwise gh-389ifft of real input, as it already was in the N-D backend gh-389norm="forward"/"ortho" scaling in fftn, ifftn, rfftn, irfftn and the fft2 family when only a subset of axes is transformed: the scale used the full array shape instead of the transformed axes gh-336, gh-370norm="forward"/"ortho" scaling in irfftn and irfft2, which normalized over the input length n rather than the complex-to-real output length 2 * (n - 1) gh-370PyMem_Malloc fails, and raise MemoryError gh-373fftn, ifftn and the fft2 family returning an uncomputed result instead of raising when MKL reports an error for a transform over all axes: the status of the N-D backend call was never checked gh-373fft, ifft, and the fftn/fft2 family returning out unmodified when out is given and the input dtype is not float32, float64, complex64 or complex128 (e.g. integer, bool, float16) gh-387out in fft/ifft when the input is cast or zero-padded into a contiguous copy while out has the same non-contiguous layout as the original input gh-387out in ifft and ifftn of real input when out is not contiguous: the final complex conjugation treated out as one contiguous block gh-389rfft and rfftn with out for input that is cast to float64 (e.g. integer, float16) when the input and out are Fortran-ordered gh-389Full Changelog: 2.3.2...2.4.0
This is a bug-fix release, identical to 2.3.0 and 2.3.1 in terms of features.
The macOS RPATH fix shipped in 2.3.1 was incomplete. This release emits one -rpath argument per path instead of colon-joining them, which is an ELF-only convention that produced an unusable LC_RPATH entry on macOS.
-rpath linker argument per path instead of colon-joining them, so the runtime library search path is baked correctly into macOS (Mach-O) extensions gh-358Full Changelog: 2.3.1...2.3.2
This release is identical to 2.3.0 in terms of features
This release only fixes RPATH logic for OSX, which was mistakenly broken in migration to meson-python build system.
This release migrates mkl_fft to a modern Meson-based build system, replacing the legacy setuptools/setup.py pipeline. It also introduces a command-line interface for patching NumPy's FFT with MKL-accelerated implementations.
🏗️ New Build System
setuptools to meson-python, removing setup.py in favor of meson.build, aligning mkl_fft with the build system used by NumPy and SciPyninja/cmake are formal build requirements🆕 NumPy FFT patching CLI
python -m mkl_fft patch install/uninstall/status for persistent patching across all Python sessionspython -m mkl_fft with_patch <command> for one-shot execution with MKL accelerationpython -m mkl_fft patch install/uninstall/status for persistent patching across all Python sessions, and python -m mkl_fft with_patch <command> for one-shot execution with MKL acceleration gh-319numpy-base dependency and USE_NUMPY_BASE environment variable from conda recipe gh-318setuptools to meson-python, removing setup.py in favor of meson.build gh-303Full Changelog: 2.2.1...2.3.0
This is a bugfix release that resolves dependency issues with pip check by removing the PyPI mkl runtime dependency. This change improves compatibility with downstream packages and package management tools.
🔧 Dependency Fix
mkl runtime dependency to prevent pip check failuresmkl as runtime dependency to avoid possible pip check failures gh-322Full Changelog: 2.2.0...2.2.1
This release introduces NumPy patching functionality, improves FFT performance consistency, and modernizes dependency management. Python 3.9 support has been dropped, and mkl-service is now an optional dependency.
🎯 NumPy FFT Patching
⚡ Performance Improvements
📦 Improved Dependency Management
mkl-service is now an optional dependency⚠️ Breaking Changes
mkl_fft patching for NumPy, with mkl_fft context manager, is_patched query, and patch_numpy_fft and restore_numpy_fft calls to replace numpy.fft calls with calls from mkl_fft.interfaces.numpy_fft gh-224, gh-295mkl_fft.fftn and mkl_fft.ifftn, improved checking of the shape argument s to use faster direct transforms more often. This makes performance more consistent between mkl_fft.fftn/ifftn and mkl.interfaces. gh-283mkl-service an optional dependency gh-305USE_NUMPY_BASE environment variable gh-299TypeError exception raised with empty axes gh-288axes=() (ignore out parameter) gh-293Full Changelog: 2.1.2...2.2.0