-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Benchmark] Fixing minor bugs in benchmark scripts (#192)
* Fixing minor bugs in benchmark scripts Signed-off-by: YuhanLiu11 <[email protected]> * Fixing minor bugs in benchmark scripts Signed-off-by: YuhanLiu11 <[email protected]> * Fixing minor bugs in benchmark scripts Signed-off-by: YuhanLiu11 <[email protected]> --------- Signed-off-by: YuhanLiu11 <[email protected]>
- Loading branch information
1 parent
43e223b
commit fd56e78
Showing
2 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import os | ||
|
||
import numpy as np | ||
import pandas as pd | ||
from matplotlib import pyplot as plt | ||
|
||
stack_results = [] | ||
qpses = [] | ||
for qps in np.arange(0.3, 1.2, 0.2): | ||
# round qps to 1 decimal | ||
q = round(qps, 1) | ||
file = f"stack_output_{q}.csv" | ||
if not os.path.exists(file): | ||
continue | ||
qpses += [q] | ||
# Read csv file | ||
data = pd.read_csv(file)["ttft"].tolist() | ||
stack_results.append(sum(data) / len(data)) | ||
print(stack_results) | ||
|
||
plt.plot( | ||
qpses, | ||
stack_results, | ||
label="Production Stack", | ||
marker="x", | ||
color="blue", | ||
linewidth=2, | ||
markersize=8, | ||
) | ||
aibrix_results = [] | ||
qpses = [] | ||
for qps in np.arange(0.3, 1.2, 0.2): | ||
# round qps to 1 decimal | ||
q = round(qps, 1) | ||
|
||
file = f"aibrix_output_{q}.csv" | ||
if not os.path.exists(file): | ||
continue | ||
qpses += [q] | ||
# Read csv file | ||
data = pd.read_csv(file)["ttft"].tolist() | ||
aibrix_results.append(sum(data) / len(data)) | ||
print(aibrix_results) | ||
plt.plot( | ||
qpses, | ||
aibrix_results, | ||
label="Aibrix", | ||
marker="o", | ||
color="red", | ||
linewidth=2, | ||
markersize=8, | ||
) | ||
|
||
native_results = [] | ||
for qps in np.arange(0.3, 1.2, 0.2): | ||
# round qps to 1 decimal | ||
q = round(qps, 1) | ||
file = f"native_output_{q}.csv" | ||
# Read csv file | ||
data = pd.read_csv(file)["ttft"].tolist() | ||
native_results.append(sum(data) / len(data)) | ||
plt.plot(np.arange(0.3, 1.2, 0.2), native_results, label="Native K8S") | ||
|
||
|
||
plt.xlim(left=0) | ||
plt.ylim(top=10) | ||
plt.xlabel("QPS") | ||
plt.ylabel("Average Time to First Token (s)") | ||
plt.title("Average Time to First Token vs QPS") | ||
plt.savefig("figure.png") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters