Skip to content

Commit

Permalink
Merge pull request kata-containers#5678 from GabyCT/topic/updatetenso…
Browse files Browse the repository at this point in the history
…rflowname

metrics: Update Tensorflow model name
  • Loading branch information
dborquez authored Jun 2, 2023
2 parents 00f0cda + 5fad104 commit 1188a01
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions metrics/machine_learning/tensorflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Usage: $0 <count> <timeout>
EOF
}

function nhwc_test() {
function resnet50_test() {
local CMD_RUN="cd benchmarks/scripts/tf_cnn_benchmarks/ && python tf_cnn_benchmarks.py -data_format=NHWC --device cpu --batch_size=${BATCH_SIZE} --num_batches=${NUM_BATCHES} > result"
info "Running NHWC Tensorflow test"
info "Running Resnet50 Tensorflow test"
for i in "${containers[@]}"; do
sudo -E "${CTR_EXE}" t exec -d --exec-id "$(random_name)" "${i}" sh -c "${CMD_RUN}"
done
Expand All @@ -61,14 +61,14 @@ function nhwc_test() {
sudo -E "${CTR_EXE}" t exec --exec-id "$(random_name)" "${i}" sh -c "${CMD_RESULT}" >> "${tensorflow_file}"
done

local nhwc_results=$(cat "${tensorflow_file}" | grep "total images/sec" | cut -d ":" -f2 | sed -e 's/^[ \t]*//' | tr '\n' ',' | sed 's/.$//')
local average_nhwc=$(echo "${nhwc_results}" | sed "s/,/+/g;s/.*/(&)\/$NUM_CONTAINERS/g" | bc -l)
local resnet50_results=$(cat "${tensorflow_file}" | grep "total images/sec" | cut -d ":" -f2 | sed -e 's/^[ \t]*//' | tr '\n' ',' | sed 's/.$//')
local average_resnet50=$(echo "${resnet50_results}" | sed "s/,/+/g;s/.*/(&)\/$NUM_CONTAINERS/g" | bc -l)

local json="$(cat << EOF
{
"NHWC": {
"Result": "${nhwc_results}",
"Average": "${average_nhwc}",
"Resnet50": {
"Result": "${resnet50_results}",
"Average": "${average_resnet50}",
"Units": "s"
}
}
Expand Down Expand Up @@ -158,7 +158,7 @@ function main() {
# Check that the requested number of containers are running
check_containers_are_up

nhwc_test
resnet50_test

axelnet_test

Expand Down

0 comments on commit 1188a01

Please sign in to comment.