Skip to content

Commit c20efe9

Browse files
pruthvistonydnikolaev-amd
authored andcommitted
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 (cherry picked from commit ec70f7e)
1 parent 9cc8aab commit c20efe9

File tree

7 files changed

+67
-6
lines changed

7 files changed

+67
-6
lines changed

.ci/docker/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ if [[ -n "${CI:-}" ]]; then
474474
progress_flag="--progress=plain"
475475
fi
476476

477+
if [[ "${DOCKER_BUILDKIT}" == 0 ]]; then
478+
progress_flag=""
479+
fi
480+
477481
# Build image
478482
docker build \
479483
${no_cache_flag} \

.ci/docker/centos-rocm/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ RUN rm install_rocm_magma.sh
7373
COPY ./common/install_amdsmi.sh install_amdsmi.sh
7474
RUN bash ./install_amdsmi.sh
7575
RUN rm install_amdsmi.sh
76+
77+
ENV ROCM_PATH /opt/rocm
7678
ENV PATH /opt/rocm/bin:$PATH
7779
ENV PATH /opt/rocm/hcc/bin:$PATH
7880
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
@@ -87,11 +87,39 @@ install_ubuntu() {
8787
# see: https://github.com/pytorch/pytorch/issues/65931
8888
apt-get install -y libgnutls30
8989

90+
if [[ "$UBUNTU_VERSION" == "22.04"* ]]; then
91+
apt-get install -y libopenblas-dev
92+
fi
93+
9094
# Cleanup package manager
9195
apt-get autoclean && apt-get clean
9296
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
9397
}
9498

99+
build_libpng() {
100+
# install few packages
101+
yum install -y zlib zlib-devel
102+
103+
LIBPNG_VERSION=1.6.37
104+
105+
mkdir -p libpng
106+
pushd libpng
107+
108+
wget http://download.sourceforge.net/libpng/libpng-$LIBPNG_VERSION.tar.gz
109+
tar -xvzf libpng-$LIBPNG_VERSION.tar.gz
110+
111+
pushd libpng-$LIBPNG_VERSION
112+
113+
./configure
114+
make
115+
make install
116+
117+
popd
118+
119+
popd
120+
rm -rf libpng
121+
}
122+
95123
install_centos() {
96124
# Need EPEL for many packages we depend on.
97125
# See http://fedoraproject.org/wiki/EPEL
@@ -143,6 +171,11 @@ install_centos() {
143171
libsndfile-devel
144172
fi
145173

174+
# CentOS7 doesnt have support for higher version of libpng,
175+
# so it is built from source.
176+
# Libpng is required for torchvision build.
177+
build_libpng
178+
146179
# Cleanup
147180
yum clean all
148181
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
@@ -38,10 +38,6 @@ install_ubuntu() {
3838
roctracer-dev \
3939
amd-smi-lib
4040

41-
if [[ $(ver $ROCM_VERSION) -ge $(ver 6.1) ]]; then
42-
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated rocm-llvm-dev
43-
fi
44-
4541
# precompiled miopen kernels added in ROCm 3.5, renamed in ROCm 5.5
4642
# search for all unversioned packages
4743
# if search fails it will abort this script; use true to avoid case where search fails
@@ -141,7 +137,7 @@ install_centos() {
141137
rocprofiler-dev \
142138
roctracer-dev \
143139
amd-smi-lib
144-
140+
fi
145141
# precompiled miopen kernels; search for all unversioned packages
146142
# if search fails it will abort this script; use true to avoid case where search fails
147143
MIOPENHIPGFX=$(yum -q search miopen-hip-gfx | grep miopen-hip-gfx | awk '{print $1}'| grep -F kdb. || true)

0 commit comments

Comments
 (0)