From 97c809448ff106ca8084a8775f14e2f8af71f325 Mon Sep 17 00:00:00 2001 From: JohannesGaessler Date: Tue, 8 Aug 2023 19:34:31 +0200 Subject: [PATCH] add plotting files --- benchmark.sh | 6 ++++++ plot_ts_per_ngl.py | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 benchmark.sh create mode 100644 plot_ts_per_ngl.py diff --git a/benchmark.sh b/benchmark.sh new file mode 100755 index 000000000..67d628698 --- /dev/null +++ b/benchmark.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +for ngl in {0..35} +do + ./main --model models/nvme/llama-7b-ggml-q4_0.bin --seed 1337 --ignore-eos --n-predict 128 --ctx-size 2048 --threads 8 -ngl $ngl -mmq +done diff --git a/plot_ts_per_ngl.py b/plot_ts_per_ngl.py new file mode 100644 index 000000000..b922cee7b --- /dev/null +++ b/plot_ts_per_ngl.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import sqlite3 +import matplotlib.pyplot as plt + +con = sqlite3.connect("llama.sqlite") +cur = con.cursor() + +ts = [] + +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.xlim(0, 35) +plt.ylim(0, 130) +plt.title("7b q4_0, 3700X, 3200 MHz dual-channel RAM, RTX 3090") +plt.xlabel("-ngl") +plt.ylabel("Generated t/s") +plt.savefig("benchmark.png", dpi=240) +plt.show()