Skip to content

Commit

Permalink
docker: pip install nvFuser for Torch wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 21, 2024
1 parent a27bb65 commit bc8aaa3
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions dockers/ubuntu-cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ARG CUDNN_FRONTEND_CHECKOUT="v1.1.0"
ARG PYTHON_VERSION="3.10"
ARG TORCH_VERSION="2.2.1"
ARG TRITON_VERSION="2.2.0"
ARG TORCH_INSTALL="stable"

SHELL ["/bin/bash", "-c"]
# https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/
Expand Down Expand Up @@ -96,7 +97,7 @@ ENV \
TORCH_CUDA_ARCH_LIST="8.0" \
CUDA_SELECT_NVCC_ARCH_FLAGS="8.0"

ARG TORCH_INSTALL="wheel"
ARG TORCH_INSTALL

RUN \
if [ "${TORCH_INSTALL}" == "source" ]; then \
Expand All @@ -122,15 +123,26 @@ RUN \
--index-url="https://download.pytorch.org/whl/cu${CUDA_VERSION_MM//'.'/''}"; \
fi

ARG TORCH_INSTALL

RUN \
# building nvFuser from source
git clone https://github.com/NVIDIA/Fuser.git && \
cd Fuser && \
git submodule update --init --recursive && \
pip install -r requirements.txt && \
python setup.py install --no-test --no-benchmark && \
cd .. && \
rm -rf Fuser
if [ "${TORCH_INSTALL}" == "source" ]; then \
# building nvFuser from source
git clone https://github.com/NVIDIA/Fuser.git && \
cd Fuser && \
git submodule update --init --recursive && \
pip install -r requirements.txt && \
python setup.py install --no-test --no-benchmark && \
cd .. && \
rm -rf Fuser ; \
elif [ "${TORCH_INSTALL}" == "test" ]; then \
echo "Not supported option" ; \
else \
# installing pytorch from wheels \
CUDA_VERSION_MM=${CUDA_VERSION%.*} && \
TORCH_VERSION_MM=${TORCH_VERSION%.*} && \
pip install -U "nvfuser-cu${CUDA_VERSION_MM/./}-torch${TORCH_VERSION_MM/./}" ; \
fi

RUN \
ls -lh requirements/ && \
Expand Down

0 comments on commit bc8aaa3

Please sign in to comment.