37 lines
808 B
Python
37 lines
808 B
Python
import dataclasses
|
|
import json
|
|
import polars as pl
|
|
import subprocess
|
|
|
|
from config import Configuration, Statistics
|
|
|
|
workloads = [
|
|
"vadd",
|
|
"vmul",
|
|
"haxpy",
|
|
"gemv",
|
|
"gemv_layers"
|
|
]
|
|
|
|
levels = ["X1", "X2", "X3", "X4"]
|
|
|
|
results: list[dict] = []
|
|
|
|
for workload in workloads:
|
|
for level in levels:
|
|
config = Configuration(workload, level)
|
|
serialized_config = json.dumps(dataclasses.asdict(config))
|
|
|
|
out = subprocess.run(
|
|
["python3", "benches.py", serialized_config], capture_output=True
|
|
)
|
|
|
|
statistics = Statistics(**json.loads(out.stdout))
|
|
|
|
result = {"workload": workload, "level": level, "runtime": statistics.runtime}
|
|
results.append(result)
|
|
print(result)
|
|
|
|
df = pl.DataFrame(results)
|
|
df.write_csv("rocm_results.csv")
|