Skip to content

Commit

Permalink
Install mkl for PyTorch and libjpeg/libpng for TorchVision (#8248)
Browse files Browse the repository at this point in the history
* Install libjpeg and libpng for TorchVision

* Install MKL
  • Loading branch information
huydhn authored Feb 10, 2025
1 parent 320595d commit 524ec78
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .ci/docker/common/install_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ install_ubuntu() {
libssl-dev \
zip

# These libraries are needed by TorchVision
apt-get install -y --no-install-recommends \
libjpeg-dev \
libpng-dev

# Cleanup package manager
apt-get autoclean && apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
12 changes: 10 additions & 2 deletions .ci/docker/common/install_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ install_miniconda() {

install_python() {
pushd /opt/conda
# Install the correct Python version
# Install the selected Python version for CI jobs
as_ci_user conda create -n "py_${PYTHON_VERSION}" -y --file /opt/conda/conda-env-ci.txt python="${PYTHON_VERSION}"

# From https://github.com/pytorch/pytorch/blob/main/.ci/docker/common/install_conda.sh
if [[ $(uname -m) == "aarch64" ]]; then
conda_install "openblas==0.3.28=*openmp*"
else
conda_install mkl=2022.1.0 mkl-include=2022.1.0
fi

popd
}

Expand All @@ -53,7 +61,7 @@ fix_conda_ubuntu_libstdcxx() {
# PyTorch sev: https://github.com/pytorch/pytorch/issues/105248
# Ref: https://github.com/pytorch/pytorch/blob/main/.ci/docker/common/install_conda.sh
if grep -e "2[02].04." /etc/issue >/dev/null; then
rm "/opt/conda/envs/py_${PYTHON_VERSION}/lib/libstdc++.so.6"
rm /opt/conda/envs/py_${PYTHON_VERSION}/lib/libstdc++.so*
fi
}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# The generic Linux job chooses to use base env, not the one setup by the image
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"
# For mypy linting, we need to first install executorch first so that
# it builds the python package information.
BUILD_TOOL="cmake"
Expand Down Expand Up @@ -74,6 +74,7 @@ jobs:
docker-image: executorch-ubuntu-22.04-linter
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
FILES_NEEDS_FORMAT=$(/opt/google-java-format -n extension/android/src/main/java/org/pytorch/executorch/*.java \
examples/demo-apps/android/ExecuTorchDemo/app/src/main/java/com/example/executorchdemo/*.java \
Expand Down

0 comments on commit 524ec78

Please sign in to comment.