BulkCalcSpace / entrypoint.sh
meg's picture
meg HF Staff
Update entrypoint.sh
e9a3cc6 verified
raw
history blame
1.03 kB
#!/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