Installation
-
1.1. Prerequisites
1.2. Install from Binary
1.3. Install from Source
Installation
Prerequisites
The following prerequisites and requirements must be satisfied for a successful installation:
Python version: 3.10 or 3.11 or 3.12 or 3.13
Notes:
If you get some build issues, please check frequently asked questions at first.
Install Framework for PyTorch Backend (on-demand)
Intel Neural Compressor supports PyTorch with CPU, GPU and HPU. Please install the corresponding PyTorch version based on your hardware environment.
Install torch for CPU
pip install torch --index-url https://download.pytorch.org/whl/cpu
Use Docker Image with torch installed for HPU
https://docs.habana.ai/en/latest/Installation_Guide/Bare_Metal_Fresh_OS.html#bare-metal-fresh-os-single-click
Install torch/intel_extension_for_pytorch for Intel GPU
https://intel.github.io/intel-extension-for-pytorch/index.html#installation
Install torch for other platform
https://pytorch.org/get-started/locally
Install from Binary
Install from Pypi
# Framework extension API for PyTorch/Tensorflow/JAX
pip install neural-compressor
# Framework extension API + corresponding framework dependency
pip install neural-compressor[pt]
pip install neural-compressor[tf]
pip install neural-compressor[jax] # JAX support is available since v3.8
# Framework extension API + PyTorch dependency
pip install neural-compressor-pt
# Framework extension API + TensorFlow dependency
pip install neural-compressor-tf
# Framework extension API + JAX dependency, available since v3.8
pip install neural-compressor-jax
Install from Source
The latest code on master branch may not be stable. Please switch to the latest release tag for better stability. Feel free to open an issue if you encounter an error.
git clone https://github.com/intel/neural-compressor.git
cd neural-compressor
git fetch --tags && git checkout "$(git tag -l 'v*' --sort=-v:refname | head -n 1)"
# PyTorch framework extension API + PyTorch dependency
INC_PT_ONLY=1 pip install .
# TensorFlow framework extension API + TensorFlow dependency
INC_TF_ONLY=1 pip install .
# JAX framework extension API + JAX dependency, available since v3.8
INC_JAX_ONLY=1 pip install .
System Requirements
Validated Hardware Environment
Intel® Neural Compressor supports HPUs based on heterogeneous architecture with two compute engines (MME and TPC):
Intel Gaudi Al Accelerators (Gaudi2, Gaudi3)
Intel® Neural Compressor supports CPUs based on Intel 64 architecture or compatible processors:
Intel Xeon Scalable processor (Sapphire Rapids, Emerald Rapids, Granite Rapids)
Intel Xeon CPU Max Series (Sapphire Rapids HBM)
Intel® Neural Compressor supports GPUs built on Intel’s Xe architecture:
Intel® Arc™ B-Series Graphics (Battlemage)
Validated Software Environment
OS version: Ubuntu 24.04, MacOS Ventura 13.5, Windows 11
Python version: 3.11, 3.12, 3.13
| Framework | TensorFlow | PyTorch | JAX |
|---|---|---|---|
| Version |
2.19.0 |
2.10.0 2.9.1 |
0.9 |