Skip to content

Commit 6518f63

Browse files
committed
CONSOLIDATED COMMITS: Updates to build on Jammy and CentOS7
=========================================================== Updates to build on Jammy - Fortran package installation moved after gcc - Update libtinfo search code in cmake1 - Install libstdc++.so [UB22.04] Updates to support latest scipy Build required version of libpng for CentOS7 Updated condition for libstc++ for Jammy Set ROCM_PATH in env for centOS docker container Changes to support docker v23 Reversed the condition as required temporarily ignore certificate check for Miniconda (cherry picked from commit 9848db1) [release/2.1] Skip certificate check for CentOS7 since certificate expired (#1399) * Skip certificate check only for CentOS7 since certificate expired * Naming Remove the installation of rocm-llvm-dev package - Causing regression - SWDEV-463083 fix install_centos() function [rocm6.3_internal_testing] skip pytorch-nightly installstion (#1557) This PR skips pytorch-nightly installation in docker images Installation of pytorch-nightly is needed to prefetch mobilenet_v2 avd v3 models for some tests. Came from 85bd6bc Models are downloaded on first use to the folder /root/.cache/torch/hub But pytorch-nightly installation also overrides .ci/docker/requirements-ci.txt settings and upgrades some of python packages (sympy from 1.12.0 to 1.13.0) which causes several 'dynamic_shapes' tests to fail Skip prefetching models affects these tests without any errors (but **internet access required**): - python test/mobile/model_test/gen_test_model.py mobilenet_v2 - python test/quantization/eager/test_numeric_suite_eager.py -k test_mobilenet_v3 Issue ROCm/frameworks-internal#8772 Also, in case of some issues these models can be prefetched after pytorch building and before testing (cherry picked from commit b92b34d) Fixes #ISSUE_NUMBER
1 parent 2966840 commit 6518f63

File tree

7 files changed

+69
-7
lines changed

7 files changed

+69
-7
lines changed

.ci/docker/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,15 @@ else
490490
DOCKERFILE_NAME="Dockerfile"
491491
fi
492492

493+
DOCKER_PROGRESS="--progress=plain"
494+
if [[ "${DOCKER_BUILDKIT}" == 0 ]]; then
495+
DOCKER_PROGRESS=""
496+
fi
497+
493498
# Build image
494499
docker build \
495500
--no-cache \
496-
--progress=plain \
501+
${DOCKER_PROGRESS} \
497502
--build-arg "BUILD_ENVIRONMENT=${image}" \
498503
--build-arg "PROTOBUF=${PROTOBUF:-}" \
499504
--build-arg "LLVMDEV=${LLVMDEV:-}" \

.ci/docker/centos-rocm/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ RUN rm install_rocm_magma.sh
8080
COPY ./common/install_amdsmi.sh install_amdsmi.sh
8181
RUN bash ./install_amdsmi.sh
8282
RUN rm install_amdsmi.sh
83+
84+
ENV ROCM_PATH /opt/rocm
8385
ENV PATH /opt/rocm/bin:$PATH
8486
ENV PATH /opt/rocm/hcc/bin:$PATH
8587
ENV PATH /opt/rocm/hip/bin:$PATH

.ci/docker/common/cache_vision_models.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
set -ex
44

5+
# Skip pytorch-nightly installation in docker images
6+
# Installation of pytorch-nightly is needed to prefetch mobilenet_v2 avd v3 models for some tests.
7+
# Came from https://github.com/ROCm/pytorch/commit/85bd6bc0105162293fa0bbfb7b661f85ec67f85a
8+
# Models are downloaded on first use to the folder /root/.cache/torch/hub
9+
# But pytorch-nightly installation also overrides .ci/docker/requirements-ci.txt settings
10+
# and upgrades some of python packages (sympy from 1.12.0 to 1.13.0)
11+
# which causes several 'dynamic_shapes' tests to fail
12+
# Skip prefetching models affects these tests without any errors:
13+
# python test/mobile/model_test/gen_test_model.py mobilenet_v2
14+
# python test/quantization/eager/test_numeric_suite_eager.py -k test_mobilenet_v3
15+
# Issue https://github.com/ROCm/frameworks-internal/issues/8772
16+
echo "Skip torch-nightly installation"
17+
exit 0
18+
519
source "$(dirname "${BASH_SOURCE[0]}")/common_utils.sh"
620

721
# Cache the test models at ~/.cache/torch/hub/

.ci/docker/common/common_utils.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ conda_install() {
2323
as_jenkins conda install -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $*
2424
}
2525

26+
conda_install_through_forge() {
27+
as_jenkins conda install -c conda-forge -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $*
28+
}
29+
2630
conda_run() {
2731
as_jenkins conda run -n py_$ANACONDA_PYTHON_VERSION --no-capture-output $*
2832
}

.ci/docker/common/install_base.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,39 @@ install_ubuntu() {
8282
# see: https://github.com/pytorch/pytorch/issues/65931
8383
apt-get install -y libgnutls30
8484

85+
if [[ "$UBUNTU_VERSION" == "22.04"* ]]; then
86+
apt-get install -y libopenblas-dev
87+
fi
88+
8589
# Cleanup package manager
8690
apt-get autoclean && apt-get clean
8791
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8892
}
8993

94+
build_libpng() {
95+
# install few packages
96+
yum install -y zlib zlib-devel
97+
98+
LIBPNG_VERSION=1.6.37
99+
100+
mkdir -p libpng
101+
pushd libpng
102+
103+
wget http://download.sourceforge.net/libpng/libpng-$LIBPNG_VERSION.tar.gz
104+
tar -xvzf libpng-$LIBPNG_VERSION.tar.gz
105+
106+
pushd libpng-$LIBPNG_VERSION
107+
108+
./configure
109+
make
110+
make install
111+
112+
popd
113+
114+
popd
115+
rm -rf libpng
116+
}
117+
90118
install_centos() {
91119
# Need EPEL for many packages we depend on.
92120
# See http://fedoraproject.org/wiki/EPEL
@@ -138,6 +166,11 @@ install_centos() {
138166
libsndfile-devel
139167
fi
140168

169+
# CentOS7 doesnt have support for higher version of libpng,
170+
# so it is built from source.
171+
# Libpng is required for torchvision build.
172+
build_libpng
173+
141174
# Cleanup
142175
yum clean all
143176
rm -rf /var/cache/yum

.ci/docker/common/install_conda.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
2828
source "$(dirname "${BASH_SOURCE[0]}")/common_utils.sh"
2929

3030
pushd /tmp
31-
wget -q "${BASE_URL}/${CONDA_FILE}"
31+
if [ -n $CENTOS_VERSION ] && [[ $CENTOS_VERSION == 7.* ]]; then
32+
NO_CHECK_CERTIFICATE_FLAG="--no-check-certificate"
33+
fi
34+
wget -q "${BASE_URL}/${CONDA_FILE}" ${NO_CHECK_CERTIFICATE_FLAG}
3235
# NB: Manually invoke bash per https://github.com/conda/conda/issues/10431
3336
as_jenkins bash "${CONDA_FILE}" -b -f -p "/opt/conda"
3437
popd
@@ -93,6 +96,11 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
9396
conda_install magma-cuda$(TMP=${CUDA_VERSION/./};echo ${TMP%.*[0-9]}) -c pytorch
9497
fi
9598

99+
# Install required libstdc++.so.6 version
100+
if [ "$ANACONDA_PYTHON_VERSION" = "3.10" ] || [ "$ANACONDA_PYTHON_VERSION" = "3.9" ] ; then
101+
conda_install_through_forge libstdcxx-ng=12
102+
fi
103+
96104
# Install some other packages, including those needed for Python test reporting
97105
pip_install -r /opt/conda/requirements-ci.txt
98106

.ci/docker/common/install_rocm.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ install_ubuntu() {
4242
roctracer-dev \
4343
amd-smi-lib
4444

45-
if [[ $(ver $ROCM_VERSION) -ge $(ver 6.1) ]]; then
46-
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated rocm-llvm-dev
47-
fi
48-
4945
# precompiled miopen kernels added in ROCm 3.5, renamed in ROCm 5.5
5046
# search for all unversioned packages
5147
# if search fails it will abort this script; use true to avoid case where search fails
@@ -129,7 +125,7 @@ install_centos() {
129125
rocprofiler-dev \
130126
roctracer-dev \
131127
amd-smi-lib
132-
128+
fi
133129
# precompiled miopen kernels; search for all unversioned packages
134130
# if search fails it will abort this script; use true to avoid case where search fails
135131
MIOPENHIPGFX=$(yum -q search miopen-hip-gfx | grep miopen-hip-gfx | awk '{print $1}'| grep -F kdb. || true)

0 commit comments

Comments
 (0)