Skip to content

Latest commit

 

History

History
133 lines (108 loc) · 5.83 KB

install.md

File metadata and controls

133 lines (108 loc) · 5.83 KB

AIMET Installation and Setup

This page provides instructions to install AIMET package on Ubuntu 18.04 LTS with Nvidia GPU (see system requirements). Please follow the instructions in the order provided, unless specified otherwise.

Installation

NOTE:

  1. Please pre-pend the "apt-get install" and "pip3 install" commands with "sudo -H" as appropriate.
  2. These instructions assume that pip packages will be installed in the path: /usr/local/lib/python3.6/dist-packages. If that is not the case, please modify it accordingly.

Install prerequisite packages

Install the basic pre-requisite packages as follows:

apt-get update
apt-get install python3.6 python3.6-dev python3-pip
python3 -m pip install --upgrade pip

Install AIMET packages

Go to https://github.com/quic/aimet/releases and identify the release tag of the package you want to install.

Set the <variant_string> to ONE of the following depending on your desired variant

  • For the PyTorch GPU variant, use "torch_gpu"
  • For the PyTorch CPU variant, use "torch_cpu"
  • For the TensorFlow GPU variant, use "tf_gpu"
  • For the TensorFlow CPU variant, use "tf_cpu"
export AIMET_VARIANT=<variant_string>

Replace <release_tag> in the steps below with the appropriate tag:

release_tag=<release_tag>

Install the AIMET packages in the order specified below:

NOTE:

  • Python dependencies will automatically get installed.
  • Replace py3-none-any with cp36-cp36m-linux_x86_64 OR cp37-cp37m-linux_x86_64 as appropriate depending on the actual wheel filename(s) on the releases page.
release_tag=<release_tag>
python3 -m pip install https://github.com/quic/aimet/releases/download/${release_tag}/AimetCommon-${AIMET_VARIANT}_${release_tag}-py3-none-any.whl

# Install ONE of the following depending on the variant
python3 -m pip install https://github.com/quic/aimet/releases/download/${release_tag}/AimetTorch-${AIMET_VARIANT}_${release_tag}-py3-none-any.whl -f https://download.pytorch.org/whl/torch_stable.html
# OR
python3 -m pip install https://github.com/quic/aimet/releases/download/${release_tag}/AimetTensorflow-${AIMET_VARIANT}_${release_tag}-py3-none-any.whl

python3 -m pip install https://github.com/quic/aimet/releases/download/${release_tag}/Aimet-${AIMET_VARIANT}_${release_tag}-py3-none-any.whl

Install common debian packages

Install the common debian packages as follows:

cat /usr/local/lib/python3.6/dist-packages/aimet_common/bin/reqs_deb_common.txt | xargs apt-get --assume-yes install

Install tensorflow GPU debian packages

NOTE: Do this section ONLY for the TensorFlow GPU package.

Install the tensorflow GPU debian packages as follows:

cat /usr/local/lib/python3.6/dist-packages/aimet_tensorflow/bin/reqs_deb_tf_gpu.txt | xargs apt-get --assume-yes install

Install torch GPU debian packages

NOTE: Do this section ONLY for the PyTorch GPU package.

Install the torch GPU debian packages as follows:

cat /usr/local/lib/python3.6/dist-packages/aimet_torch/bin/reqs_deb_torch_gpu.txt | xargs apt-get --assume-yes install

Replace Pillow with Pillow-SIMD

Optional: Replace the Pillow package with Pillow-SIMD as follows:

python3 -m pip uninstall -y pillow
python3 -m pip install --no-cache-dir Pillow-SIMD==6.0.0.post0

Install GPU packages

NOTE: Do this section ONLY for the PyTorch or Tensorflow GPU packages.

Prepare the environment for installation of GPU packages as follows:

NOTE: Please visit this page to obtain the exact and up-to-date installation instructions for your environment.

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda-repo-ubuntu1804-11-1-local_11.1.0-455.23.05-1_amd64.deb
dpkg -i cuda-repo-ubuntu1804-11-1-local_11.1.0-455.23.05-1_amd64.deb
apt-key add /var/cuda-repo-ubuntu1804-11-1-local/7fa2af80.pub
apt-get update
apt-get -y install cuda

wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
apt-get --assume-yes install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
apt-get update

Post installation steps

Perform the following post-installation steps:

ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib

NOTE: Do the following step ONLY for the PyTorch or Tensorflow GPU packages.

# If you installed the CUDA 10.x drivers
ln -s /usr/local/cuda-10.0 /usr/local/cuda
# OR if you installed the CUDA 11.x drivers
ln -s /usr/local/cuda-11.0 /usr/local/cuda

Environment setup

Set the common environment variables as follows:

source /usr/local/lib/python3.6/dist-packages/aimet_common/bin/envsetup.sh

Add the AIMET package location to the environment paths as follows:

export LD_LIBRARY_PATH=/usr/local/lib/python3.6/dist-packages/aimet_common/x86_64-linux-gnu:/usr/local/lib/python3.6/dist-packages/aimet_common:$LD_LIBRARY_PATH

if [[ $PYTHONPATH = "" ]]; then export PYTHONPATH=/usr/local/lib/python3.6/dist-packages/aimet_common/x86_64-linux-gnu; else export PYTHONPATH=/usr/local/lib/python3.6/dist-packages/aimet_common/x86_64-linux-gnu:$PYTHONPATH; fi