Skip to content

Commit ec70f7e

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 0e96f1f commit ec70f7e

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
@@ -505,10 +505,15 @@ else
505505
DOCKERFILE_NAME="Dockerfile"
506506
fi
507507

508+
DOCKER_PROGRESS="--progress=plain"
509+
if [[ "${DOCKER_BUILDKIT}" == 0 ]]; then
510+
DOCKER_PROGRESS=""
511+
fi
512+
508513
# Build image
509514
docker build \
510515
--no-cache \
511-
--progress=plain \
516+
${DOCKER_PROGRESS} \
512517
--build-arg "BUILD_ENVIRONMENT=${image}" \
513518
--build-arg "PROTOBUF=${PROTOBUF:-}" \
514519
--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
@@ -83,11 +83,39 @@ install_ubuntu() {
8383
# see: https://github.com/pytorch/pytorch/issues/65931
8484
apt-get install -y libgnutls30
8585

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

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

170+
# CentOS7 doesnt have support for higher version of libpng,
171+
# so it is built from source.
172+
# Libpng is required for torchvision build.
173+
build_libpng
174+
142175
# Cleanup
143176
yum clean all
144177
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
@@ -29,7 +29,10 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
2929
source "${SCRIPT_FOLDER}/common_utils.sh"
3030

3131
pushd /tmp
32-
wget -q "${BASE_URL}/${CONDA_FILE}"
32+
if [ -n $CENTOS_VERSION ] && [[ $CENTOS_VERSION == 7.* ]]; then
33+
NO_CHECK_CERTIFICATE_FLAG="--no-check-certificate"
34+
fi
35+
wget -q "${BASE_URL}/${CONDA_FILE}" ${NO_CHECK_CERTIFICATE_FLAG}
3336
# NB: Manually invoke bash per https://github.com/conda/conda/issues/10431
3437
as_jenkins bash "${CONDA_FILE}" -b -f -p "/opt/conda"
3538
popd
@@ -95,6 +98,11 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
9598
${SCRIPT_FOLDER}/install_magma_conda.sh $(cut -f1-2 -d'.' <<< ${CUDA_VERSION}) ${ANACONDA_PYTHON_VERSION}
9699
fi
97100

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

.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)