Skip to content

Commit 77c8e9d

Browse files
authored
Merge pull request #364 from jondea/reduce-dependecies
2 parents 6cb6922 + cac0f0a commit 77c8e9d

5 files changed

Lines changed: 26 additions & 5 deletions

File tree

ML-Frameworks/pytorch-aarch64/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ where `YY` is the year, and `MM` the month of the increment.
1414

1515
### Removed
1616
- Removes WIP ComputeLibrary patch https://review.mlplatform.org/c/ml/ComputeLibrary/+/12818/1.
17+
- Removed unused dependencies:
18+
- Delete unused submodules to avoid fetching.
19+
- Replace google-perftool bundle with specific libtcmalloc-minimal4 and add symlink so that you can still use it with `LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libtcmalloc.so.4`.
20+
- Remove unused git apt package.
1721

1822
### Fixed
1923

ML-Frameworks/pytorch-aarch64/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ RUN apt-get update && apt-get install -y \
3939
python-is-python3 \
4040
# To allow users to install new things if they want
4141
sudo \
42-
# includes tcmalloc, which can speed up some models, see README.md for more details
43-
google-perftools \
44-
# Git
45-
git \
46-
&& rm -rf /var/lib/apt/lists/*
42+
# tcmalloc can speed up some models, see README.md for more details
43+
# we use minimal package instead of gperftools to reduce dependencies
44+
libtcmalloc-minimal4 \
45+
&& rm -rf /var/lib/apt/lists/* \
46+
# Make libtcmalloc_minimal accessible from the usual libtcmalloc location
47+
&& sudo ln -s /usr/lib/aarch64-linux-gnu/libtcmalloc_minimal.so.4 /usr/lib/aarch64-linux-gnu/libtcmalloc.so.4
4748

4849
# DOCKER_USER for the Docker user
4950
ENV DOCKER_USER=${USERNAME}

ML-Frameworks/pytorch-aarch64/dockerize.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
# *******************************************************************************
1919

20+
set -eux -o pipefail
21+
2022
help_str="dockerize.sh takes a PyTorch wheel as the first argument and an ao wheel
2123
as the second argument. It installs the wheel inside a Docker container with examples
2224
and requirements. The docker image will then be run unless you pass in the optional

ML-Frameworks/pytorch-aarch64/get-source.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ git-shallow-clone https://github.com/pytorch/pytorch.git $PYTORCH_HASH
7272
# https://github.com/pytorch/pytorch/pull/159859 - PoC LUT optimisation for GELU bf16 operators
7373
apply-github-patch pytorch/pytorch ebcc874e317f9563ab770fc5c27df969e0438a5e
7474

75+
# Remove deps that we don't need for manylinux AArch64 CPU builds before fetching.
76+
# Only used when jni.h is present (see .ci/pytorch/build.sh:116), which is not the case for manylinux
77+
git rm android/libs/fbjni
78+
# Only needed if USE_ROCM=ON, which is OFF for AArch64
79+
git rm third_party/composable_kernel
80+
# Not used for CPU only builds
81+
git rm third_party/cudnn_frontend
82+
git rm third_party/cutlass
83+
git rm third_party/NVTX
84+
# Only used in WIN32 builds (see CMakeLists.txt:394)
85+
git rm third_party/mimalloc
86+
7587
# Update submodules
7688
git submodule sync
7789
git submodule update --init --checkout --force --recursive --jobs=$(nproc)

ML-Frameworks/tensorflow-aarch64/dockerize.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# limitations under the License.
1818
# *******************************************************************************
1919

20+
set -eux -o pipefail
21+
2022
help_str="dockerize.sh takes a TensorFlow wheel as argument. It \
2123
installs the wheel inside a Docker container with examples and requirements."
2224
if [ "$#" -ne 1 ]; then

0 commit comments

Comments
 (0)