Skip to content

Commit 85869f3

Browse files
add runner script and job configuration
Signed-off-by: Spencer Schrock <[email protected]>
1 parent 909230b commit 85869f3

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

benchmarks/cloud_batch.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"taskGroups": [
3+
{
4+
"taskSpec": {
5+
"runnables": [
6+
{
7+
"container": {
8+
"imageUri": "ghcr.io/sigstore/model-transparency-benchmarks:${TAG}",
9+
"entrypoint": "/bin/sh",
10+
"commands": [
11+
"-c",
12+
"benchmarks/run.sh ${MODEL} /mnt/disks/models /mnt/disks/gcs/${OUTPUT_FILE}"
13+
]
14+
}
15+
}
16+
],
17+
"computeResource": {
18+
"cpuMilli": 16000,
19+
"memoryMib": 65536
20+
},
21+
"volumes": [
22+
{
23+
"gcs": {
24+
"remotePath": "model-transparency-benchmarks"
25+
},
26+
"mountPath": "/mnt/disks/gcs"
27+
},
28+
{
29+
"deviceName": "models",
30+
"mountPath": "/mnt/disks/models",
31+
"mountOptions": "rw,async"
32+
}
33+
],
34+
"maxRetryCount": 0,
35+
"maxRunDuration": "3600s"
36+
},
37+
"taskCount": 1,
38+
"parallelism": 1
39+
}
40+
],
41+
"allocationPolicy": {
42+
"instances": [
43+
{
44+
"policy": {
45+
"machineType": "c2d-standard-16",
46+
"disks": [
47+
{
48+
"newDisk": {
49+
"sizeGb": 375,
50+
"type": "local-ssd"
51+
},
52+
"deviceName": "models"
53+
}
54+
]
55+
}
56+
}
57+
]
58+
},
59+
"logsPolicy": {
60+
"destination": "CLOUD_LOGGING"
61+
}
62+
}

benchmarks/run.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
4+
MODEL=$1
5+
MODEL_DIR=$2
6+
MODEL_PATH=$MODEL_DIR/$(echo $MODEL | cut --delimiter='/' --fields=2-)
7+
OUTPUT_FILE=$3
8+
9+
huggingface-cli download $MODEL --local-dir "$MODEL_PATH"
10+
hatch run bench.py3.11:python benchmarks/time_serialize.py "$MODEL_PATH" \
11+
--output=$OUTPUT_FILE

0 commit comments

Comments
 (0)