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.
NOTE:
- Please pre-pend the "apt-get install" and "pip3 install" commands with "sudo -H" as appropriate.
- 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 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
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
withcp36-cp36m-linux_x86_64
ORcp37-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 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
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
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
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
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
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
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