Skip to content

Commit a37f967

Browse files
wip
Signed-off-by: Spencer Schrock <[email protected]>
1 parent 89f26a1 commit a37f967

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

benchmarks/Containerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@
1414

1515
FROM python:3.13-slim
1616

17-
RUN apt-get update && apt-get install --no-install-recommends --yes \
18-
clang \
19-
g++ \
20-
&& rm -rf /var/lib/apt/lists/*
21-
22-
RUN python -m pip install --no-cache-dir hatch
17+
RUN python -m pip install --no-cache-dir hatch huggingface_hub[cli]
2318

2419
COPY pyproject.toml LICENSE README.md ./
2520
COPY src ./src
2621
COPY benchmarks ./benchmarks
2722

28-
RUN hatch env create bench
23+
RUN hatch env create bench.py3.11
2924

3025
ENTRYPOINT [ "bash" ]

benchmarks/cloud_batch.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55
"runnables": [
66
{
77
"container": {
8-
"imageUri": "ghcr.io/spencerschrock/model-transparency-benchmarks:latest",
8+
"imageUri": "ghcr.io/spencerschrock/model-transparency-benchmarks:${TAG}",
99
"entrypoint": "/bin/sh",
1010
"commands": [
1111
"-c",
12-
"benchmarks/run.sh | tee /mnt/disks/share/$(date --utc +%Y_%m_%d_%H%M%S).json"
12+
"benchmarks/run.sh ${MODEL} /mnt/disks/models /mnt/disks/gcs/${OUTPUT_FILE}"
1313
]
1414
}
1515
}
1616
],
1717
"computeResource": {
1818
"cpuMilli": 16000,
19-
"memoryMib": 61440
19+
"memoryMib": 65536
2020
},
2121
"volumes": [
2222
{
2323
"gcs": {
24-
"remotePath": "gosst-scare-sandbox-batch-test"
24+
"remotePath": "${BUCKET}"
2525
},
26-
"mountPath": "/mnt/disks/share"
26+
"mountPath": "/mnt/disks/gcs"
2727
},
2828
{
2929
"deviceName": "models",
@@ -42,7 +42,7 @@
4242
"instances": [
4343
{
4444
"policy": {
45-
"machineType": "n1-standard-16",
45+
"machineType": "c2d-standard-16",
4646
"disks": [
4747
{
4848
"newDisk": {

benchmarks/run.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/bin/bash
22
set -euxo pipefail
33

4-
MODEL=deepseek-ai/DeepSeek-R1-Distill-Llama-70B
5-
MODEL_PATH=/mnt/disks/models/$(echo $MODEL | cut --delimiter='/' --fields=2-)
4+
MODEL=$1
5+
MODEL_DIR=$2
6+
MODEL_PATH=$MODEL_DIR/$(echo $MODEL | cut --delimiter='/' --fields=2-)
7+
OUTPUT_FILE=$3
68

7-
pip install huggingface_hub[cli]
89
huggingface-cli download $MODEL --local-dir "$MODEL_PATH"
9-
hatch run bench.py3.11:python benchmarks/time_serialize.py "$MODEL_PATH"
10+
hatch run bench.py3.11:python benchmarks/time_serialize.py "$MODEL_PATH" \
11+
--output=$OUTPUT_FILE

benchmarks/time_serialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def build_parser() -> argparse.ArgumentParser:
6565
results["cpu"] = cpuinfo.get_cpu_info()
6666

6767
if args.output:
68-
with open("data.json", "w", encoding="utf-8") as f:
68+
with open(args.output, "w", encoding="utf-8") as f:
6969
json.dump(results, f, ensure_ascii=False, indent=4)
7070
else:
7171
json.dump(results, sys.stdout, ensure_ascii=False, indent=4)

0 commit comments

Comments
 (0)