The Intel® Distribution for Python* is a cluster of packages including Numba, NumPy, and more. All these packages are optimized via Intel® oneAPI Math Kernel Library (oneMKL) and Intel® oneAPI Data Analytics Library (oneDAL) to make Python* application more efficient.
The Intel® AI Analytics Toolkit includes the Intel Distribution for Python. So the Intel Distribution for Python is ready for use once the Intel AI Analytics Toolkit installation is finished and the environment activation is run.
- Install the Intel AI Analytics Toolkit.
To download the Intel Distribution for Python* from the Intel AI Analytics Toolkit, visit here and choose the installation method of your choice. Find detailed information about the toolkit here. - Set up Intel the AI Analytics Toolkit environment.
Source the setvars script located in the root of your oneAPI installation.
- Linux*:
- Sudo:
. /opt/intel/oneapi/setvars.sh- User:
. ~/intel/oneapi/setvars.sh - Windows:
C:\Program Files(x86)\Intel\oneAPI\setvars.bat
For more information on environment variables, check out how to use the setvars Script for Linux or macOS, or Windows.
- Activate the conda environment.
- Linux*:
- If you have root access to your oneAPI installation path or if you use the Intel® DevCloud, Intel Python environment will be activated by default. However, if you have activated another environment, you can return with the following command:
source activate base - If you do not have root access to your oneAPI installation path:
By default, the Intel AI Analytics Toolkit is installed in the /opt/intel/oneapi folder, which requires root privileges to manage it. If you would like to bypass using root access to manage your conda environment, then you can clone your desired conda environment using the following command:Then activate your conda environment with the following command:conda create --name usr_intelpython --clone basesource activate usr_intelpython
- If you have root access to your oneAPI installation path or if you use the Intel® DevCloud, Intel Python environment will be activated by default. However, if you have activated another environment, you can return with the following command:
- Windows:
C:\ProgramFiles(x86)\Intel\oneAPI\intelpython\python3.x\Scripts\activate
- Follow Conda Installation Guide to install Conda in your environment. If you already have conda installed in your system, please update your conda:
conda update conda - Add Intel channel.
Tell conda to choose Intel packages over default packages, when available.conda config --add channels intel - Install Intel Distribution for Python* via conda. We recommend that you create a new environment while installing. To install the core python3 environment, run:
Please note that “x” in “python=3.x” should signify which version of Python* you would like to install. For example, for Python* version 3.9: conda create -n idp intelpython3_core python=3.9.
conda create -n idp intelpython3_core python=3.x - Activate the conda environment:
conda activate idp
After the activation of the environment, type python in the command line to find the Python* distribution info.
- Linux* & Windows*:
python
The distribution info should includeIntel Corporation:- Linux:
Python 3.7.10 (default, Jun 4 2021, 06:52:02) [GCC 9.3.0] :: Intel Corporation on linux Type "help", "copyright", "credits" or "license" for more information. Intel(R) Distribution for Python is brought to you by Intel® Corporation. Please check out: https://software.intel.com/en-us/python-distribution - Windows:
Python 3.9.10 (main, Mar 21 2022, 08:44:00) [MSC v.1916 64 bit (AMD64)] :: Intel Corporation on win32 Type "help", "copyright", "credits" or "license" for more information. Intel(R) Distribution for Python is brought to you by Intel Corporation. Please check out: https://software.intel.com/en-us/python-distribution
- Linux:
Run this numpy sample code in a stock Python* environment and in an IntelPython environment. You will see benefits from IntelPython.
import numpy as np
import time
start = time.time()
rd = np.random.RandomState(88)
a = rd.randint(1,1000,(1000,1000))
y = rd.randint(1,1000,(1000))
res = np.linalg.solve(a,y)
end = time.time()
print(res)
print('Time consumed:',end-start)
No special modifications to your existing Python* projects are required to start using them with this toolkit. Check out the Reference Section for Github samples.
- Intel Distribution for Python Landing Page
- Intel AI Analytics Toolkit Landing Page
- Code Samples
- Get Started with the Intel AI Analytics Toolkit for Linux*
If you have further questions or need support on your workload optimization, please submit your queries to the Intel AI Analytics Toolkit Forum or IntelPython GitHub, on the Issues or Discussions pages depending on the type of support required.
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.
Performance results are based on testing as of dates shown in configurations and may not reflect all publicly available updates. See backup for configuration details. No product or component can be absolutely secure.
Your costs and results may vary.
Intel technologies may require enabled hardware, software or service activation.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.