Spaces:
Paused
Paused
Update entrypoint.sh
Browse files- entrypoint.sh +18 -23
entrypoint.sh
CHANGED
@@ -5,32 +5,27 @@ config_dir="/optimum-benchmark/examples/energy_star/"
|
|
5 |
# This script is meant to be called from a python script \
|
6 |
# that provides the REPO_ID as the first argument.
|
7 |
REPO_ID = $1
|
|
|
|
|
|
|
8 |
echo "Attempting to run."
|
9 |
-
|
10 |
-
|
11 |
-
echo "Attempting to benchmark ${hardware}"
|
12 |
-
python /change_hardware.py --hardware ${hardware}
|
13 |
-
# For each model
|
14 |
-
cat /models.txt | while read -r model; do # Example alternative: for model in "NousResearch/Hermes-3-Llama-3.1-8B" "Qwen/Qwen2.5-7B-Instruct"; do
|
15 |
-
# Read the name of the model and the experiment.
|
16 |
-
echo "Benchmarking Model: ${model}, Task: ${task}, Hardware: ${hardware}"
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
done
|
33 |
-
done
|
34 |
|
35 |
echo "Finished"# updating requests dataset and results dataset."
|
36 |
#python /process_runs.py
|
|
|
5 |
# This script is meant to be called from a python script \
|
6 |
# that provides the REPO_ID as the first argument.
|
7 |
REPO_ID = $1
|
8 |
+
MODEL = $2
|
9 |
+
TASK = $3
|
10 |
+
HARDWARE = $4
|
11 |
echo "Attempting to run."
|
12 |
+
# Read the name of the model and the experiment.
|
13 |
+
echo "Benchmarking Model: ${MODEL}, Task: ${TASK}, Hardware: ${HARDWARE}"
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
# Initialize the directory for output.
|
16 |
+
now=$(date +%Y-%m-%d-%H-%M-%S)
|
17 |
+
run_dir="/app/runs/${TASK}/${MODEL}/${HARDWARE}/${now}"
|
18 |
+
mkdir -p "$run_dir"
|
19 |
+
# Save the task/model run directory to text file, for tracking purposes.
|
20 |
+
echo "${run_dir}" >> /attempts.txt
|
21 |
|
22 |
+
{ # try
|
23 |
+
# Let the benchmarking begin!
|
24 |
+
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"
|
25 |
+
} || { # catch
|
26 |
+
echo "Did not benchmark."
|
27 |
+
echo "${run_dir}" >> /failed_attempts.txt
|
28 |
+
}
|
|
|
|
|
29 |
|
30 |
echo "Finished"# updating requests dataset and results dataset."
|
31 |
#python /process_runs.py
|