Skip to content

Commit

Permalink
ML: install IPEX and oneCCL binding using pip instead of conda (oap-p…
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrychenhf authored Mar 28, 2023
1 parent b4b3dff commit b2f92a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 6 additions & 4 deletions docker/runtime/ml/oneapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ RUN export PATH="$HOME/anaconda3/envs/$CLOUDTIK_ENV/bin:$PATH" \
&& pip --no-cache-dir install -r /tmp/requirements.txt \
&& sudo rm /tmp/requirements.txt \
# Install deep learning libraries (PyTorch and torch tools)
&& conda install -c intel pytorch=1.13.0 torchvision=0.14.1 \
intel-extension-for-pytorch=1.13.10 oneccl_bind_pt=1.13.0 \
-p $HOME/anaconda3/envs/$CLOUDTIK_ENV -y \
# Install Jemalloc for better performance
&& pip --no-cache-dir install torch==1.13.1 torchvision==0.14.1 \
--extra-index-url https://download.pytorch.org/whl/cpu \
# Install Jemalloc for better performance for Intel Extension for PyTorch
&& conda install jemalloc -p $HOME/anaconda3/envs/$CLOUDTIK_ENV -y \
&& conda clean -itqy \
# Install Intel Extension for PyTorch and oneCCL binding
&& pip --no-cache-dir install intel-extension-for-pytorch==1.13.100+cpu \
oneccl_bind_pt==1.13.0+cpu -f https://developer.intel.com/ipex-whl-stable-cpu \
# Source the mpi and ccl vars
&& . /opt/intel/oneapi/mpi/latest/env/vars.sh \
&& . /opt/intel/oneapi/tbb/latest/env/vars.sh \
Expand Down
9 changes: 4 additions & 5 deletions python/cloudtik/runtime/ml/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,15 @@ function install_ml() {
else
echo "Installing deep learning frameworks: tensorflow, pytorch..."
pip --no-cache-dir -qq install tensorflow==2.9.3
pip --no-cache-dir -qq install torch==1.13.1 torchvision==0.14.1 \
--extra-index-url https://download.pytorch.org/whl/cpu

if ([ "$ML_WITH_ONEAPI" == "true" ] || [ "$ML_WITH_INTEL_PYTORCH" == "true" ]) \
&& [ "$ML_WITH_INTEL_PYTORCH" != "false" ]; then
conda install -q pytorch=1.13.0 torchvision=0.14.1 \
oneccl_bind_pt=1.13.0 intel-extension-for-pytorch=1.13.10 -p ${CLOUDTIK_ENV_ROOT} -c intel -y > /dev/null
# Install Jemalloc for better performance
conda install jemalloc -p ${CLOUDTIK_ENV_ROOT} -y > /dev/null
else
pip --no-cache-dir -qq install torch==1.13.1 torchvision==0.14.1 \
--extra-index-url https://download.pytorch.org/whl/cpu
pip --no-cache-dir -qq install intel-extension-for-pytorch==1.13.100+cpu \
oneccl_bind_pt==1.13.0+cpu -f https://developer.intel.com/ipex-whl-stable-cpu
fi
pip --no-cache-dir -qq install transformers==4.11.0
fi
Expand Down

0 comments on commit b2f92a0

Please sign in to comment.