Skip to content

Latest commit

 

History

History
273 lines (216 loc) · 11.8 KB

IDP_GSG.md

File metadata and controls

273 lines (216 loc) · 11.8 KB

Intel® Distribution for Python*

Intel® Distribution for Python* is a cluster of packages that includes 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 the Python* application more efficient. The distribution includes a multitude of popular components, some of which include:

Libraries:

  • Python
  • NumPy
  • SciPy

Mkl interfaces:

  • Mkl-service
  • Mkl-random
  • Mkl-fft
  • Mkl-umath

GPU components:

  • Dpctl
  • Dpnp
  • Numba-dpex

System Requirements

CPUs:

  • Intel® Core™ processor family
  • Intel® Xeon® processor family

GPUs:

  • Intel® UHD Graphics for 11th generation Intel processors or newer
  • Intel® Iris® Xᵉ graphics
  • Intel® Arc™ graphics
  • Intel® Data Center GPU Flex Series
  • Intel® Data Center GPU Max Series

Operating systems:

  • Unix family*
  • Windows® 10
  • Windows* 11

Supported versions:

  • Python 3.11, Python 3.12

Package management:

  • conda*
  • Pip
  • Mamba

Compatible with:

  • VS Code
  • Jupyter Notebook
  • Microsoft Visual Studio*
  • PyCharm*

Supported Installation Options

  1. Intel® Distribution for Python* Selector
  2. Intel® Data Parallel Control (Coming Soon)

Supported operating systems are outlined under System Requirements. You may select the components you wish to install. The full list of components in the Intel® Distribution for Python* is outlined on the landing page section What’s Included.

GPU Users

For Linux users The driver packages needed on Linux are described in the Data Center GPU Series Driver Installation and Client GPU Driver Installation pages.

For Windows users For GPU development, the latest GPU drivers need to be installed. This can be downloaded from Intel® Arc™ & Iris® Xe Graphics - Windows*.

Intel® Tiber™ Developer Cloud Users

You can use Intel® Distribution for Python* in Intel® Tiber™ Developer Cloud. After getting access to the cloud system, follow the instructions below to install Intel® Distribution for Python* with one of the available installation options.

Selector-Specific Installation Options

Offline Installer

  1. To download the Intel® Distribution for Python*, visit here and choose the installation method of your choice.
  2. Run the following commands to install on the respective platform:

Linux installation (Interactive) Note that the file name must be changed to how it appears in your downloads folder.

bash ~/intelpython3-202X.X.X.sh 

Linux installation (CLI)

bash ~/intelpython3.sh -b -u -p ~/intelpython3 

The flags can be included as necessary. They are used as follows: -b enables batch mode, running the installation without interactive prompts. -u updates the current installation. You may omit this if this is the first time you’re installing IDP on this machine. -p specifies the installation path prefix. In this example, ~/intelpython3 is the target directory.

Windows installation (Interactive)

intelpython3.exe 

Windows installation (CLI)

start /wait intelpython3.exe /S /RegisterPython=0 /D=%LOCALAPPDATA%\intelpython3 
  1. Activate the conda environment on your respective platform.

Linux The following commands can be used to activate the Intel® Distribution for Python installation:

#Root access or Intel(R) Developer Cloud installation*
source /opt/intel/intelpython3/bin/activate

#Home installation
source $HOME/intelpython3/bin/activate

Windows Navigate to the Intel Python installation directory, find the "Scripts" directory, and run' .activate` in the terminal.

The command prompt should now show (base) at the start of the command prompt.

  1. Verify instalaltion.
conda list

Deactivating environment for Offline Installer To deactivate your IDP environment, run the command below until base env is deactivated.

conda deactivate

Conda

  1. Follow conda Installation Guide to install conda in your environment. If you already have conda installed in your system, update it with the command:
conda update conda
  1. Add Intel channel and conda-forge to tell conda to choose Intel packages over default packages when available.
conda config --add channels https://software.repos.intel.com/python/conda/
conda config --add channels conda-forge

Remove defaults channel from .condarc if it exists

conda config --remove channels defaults
  1. Install Intel® Distribution for Python* via conda. We recommend that you create a new environment while installing. To install the python3 environment, run the following command: conda create -n idp intelpython3_full python=3.x 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_full python=3.9

For individual installation commands, refer to the What’s included section.

  1. Activate the conda environment:
conda activate idp

Mamba

  1. If you do not have Mamba, get Miniforge by following the instructions here. Otherwise, ensure that it is updated:
conda update mamba
  1. Add Intel channel and conda-forge to tell conda to choose Intel packages over default packages, when available.
conda config --add channels https://software.repos.intel.com/python/conda/
conda config --add channels conda-forge

Remove defaults channel from .condarc if it exists.

conda config --remove channels defaults
  1. Install Intel® Distribution for Python* via Mamba. We recommend that you create a new environment while installing. To install the core python3 environment, run the following command:
mamba create -n idp intelpython3_full python=3.x

Please note that “x” in python=3.x should signify which version of Python* you would like to install.

  1. Activate the environment:
mamba activate idp
  1. Verify installation.
mamba list	

Pip

  1. If you do not have pip, use the following instructions to install it. After installation, make sure that you can run pip from the command line. Installation Instructions

  2. Create and activate a virtual environment. Please note that “x” in “python=3.x” should signify which version of Python* you would like to install.

python3.x -m venv idp 

For Lunix:

source idp/bin/activate 

For Windows:

idp\Scripts\activate
  1. Install Intel® Distribution for Python* components via PIP

Note: Components not available in https://pypi.anaconda.org/intel/simple can be found in PyPI main repository Search for individual installation commands in What’s included page

  1. Verify installation.
pip list	

Docker

  1. If you don’t have Docker installed on your machine, follow these instructions to install it.
  2. Pull the image from DockerHub using the following command:
docker pull intel/python:latest 
  1. Run a performance sample by running the following commands:
git clone https://github.com/intel/ai-containers
cd ai-containers/python
docker run --rm -it \
    -v $PWD/tests:/tests \
    intel/python:latest \
    python /tests/perf_sample.py
  1. Verify installation.
conda list

Example with NumPy

You can see the benefits of using the Intel® Distribution for Python* on your own machine by comparing a simple program’s runtime between both distributions. First, run the sample code below in your new Intel® Distribution for Python* environment, and take note of the total runtime which should be displayed in the output.

Once you have taken note of the runtime of this program, switch the environment back to stock Python* and run the script again. Compare the runtime in the stock environment to the runtime in the Intel® distribution environment. You should see the benefits provided by the Intel® Distribution for Python* through the significantly decreased runtime.

Code Samples

Library Sample link
NumPy https://github.com/oneapi-src/oneAPI-samples/tree/master/AI-and-Analytics/Features-and-Functionality/IntelPython_Numpy_Numba_dpex_kNN

Build Your Own Project

No special modifications to your existing Python* projects are required to start using them with this toolkit. You can refer to samples on GitHub to learn more about this distribution.

Profiling Python Code

Additional Resources

Support

If you have further questions or need support on your workload optimization, please submit your queries to the Intel® Distribution for Python* Forum or Intel® Distribution for Python* GitHub, on the Issues or Discussions pages, depending on the type of support required.

Notices and Disclaimers

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.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.