Skip to content

Commit

Permalink
metrics: Use a specific python version to run tensorflow benchmark
Browse files Browse the repository at this point in the history
This PR uses a specific python version to run tensorflow benchmark
as it needs python 3.8 to run correctly and avoid failures.

Fixes #8791

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
  • Loading branch information
GabyCT committed Jan 9, 2024
1 parent 4ac5f13 commit 8391db8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions tests/metrics/machine_learning/tensorflow_nhwc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# SPDX-License-Identifier: Apache-2.0

set -o pipefail
set -x

# General env
SCRIPT_PATH=$(dirname "$(readlink -f "$0")")
Expand Down Expand Up @@ -116,6 +117,10 @@ function tensorflow_nhwc_test() {
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${i}" sh -c "cat /${ALEXNET_FILE}" >> "${alexnet_tensorflow_file}"
done

info "Check files"
cat "${resnet_tensorflow_file}"
cat "${alexnet_tensorflow_file}"

# Parsing resnet results
local resnet_results=$(cat "${resnet_tensorflow_file}" | grep "total images/sec" | cut -d ":" -f2 | sed -e 's/^[ \t]*//' | tr '\n' ',' | sed 's/.$//')
local res_sum="$(sed -e 's/,/\n/g' <<< ${resnet_results} | awk 'BEGIN {total=0} {total += $1} END {print total}')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ LABEL DOCKERFILE_VERSION="1.0"
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential git && \
apt-get install -y --no-install-recommends build-essential git zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev && \
apt-get remove -y unattended-upgrades && \
git clone https://github.com/tensorflow/benchmarks
git clone https://github.com/tensorflow/benchmarks && \
wget -q https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz && \
tar xzf Python-3.8.10.tgz && \
cd Python-3.8.10 && \
./configure --enable-optimizations && make altinstall && make install

CMD ["/bin/bash"]

0 comments on commit 8391db8

Please sign in to comment.