update graphs
Browse files
graphs.py
CHANGED
@@ -490,16 +490,21 @@ def speedup_bar_chart(df: pd.DataFrame, baseline) -> None:
|
|
490 |
)
|
491 |
|
492 |
|
493 |
-
def kpi_to_markdown(
|
|
|
|
|
494 |
|
495 |
-
title = f"""<br><br>
|
496 |
-
<p style="font-family:sans-serif; font-size: 20px;text-align: center;">Median {device} Acceleration ({len(compute_ratio)} models):</p>"""
|
497 |
if is_baseline:
|
|
|
|
|
498 |
return (
|
499 |
title
|
500 |
+ f"""<p style="font-family:sans-serif; color:{colors[color]}; font-size: 26px;text-align: center;"> {1}x (Baseline)</p>"""
|
501 |
)
|
502 |
|
|
|
|
|
|
|
503 |
if len(compute_ratio) > 0:
|
504 |
kpi_min, kpi_median, kpi_max = (
|
505 |
round(compute_ratio.min(), 2),
|
@@ -534,21 +539,25 @@ def speedup_text_summary(df: pd.DataFrame, baseline) -> None:
|
|
534 |
nvidia_compute_ratio = nvidia_compute_ratio[nvidia_compute_ratio != 0]
|
535 |
groq_compute_ratio = groq_compute_ratio[groq_compute_ratio != 0]
|
536 |
|
|
|
537 |
x86_text = kpi_to_markdown(
|
538 |
x86_compute_ratio,
|
539 |
device="Intel(R) Xeon(R) X40 CPU @ 2.00GHz",
|
|
|
540 |
color="blue",
|
541 |
is_baseline=baseline == "x86",
|
542 |
)
|
543 |
groq_text = kpi_to_markdown(
|
544 |
groq_compute_ratio,
|
545 |
-
device="GroqChip 1",
|
|
|
546 |
color="orange",
|
547 |
is_baseline=baseline == "groq",
|
548 |
)
|
549 |
nvidia_text = kpi_to_markdown(
|
550 |
nvidia_compute_ratio,
|
551 |
device="NVIDIA A100-PCIE-40GB",
|
|
|
552 |
color="green",
|
553 |
is_baseline=baseline == "nvidia",
|
554 |
)
|
|
|
490 |
)
|
491 |
|
492 |
|
493 |
+
def kpi_to_markdown(
|
494 |
+
compute_ratio, device, num_baseline_models, is_baseline=False, color="blue"
|
495 |
+
):
|
496 |
|
|
|
|
|
497 |
if is_baseline:
|
498 |
+
title = f"""<br><br>
|
499 |
+
<p style="font-family:sans-serif; font-size: 20px;text-align: center;">Median {device} Acceleration ({len(compute_ratio)} models):</p>"""
|
500 |
return (
|
501 |
title
|
502 |
+ f"""<p style="font-family:sans-serif; color:{colors[color]}; font-size: 26px;text-align: center;"> {1}x (Baseline)</p>"""
|
503 |
)
|
504 |
|
505 |
+
title = f"""<br><br>
|
506 |
+
<p style="font-family:sans-serif; font-size: 20px;text-align: center;">Median {device} Acceleration ({len(compute_ratio)}/{num_baseline_models} models):</p>"""
|
507 |
+
|
508 |
if len(compute_ratio) > 0:
|
509 |
kpi_min, kpi_median, kpi_max = (
|
510 |
round(compute_ratio.min(), 2),
|
|
|
539 |
nvidia_compute_ratio = nvidia_compute_ratio[nvidia_compute_ratio != 0]
|
540 |
groq_compute_ratio = groq_compute_ratio[groq_compute_ratio != 0]
|
541 |
|
542 |
+
num_baseline_models = len(df[f"{baseline}_compute_ratio"])
|
543 |
x86_text = kpi_to_markdown(
|
544 |
x86_compute_ratio,
|
545 |
device="Intel(R) Xeon(R) X40 CPU @ 2.00GHz",
|
546 |
+
num_baseline_models=num_baseline_models,
|
547 |
color="blue",
|
548 |
is_baseline=baseline == "x86",
|
549 |
)
|
550 |
groq_text = kpi_to_markdown(
|
551 |
groq_compute_ratio,
|
552 |
+
device="GroqChip 1 Estimated",
|
553 |
+
num_baseline_models=num_baseline_models,
|
554 |
color="orange",
|
555 |
is_baseline=baseline == "groq",
|
556 |
)
|
557 |
nvidia_text = kpi_to_markdown(
|
558 |
nvidia_compute_ratio,
|
559 |
device="NVIDIA A100-PCIE-40GB",
|
560 |
+
num_baseline_models=num_baseline_models,
|
561 |
color="green",
|
562 |
is_baseline=baseline == "nvidia",
|
563 |
)
|