File size: 1,027 Bytes
13c6f75
 
 
 
 
 
e9a3cc6
 
 
 
13c6f75
5df12fc
 
13c6f75
5df12fc
 
 
 
 
 
13c6f75
5df12fc
 
 
 
 
 
 
13c6f75
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

config_dir="/optimum-benchmark/examples/energy_star/"

# This script is meant to be called from a python script \
# that provides the REPO_ID as the first argument.
REPO_ID=$1
MODEL=$2
TASK=$3
HARDWARE=$4
echo "Attempting to run."
# Read the name of the model and the experiment.
echo "Benchmarking Model: ${MODEL}, Task: ${TASK}, Hardware: ${HARDWARE}"

# Initialize the directory for output.
now=$(date +%Y-%m-%d-%H-%M-%S)
run_dir="/app/runs/${TASK}/${MODEL}/${HARDWARE}/${now}"
mkdir -p "$run_dir"
# Save the task/model run directory to text file, for tracking purposes.
echo "${run_dir}" >> /attempts.txt

{ # try
  # Let the benchmarking begin!
  optimum-benchmark --config-name "${TASK}" --config-dir="${config_dir}" backend.model="${MODEL}" backend.processor="${MODEL}" hydra.run.dir="${run_dir}" 2> "${run_dir}/error.log"
} || { # catch
    echo "Did not benchmark."
    echo "${run_dir}" >> /failed_attempts.txt
}

echo "Finished"# updating requests dataset and results dataset."
#python /process_runs.py