Skip to content

Commit 999e7ce

Browse files
authored
Fix formatting and license (#205)
* use the correct license for init_helper.py file * use oneMKL instead OneMKL
1 parent 97cc3ad commit 999e7ce

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
## `mkl_fft` -- a NumPy-based Python interface to Intel® oneAPI Math Kernel Library (OneMKL) FFT functionality
21
[![Conda package](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package.yml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package.yml)
32
[![Editable build using pip and pre-release NumPy](https://github.com/IntelPython/mkl_fft/actions/workflows/build_pip.yaml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/build_pip.yaml)
43
[![Conda package with conda-forge channel only](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package-cf.yml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package-cf.yml)
54
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/mkl_fft/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/mkl_fft)
65

6+
## `mkl_fft` -- a NumPy-based Python interface to Intel® oneAPI Math Kernel Library (oneMKL) Fourier Transform Functions
7+
78
# Introduction
8-
`mkl_fft` started as a part of Intel® Distribution for Python* optimizations to NumPy, and is now being released
9-
as a stand-alone package. It offers a thin layered interface for the Intel® oneAPI Math Kernel Library (OneMKL) FFT functionality that allows efficient access to native FFT optimizations from a range of NumPy and SciPy functions. As a result, its performance is close to the performance of native C/Intel® OneMKL. The optimizations are provided for real and complex data types in both single and double precisions for in-place and out-of-place modes of operation. For analyzing the performance use [FFT benchmarks](https://github.com/intelpython/fft_benchmark).
9+
`mkl_fft` is part of [Intel® Distribution for Python*](https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html) optimizations to NumPy.
10+
It offers a thin layered python interface to the [Intel® oneAPI Math Kernel Library (oneMKL) Fourier Transform Functions](https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2025-2/fourier-transform-functions.html) that allows efficient access to computing a discrete Fourier transform through the fast Fourier transform (FFT) algorithm. As a result, its performance is close to the performance of native C/Intel® oneMKL. The optimizations are provided for real and complex data types in both single and double precisions for in-place and out-of-place modes of operation. For analyzing the performance use [FFT benchmarks](https://github.com/intelpython/fft_benchmark).
1011

11-
Thanks to Intel® OneMKL’s flexibility in its supports for arbitrarily strided input and output arrays both one-dimensional and multi-dimensional Fast Fourier Transforms along distinct axes can be performed directly, without the need to copy the input into a contiguous array first. Furthermore, input strides can be arbitrary, including negative or zero, as long as strides remain an integer multiple of array’s item size, otherwise a copy will be made.
12+
Thanks to Intel® oneMKL’s flexibility in its supports for arbitrarily strided input and output arrays both one-dimensional and multi-dimensional FFTs along distinct axes can be performed directly, without the need to copy the input into a contiguous array first. Furthermore, input strides can be arbitrary, including negative or zero, as long as strides remain an integer multiple of array’s item size, otherwise a copy will be made.
1213

1314
More details can be found in ["Accelerating Scientific Python with Intel Optimizations"](https://proceedings.scipy.org/articles/shinma-7f4c6e7-00f) from Proceedings of the 16th Python in Science Conference (SciPy 2017).
1415

@@ -26,9 +27,7 @@ or from conda-forge channel:
2627
conda install -c conda-forge mkl_fft
2728
```
2829

29-
---
30-
31-
To install `mkl_fft` PyPI package please use following command:
30+
To install `mkl_fft` PyPI package please use the following command:
3231

3332
```
3433
python -m pip install --index-url https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_fft
@@ -40,7 +39,7 @@ If command above installs NumPy package from the PyPI, please use following comm
4039
python -m pip install --index-url https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_fft numpy==<numpy_version>
4140
```
4241

43-
Where `<numpy_version>` should be the latest version from https://software.repos.intel.com/python/conda/
42+
where `<numpy_version>` should be the latest version from https://software.repos.intel.com/python/conda/.
4443

4544
---
4645
# How to use?
@@ -85,10 +84,10 @@ numpy.allclose(mkl_res, np_res)
8584
---
8685
# Building from source
8786

88-
To build `mkl_fft` from sources on Linux with Intel® OneMKL:
87+
To build `mkl_fft` from sources on Linux with Intel® oneMKL:
8988
- create a virtual environment: `python3 -m venv fft_env`
9089
- activate the environment: `source fft_env/bin/activate`
91-
- install a recent version of OneMKL, if necessary
90+
- install a recent version of oneMKL, if necessary
9291
- execute `source /path_to_oneapi/mkl/latest/env/vars.sh`
9392
- `git clone https://github.com/IntelPython/mkl_fft.git mkl_fft`
9493
- `cd mkl_fft`

mkl_fft/_init_helper.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
# Copyright 2025 Intel Corporation
1+
# Copyright (c) 2025, Intel Corporation
22
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
3+
# Redistribution and use in source and binary forms, with or without
4+
# modification, are permitted provided that the following conditions are met:
65
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
6+
# * Redistributions of source code must retain the above copyright notice,
7+
# this list of conditions and the following disclaimer.
8+
# * Redistributions in binary form must reproduce the above copyright
9+
# notice, this list of conditions and the following disclaimer in the
10+
# documentation and/or other materials provided with the distribution.
11+
# * Neither the name of Intel Corporation nor the names of its contributors
12+
# may be used to endorse or promote products derived from this software
13+
# without specific prior written permission.
814
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
19+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1425

1526
import os
1627
import os.path

mkl_fft/interfaces/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ print(f"Time with scipy.fft default backend: {t1:.1f} seconds")
101101
with scipy.fft.set_backend(mkl_backend, only=True):
102102
t2 = timeit.timeit(lambda: scipy.signal.fftconvolve(a, b), number=10)
103103

104-
print(f"Time with OneMKL FFT backend installed: {t2:.1f} seconds")
104+
print(f"Time with oneMKL FFT backend installed: {t2:.1f} seconds")
105105
# Time with MKL FFT backend installed: 9.1 seconds
106106
```
107107

@@ -110,7 +110,6 @@ In the following example, we use `set_worker` to control the number of threads w
110110
```python
111111
import numpy, mkl, scipy
112112
import mkl_fft.interfaces.scipy_fft as mkl_fft
113-
import scipy
114113
a = numpy.random.randn(128, 64) + 1j*numpy.random.randn(128, 64)
115114
scipy.fft.set_global_backend(mkl_fft) # set mkl_fft as global backend
116115

0 commit comments

Comments
 (0)