Skip to content

Commit

Permalink
use can specify nsp in run-script
Browse files Browse the repository at this point in the history
  • Loading branch information
bhanvimenghani committed Dec 5, 2024
1 parent b90d356 commit 490bd3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions human-eval-benchmark/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Towards the end of the script B the user is prompted to fill the run duration, w

## 2. Automated Job

To run the benchmark in an automated way the user simply needs to login to the relevent Openshift AI cluster, create a namespace or you can use the default namespace. Set your desired environment variable in `job.yaml`, you have number of prompts or duration to choose from. If num_prompts and duration_in_seconds both are set num_prompts has a higher precedence. Apply `pcv.yaml` followed by applying `job.yaml`. This would deploy the humaneval benchamrk in the specified namespace.
To run the benchmark in an automated way the user simply needs to login to the relevent Openshift AI cluster, create a namespace or you can use the default namespace. Set your desired environment variable in `job.yaml`, you have number of prompts or duration to choose from. If num_prompts and duration_in_seconds both are set num_prompts has a higher precedence. Apply `pvc.yaml` followed by applying `job.yaml`. This would deploy the humaneval benchamrk in the specified namespace.

The user can also make use of the `run_humaneval.sh` scrip with -n or -d option for number of prompts and duration_in_seconds respectively.
Example `./run_humaneval.sh -n 150` or `./run_humaneval.sh -d 800`
Example `./run_humaneval.sh <namespace name> -n 150` or `./run_humaneval.sh <namespace name> -d 800`

There is a cleanup script in the scripts folder which deletes the job and pvc, user needs to specify the namespace while running it.
`./cleanup.sh <namespace name>`
Expand Down
10 changes: 8 additions & 2 deletions human-eval-benchmark/run_humaneval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

JOB_YAML=./manifests/job.yaml
JOB_NAME=human-eval-deployment-job
NAMESPACE=default
NAMESPACE=${1:-default}
PVC_NAME="human-eval-pvc"

DEFAULT_NUM_PROMPTS=500
Expand Down Expand Up @@ -43,12 +43,18 @@ while getopts "n:d:" opt; do
esac
done

echo $NAMESPACE
if [ "$NAMESPACE" != "default" ]; then
echo "Updating namespace in YAML..."
sed -i "s/namespace: default/namespace: $NAMESPACE/" $JOB_YAML
fi

# Update the Job YAML
if [ -n "$NUM_PROMPTS" -a "$NUM_PROMPTS" != "$DEFAULT_NUM_PROMPTS" ]; then
sed -i "/- name: num_prompts/c\ - name: num_prompts\n value: \"$NUM_PROMPTS\"" $JOB_YAML
sed -i "/value: '500'/d" $JOB_YAML
sed -i '/- name: duration_in_seconds/,+1d' $JOB_YAML
elif [ -n "$DURATION_IN_SECONDS" -a "$DURATION_IN_SECONDS" != "$DEFAULT_DURATION_IN_SECONDS" ]; then
elif [ -n "$DURATION_IN_SECONDS" ]; then
sed -i "/- name: duration_in_seconds/c\ - name: duration_in_seconds\n value: \"$DURATION_IN_SECONDS\"" $JOB_YAML
sed -i "/value: '1800'/d" $JOB_YAML
sed -i '/- name: num_prompts/,+1d' $JOB_YAML
Expand Down

0 comments on commit 490bd3f

Please sign in to comment.