-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_performance_eval.py
41 lines (34 loc) · 1.56 KB
/
run_performance_eval.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import subprocess
import sys
from pathlib import Path
# Directories and models
SOURCE_DIR = Path("src-tauri")
BENCH_DIR = Path("data/benchmarks/")
MODELS = ["celldivb", "eprotein", "nsp4", "etc", "interferon", "nsp9", "macrophage"]
# Step 1: Compile Rust binaries
print(">>>>>>>>>> COMPILE RUST BINARIES", flush=True)
try:
subprocess.run(["cargo", "build", "--release", "--bin", "run-inference"], cwd=SOURCE_DIR, check=True)
print("Compilation completed successfully.\n", flush=True)
except subprocess.CalledProcessError as e:
print(f"Error during Rust compilation: {e}", file=sys.stderr, flush=True)
sys.exit(1)
# Step 2: Run benchmarks
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", flush=True)
print(">>>>>>>>>> START BENCHMARKS RUN", flush=True)
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n", flush=True)
for model in MODELS:
print("==========================", flush=True)
print(f"Model {model}", flush=True)
print("==========================\n", flush=True)
model_dir = BENCH_DIR / model
aeon_file = model_dir / f"{model}_sketch.aeon"
if not aeon_file.exists():
print(f"File not found: {aeon_file}", file=sys.stderr, flush=True)
continue
try:
subprocess.run([str(SOURCE_DIR / "target/release/run-inference"), str(aeon_file)], check=True)
except FileNotFoundError:
print(f"Executable not found: {SOURCE_DIR / 'target/release/run-inference'}", file=sys.stderr, flush=True)
except subprocess.CalledProcessError as e:
print(f"Error running inference for {model}: {e}", file=sys.stderr, flush=True)