meg HF Staff commited on
Commit
5df12fc
·
verified ·
1 Parent(s): 8eccf98

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. 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
- cat /tasks.txt | while read -r task; do # Example alternative: for task in "text_generation" "question_answering"; do
10
- cat /hardware.txt | while read -r hardware; do # Example alternative: for hardware in "a100-large" "l4x1" "l40sx1"; do
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
- # Initialize the directory for output.
19
- now=$(date +%Y-%m-%d-%H-%M-%S)
20
- run_dir="/app/runs/${task}/${model}/${now}"
21
- mkdir -p "$run_dir"
22
- # Save the task/model run directory to text file, for tracking purposes.
23
- echo "${run_dir}" >> /attempts.txt
24
 
25
- { # try
26
- # Let the benchmarking begin!
27
- 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"
28
- } || { # catch
29
- echo "${run_dir}" >> /failed_attempts.txt
30
- }
31
- done
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