Skip to content

Commit c2f08b7

Browse files
author
sd109
committed
Add example Slurm job file for load testing
1 parent 8a6e387 commit c2f08b7

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

scripts/perf-test/slurm.sbatch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
#SBATCH --job-name=my_job_name # Job name
3+
#SBATCH --output=output.txt # Standard output file
4+
#SBATCH --error=error.txt # Standard error file
5+
#SBATCH --nodes=10 # Number of nodes
6+
#SBATCH --ntasks-per-node=1 # Number of tasks per node
7+
#SBATCH --cpus-per-task=1 # Number of CPU cores per task
8+
#SBATCH --time=1:00:00 # Maximum runtime (D-HH:MM:SS)
9+
10+
#Your job commands go here
11+
cat << EOF > run.py
12+
13+
from gradio_client import Client
14+
15+
client = Client("https://insert-public-llm-address/")
16+
17+
18+
for i in range(10):
19+
result = client.predict("Tell me a short story", api_name="/chat")
20+
print(result)
21+
22+
EOF
23+
24+
if [[ ! -d gradio-env ]]; then
25+
python3 -m venv gradio-env
26+
fi
27+
28+
source gradio-env/bin/activate
29+
pip list | grep gradio || pip install gradio
30+
31+
srun python3 run.py

0 commit comments

Comments
 (0)