Skip to content

Commit 17b8f05

Browse files
authored
bug fix in llm dockerfile (#3616)
1 parent 579bda3 commit 17b8f05

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

examples/gpu/inference/python/llm/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARG BASE_IMAGE=ubuntu:22.04
99
FROM ${BASE_IMAGE} AS base
1010
RUN if [ -f /etc/apt/apt.conf.d/proxy.conf ]; then rm /etc/apt/apt.conf.d/proxy.conf; fi && \
1111
if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::Proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf.d/proxy.conf; fi && \
12-
if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::http::Proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf.d/proxy.conf; fi
12+
if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::Proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf.d/proxy.conf; fi
1313
RUN apt update && \
1414
apt full-upgrade -y && \
1515
DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y \
@@ -40,7 +40,7 @@ WORKDIR /home/ubuntu
4040
RUN curl -fsSL -v -o miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
4141
bash miniconda.sh -b -p ./miniconda3 && \
4242
rm miniconda.sh && \
43-
echo "\nsource ~/miniconda3/bin/activate" >> ./.bashrc
43+
echo "source ~/miniconda3/bin/activate" >> ./.bashrc
4444

4545
FROM base AS dev
4646
# --build-arg COMPILE=ON to compile from source

examples/gpu/inference/python/llm/tools/env_setup.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fi
5050
# Save current directory path
5151
BASEFOLDER=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5252
WHEELFOLDER=${BASEFOLDER}/../wheels
53+
TORCH_INSTALL_SCRIPT=${WHEELFOLDER}/torch_install.sh
5354
AUX_INSTALL_SCRIPT=${WHEELFOLDER}/aux_install.sh
5455
cd ${BASEFOLDER}/..
5556

@@ -121,8 +122,9 @@ if [ $((${MODE} & 0x02)) -ne 0 ]; then
121122
conda install -y cmake ninja
122123

123124
echo "#!/bin/bash" > ${AUX_INSTALL_SCRIPT}
125+
echo "#!/bin/bash" > ${TORCH_INSTALL_SCRIPT}
124126
if [ $((${MODE} & 0x04)) -ne 0 ]; then
125-
echo "python -m pip install torch==${VER_TORCH} intel-extension-for-pytorch==${VER_IPEX} oneccl-bind-pt==${VER_TORCHCCL} --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/" >> ${AUX_INSTALL_SCRIPT}
127+
echo "python -m pip install torch==${VER_TORCH} intel-extension-for-pytorch==${VER_IPEX} oneccl-bind-pt==${VER_TORCHCCL} --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/" >> ${TORCH_INSTALL_SCRIPT}
126128
python -m pip install torch==${VER_TORCH} intel-extension-for-pytorch==${VER_IPEX} oneccl-bind-pt==${VER_TORCHCCL} --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
127129
else
128130
if [ ! -f ${ONECCL_ROOT}/env/vars.sh ]; then
@@ -195,7 +197,7 @@ if [ $((${MODE} & 0x02)) -ne 0 ]; then
195197
export DPCPP_GCC_INSTALL_DIR="${CONDA_PREFIX}/lib/gcc/x86_64-conda-linux-gnu/12.3.0"
196198
fi
197199
export INTELONEAPIROOT=${ONEAPIROOT}
198-
COMPUTE_BACKEND=dpcpp python setup.py bdist_wheel
200+
USE_SYSTEM_ONECCL=ON COMPUTE_BACKEND=dpcpp python setup.py bdist_wheel
199201
unset INTELONEAPIROOT
200202
if [ -d ${CONDA_PREFIX}/lib/gcc/x86_64-conda-linux-gnu ]; then
201203
unset DPCPP_GCC_INSTALL_DIR
@@ -275,7 +277,14 @@ if [ $((${MODE} & 0x02)) -ne 0 ]; then
275277
rm -rf DeepSpeed
276278
fi
277279
if [ $((${MODE} & 0x01)) -ne 0 ]; then
280+
bash ${TORCH_INSTALL_SCRIPT}
278281
python -m pip install ${WHEELFOLDER}/*.whl
279282
bash ${AUX_INSTALL_SCRIPT}
280283
rm -rf ${WHEELFOLDER}
284+
if [ -f ${TORCH_INSTALL_SCRIPT} ]; then
285+
rm ${TORCH_INSTALL_SCRIPT}
286+
fi
287+
if [ -f ${AUX_INSTALL_SCRIPT} ]; then
288+
rm ${AUX_INSTALL_SCRIPT}
289+
fi
281290
fi

0 commit comments

Comments
 (0)