fix: tensorrt llm idocker setup & docs

This commit is contained in:
makaveli10
2024-01-19 10:40:59 -05:00
parent e3084b34cb
commit 1e2faa3f2b
3 changed files with 12 additions and 27 deletions
+10 -1
View File
@@ -5,24 +5,33 @@ We have only tested the TensorRT backend in docker so, we recommend docker for a
## Installation ## Installation
- Install [docker](https://docs.docker.com/engine/install/) - Install [docker](https://docs.docker.com/engine/install/)
- Install [nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) - Install [nvidia-container-toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)
- Clone this repo. - Clone this repo.
```bash ```bash
git clone https://github.com/collabora/WhisperLive.git git clone https://github.com/collabora/WhisperLive.git
cd WhisperLive cd WhisperLive
``` ```
- Build the TensorRT-LLM docker image - Build the TensorRT-LLM docker image
```bash ```bash
docker build --file docker/Dockerfile.tensorrt --tag tensorrt_llm:latest . docker build --file docker/Dockerfile.tensorrt --tag tensorrt_llm:latest .
``` ```
**NOTE**: This could take some time. **NOTE**: This could take some time.
- Next, we run the docker image and mount WhisperLive repo to the containers `/home` directory. - Next, we run the docker image and mount WhisperLive repo to the containers `/home` directory.
```bash ```bash
docker run -it --gpus all --shm-size=8g \ docker run -it --gpus all --shm-size=8g \
--ipc=host --ulimit memlock=-1 --ulimit stack=67108864 \ --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 \
-v /path/to/WhisperLive:/home/WhisperLive \ -v /path/to/WhisperLive:/home/WhisperLive \
tensorrt_llm:latest tensorrt_llm:latest
cd /home/TensorRT-LLM
python3 scripts/build_wheel.py --cuda_architectures "89-real" --clean --trt_root /usr/local/tensorrt
pip install build/tensorrt_llm*.whl
``` ```
- Once inside the docker container, make sure to test the installation. **NOTE**: `--cuda_architectures "89-real"` builds for 4090, change according to your device.
- Make sure to test the installation.
```bash ```bash
# export ENV=${ENV:-/etc/shinit_v2} # export ENV=${ENV:-/etc/shinit_v2}
# source $ENV # source $ENV
+1 -2
View File
@@ -1,12 +1,11 @@
ARG BASE_IMAGE=nvcr.io/nvidia/pytorch ARG BASE_IMAGE=nvcr.io/nvidia/pytorch
ARG BASE_TAG=23.10-py3 ARG BASE_TAG=23.10-py3
ARG CUDA_ARCHITECTURES="89-real"
FROM ${BASE_IMAGE}:${BASE_TAG} as base FROM ${BASE_IMAGE}:${BASE_TAG} as base
WORKDIR /home WORKDIR /home
COPY scripts/install_tensorrt_llm.sh install_tensorrt_llm.sh COPY scripts/install_tensorrt_llm.sh install_tensorrt_llm.sh
RUN bash install_tensorrt_llm.sh ${CUDA_ARCHITECTURES} && rm install_tensorrt_llm.sh RUN bash install_tensorrt_llm.sh && rm install_tensorrt_llm.sh
COPY scripts/setup.sh /home COPY scripts/setup.sh /home
RUN apt update && bash setup.sh && rm setup.sh RUN apt update && bash setup.sh && rm setup.sh
+1 -24
View File
@@ -1,9 +1,8 @@
#!/bin/bash #!/bin/bash
apt-get update && apt-get -y install git git-lfs apt-get update && apt-get -y install git git-lfs
git clone https://github.com/makaveli10/TensorRT-LLM.git git clone -b cuda12.2 https://github.com/makaveli10/TensorRT-LLM.git
cd TensorRT-LLM cd TensorRT-LLM
git checkout main
git submodule update --init --recursive git submodule update --init --recursive
git lfs install git lfs install
git lfs pull git lfs pull
@@ -16,27 +15,5 @@ bash install_cmake.sh
bash install_ccache.sh bash install_ccache.sh
bash install_tensorrt.sh bash install_tensorrt.sh
bash install_polygraphy.sh bash install_polygraphy.sh
source $ENV
cd /root
wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz
tar -xzvf openmpi-3.1.5.tar.gz
rm -rf openmpi-3.1.5.tar.gz
cd openmpi-3.1.5
./configure --prefix=/usr/local/
sudo make all install
echo 'export PATH=$PATH:/usr/local/bin' >> "${ENV}"
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> "${ENV}"
source $ENV
cd /home/TensorRT-LLM/docker/common/
bash install_mpi4py.sh bash install_mpi4py.sh
source $ENV source $ENV
cuda_architectures="${1:-89-real}"
cd /home/TensorRT-LLM
python3 scripts/build_wheel.py --cuda_architectures "${cuda_architectures}" --clean --trt_root /usr/local/tensorrt
pip install build/tensorrt_llm-*.whl
pip install --no-deps openai-whisper