Skip to content

Commit ff1dee1

Browse files
authored
set column affinities to convert csv values
1 parent 12df4a7 commit ff1dee1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/compare-llama-bench.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
"test_time", "avg_ns", "stddev_ns", "avg_ts", "stddev_ts",
3333
]
3434

35+
DB_TYPES = [
36+
"TEXT", "INTEGER", "TEXT", "TEXT", "TEXT", "TEXT",
37+
"TEXT", "INTEGER", "INTEGER", "INTEGER", "INTEGER", "INTEGER",
38+
"TEXT", "INTEGER", "INTEGER", "TEXT", "TEXT", "INTEGER",
39+
"TEXT", "INTEGER", "INTEGER", "INTEGER", "TEXT", "TEXT",
40+
"REAL",
41+
"INTEGER", "INTEGER", "INTEGER", "INTEGER", "INTEGER", "INTEGER",
42+
"TEXT", "INTEGER", "INTEGER", "REAL", "REAL",
43+
]
44+
3545
# Properties by which to differentiate results per commit:
3646
KEY_PROPERTIES = [
3747
"cpu_info", "gpu_info", "backends", "n_gpu_layers", "tensor_buft_overrides", "model_filename", "model_type",
@@ -240,7 +250,7 @@ def __init__(self):
240250
super().__init__()
241251
self.connection = sqlite3.connect(":memory:")
242252
self.cursor = self.connection.cursor()
243-
self.cursor.execute(f"CREATE TABLE test({', '.join(DB_FIELDS)});")
253+
self.cursor.execute(f"CREATE TABLE test({', '.join(' '.join(x) for x in zip(DB_FIELDS, DB_TYPES))});")
244254

245255
def _builds_init(self):
246256
if self.connection:
@@ -354,7 +364,6 @@ def __init__(self, data_files: list[str]):
354364
if (missing_keys := self._check_keys(keys)):
355365
raise RuntimeError(f"Missing required data key(s) at line {i + 1}: {', '.join(missing_keys)}")
356366

357-
# FIXME: Convert float/int columns from str!
358367
self.cursor.execute(f"INSERT INTO test({', '.join(parsed.keys())}) VALUES({', '.join('?' * len(parsed))});", tuple(parsed.values()))
359368

360369
self._builds_init()

0 commit comments

Comments
 (0)