diff --git a/.azure-pipelines/scripts/install_nc.sh b/.azure-pipelines/scripts/install_nc.sh index 55b323c56c2..6a80419259f 100644 --- a/.azure-pipelines/scripts/install_nc.sh +++ b/.azure-pipelines/scripts/install_nc.sh @@ -3,6 +3,10 @@ echo -e "\n Install Neural Compressor ... " cd /neural-compressor if [[ $1 = *"3x_pt"* ]]; then + if [[ $1 != *"3x_pt_fp8"* ]]; then + echo -e "\n Install torch CPU ... " + pip install torch==2.3.0 --index-url https://download.pytorch.org/whl/cpu + fi python -m pip install --no-cache-dir -r requirements_pt.txt python setup.py pt bdist_wheel pip install --no-deps dist/neural_compressor*.whl --force-reinstall diff --git a/README.md b/README.md index 4aac08639b2..5fbad1d0434 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,29 @@ support AMD CPU, ARM CPU, and NVidia GPU through ONNX Runtime with limited testi * [2024/07] Performance optimizations and usability improvements on [client-side](https://github.com/intel/neural-compressor/blob/master/docs/source/3x/client_quant.md). ## Installation +### Install Framework +#### Install torch for CPU +```Shell +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 tensorflow +```Shell +pip install tensorflow +``` ### Install from pypi ```Shell # Install 2.X API + Framework extension API + PyTorch dependency -pip install neural-compressor[pt] +pip install neural-compressor[pt] # Install 2.X API + Framework extension API + TensorFlow dependency pip install neural-compressor[tf] ``` diff --git a/docs/source/installation_guide.md b/docs/source/installation_guide.md index f4497806c58..ca33138b2a4 100644 --- a/docs/source/installation_guide.md +++ b/docs/source/installation_guide.md @@ -27,6 +27,25 @@ The following prerequisites and requirements must be satisfied for a successful > Notes: > - If you get some build issues, please check [frequently asked questions](faq.md) at first. +### Install Framework +#### Install torch for CPU +```Shell +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 tensorflow +```Shell +pip install tensorflow +``` + ### Install from Binary - Install from Pypi ```Shell diff --git a/requirements_pt.txt b/requirements_pt.txt index 10e8715df2d..b858822cc6b 100644 --- a/requirements_pt.txt +++ b/requirements_pt.txt @@ -5,4 +5,3 @@ prettytable psutil py-cpuinfo pydantic -torch