From 829565b13dbb59411e22c89a5de50636a26c701c Mon Sep 17 00:00:00 2001 From: JohannesGaessler Date: Wed, 9 Aug 2023 01:31:26 +0200 Subject: [PATCH] better SQL --- plot_ts_per_ngl.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plot_ts_per_ngl.py b/plot_ts_per_ngl.py index b922cee7b..de056b0ed 100644 --- a/plot_ts_per_ngl.py +++ b/plot_ts_per_ngl.py @@ -1,19 +1,16 @@ #!/usr/bin/env python3 import sqlite3 +import numpy as np import matplotlib.pyplot as plt con = sqlite3.connect("llama.sqlite") cur = con.cursor() -ts = [] +res = cur.execute("SELECT n_gpu_layers, 1000000.0*n_eval/t_eval_us FROM llama_runs ORDER BY n_gpu_layers;") +ts = np.array(res.fetchall()) -for ngl in range(0, 36): - res = cur.execute(f"SELECT t_eval_us,n_eval FROM llama_runs WHERE n_gpu_layers={ngl};") - t_eval_us, n_eval = res.fetchone() - ts.append(n_eval * 1000000/t_eval_us) - -plt.plot(ts) +plt.plot(ts[:, 0], ts[:, 1]) plt.xlim(0, 35) plt.ylim(0, 130) plt.title("7b q4_0, 3700X, 3200 MHz dual-channel RAM, RTX 3090")