Spaces:
Running
Running
Added throughput
Browse files- bar_plot.py +2 -2
- data.py +6 -0
bar_plot.py
CHANGED
|
@@ -90,11 +90,11 @@ def create_matplotlib_bar_plot() -> None:
|
|
| 90 |
)
|
| 91 |
return None
|
| 92 |
|
| 93 |
-
# TTFT Plot (
|
| 94 |
ttft_bars, ttft_errors, x_ticks = make_bar_kwargs(per_device_data, "ttft")
|
| 95 |
draw_bar_plot(axs[0], ttft_bars, ttft_errors, "TTFT (seconds)", x_ticks)
|
| 96 |
|
| 97 |
-
# # ITL Plot (
|
| 98 |
itl_bars, itl_errors, x_ticks = make_bar_kwargs(per_device_data, "itl")
|
| 99 |
draw_bar_plot(axs[1], itl_bars, itl_errors, "ITL (seconds)", x_ticks)
|
| 100 |
|
|
|
|
| 90 |
)
|
| 91 |
return None
|
| 92 |
|
| 93 |
+
# TTFT Plot (top)
|
| 94 |
ttft_bars, ttft_errors, x_ticks = make_bar_kwargs(per_device_data, "ttft")
|
| 95 |
draw_bar_plot(axs[0], ttft_bars, ttft_errors, "TTFT (seconds)", x_ticks)
|
| 96 |
|
| 97 |
+
# # ITL Plot (bottom)
|
| 98 |
itl_bars, itl_errors, x_ticks = make_bar_kwargs(per_device_data, "itl")
|
| 99 |
draw_bar_plot(axs[1], itl_bars, itl_errors, "ITL (seconds)", x_ticks)
|
| 100 |
|
data.py
CHANGED
|
@@ -21,6 +21,12 @@ class ModelBenchmarkData:
|
|
| 21 |
for dts in measures["dt_tokens"]
|
| 22 |
]
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
def compute_e2e_latency(self, measures: dict) -> list[float]:
|
| 25 |
return measures["e2e_latency"][:]
|
| 26 |
|
|
|
|
| 21 |
for dts in measures["dt_tokens"]
|
| 22 |
]
|
| 23 |
|
| 24 |
+
def compute_throughput(self, measures: dict, batch_size: int) -> list[float]:
|
| 25 |
+
return [
|
| 26 |
+
(batch_size * len(dts) / e2e) if e2e > 0 else 0
|
| 27 |
+
for e2e, dts in zip(measures["e2e_latency"], measures["dt_tokens"])
|
| 28 |
+
]
|
| 29 |
+
|
| 30 |
def compute_e2e_latency(self, measures: dict) -> list[float]:
|
| 31 |
return measures["e2e_latency"][:]
|
| 32 |
|