From 28a4e1faa82b01d6227309695a6cb1bedd903554 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 21 Jun 2024 21:43:06 +0200 Subject: [PATCH] minor cosmetic changes to the plots --- plotting/plotter1.py | 18 +++++++++--------- plotting/plotter2.py | 12 ++++++------ plotting/plotter3.py | 12 ++++++------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/plotting/plotter1.py b/plotting/plotter1.py index bb85e4e..5f0bc0b 100644 --- a/plotting/plotter1.py +++ b/plotting/plotter1.py @@ -27,14 +27,14 @@ plt.rcParams['ytick.labelsize'] = 18 STYLES = [ # color, marker, offst, name - ('dodgerblue', 'D', (-50, 0), "AVX2"), - ('deeppink', 'o', (-50, -20), "AVX512"), - ('goldenrod', 'h', (-60, -20), "NHWC"), - ('brown', '^', (-185, -90), "Tensor Macro"), - ('darkcyan', 'H', (-65, -15), "Merged"), - ('darkolivegreen', 's', (-90, -100), "Merged+Blocked"), + ('dodgerblue', 'D', (-50, 0), "\\textsc{AVX2}", None), + ('deeppink', 'o', (-50, -20), "\\textsc{AVX512}", None), + ('goldenrod', 'h', (-60, -20), "\\textsc{NHWC}", None), + ('brown', '^', (-210, -135), "\\textsc{Tensor Macro}", 26), + ('darkcyan', 'H', (-75, -15), "\\textsc{Merged}", None), + ('darkolivegreen', 's', (-120, -118), "\\textsc{Merged+Blocked}", None), ] -title = "Increasing Channels - Fully Connected Layers" +title = "\\textbf{Increasing Channels} - \\textbf{Fully Connected Layers}" conv_types = [conv_type for conv_type in ConvType] functions = [function_type for function_type in Function] @@ -132,11 +132,11 @@ def create_plots(ax: Axes, benchmark_file: Path, main: bool) -> None: for i, (impl, x, y) in enumerate(zip(impls,x_data,runtime_values)): if impl == 'data_order_nhwc' or impl == 'best_impl_avx512': print(impl, y) - color, marker, offst, name = STYLES[i] + color, marker, offst, name, rotation = STYLES[i] print(f"-- Adding line for {impls[impl]} ({name})") ax.plot(x, y, label=impls[impl], marker=marker, color=color) if main: - ax.annotate(name or impls[impl], (x[-1], y[-1]), color=color, xytext=offst, textcoords='offset points', fontsize='x-large') + ax.annotate(name or impls[impl], (x[-1], y[-1]), color=color, xytext=offst, textcoords='offset points', fontsize='x-large', rotation=rotation or 0) if main: ax.set_xlabel("Input size [MiB]") else: diff --git a/plotting/plotter2.py b/plotting/plotter2.py index c6f0219..4964aaf 100644 --- a/plotting/plotter2.py +++ b/plotting/plotter2.py @@ -27,13 +27,13 @@ plt.rcParams['ytick.labelsize'] = 18 STYLES = [ # color, marker, offst, name - ('dodgerblue', 'D', (-360, 10), "AVX2", None), - ('deeppink', 'o', (-60, -10), "AVX512", None), - ('brown', 'h', (-365, -30), "Tensor Macro", 11), - ('blueviolet', '^', (-60, -20), "Original", None), - ('darkcyan', 'H', (-60, 10), "Merged", None) + ('dodgerblue', 'D', (-360, -5), "\\textsc{AVX2}", None), + ('deeppink', 'o', (-60, -15), "\\textsc{AVX512}", None), + ('brown', 'h', (-318, -19), "\\textsc{Tensor Macro}", None), + ('blueviolet', '^', (-60, -20), "\\textsc{Original}", None), + ('darkcyan', 'H', (-60, 10), "\\textsc{Merged}", None) ] -title = "Increasing Kernel Size" +title = "\\textbf{Increasing Kernel Size}" conv_types = [conv_type for conv_type in ConvType] functions = [function_type for function_type in Function] diff --git a/plotting/plotter3.py b/plotting/plotter3.py index fe2420e..d751829 100644 --- a/plotting/plotter3.py +++ b/plotting/plotter3.py @@ -27,13 +27,13 @@ plt.rcParams['ytick.labelsize'] = 18 STYLES = { # color, marker, offst, name - 'best_impl_avx2': ('dodgerblue', 'D', (-60, 10), "AVX2", None), - 'best_impl_avx512': ('deeppink', 'o', (-60, -15), "AVX512", None), - 'data_order_nhwc_tensor_macro1': ('brown', 'h', (-380, 51), "Tensor Macro", -23), - 'original': ('blueviolet', '^', (-190, 5), "Original", None), - 't2r_gemmLU': ('darkcyan', 'H', (-45, 10), "Merged", None) + 'best_impl_avx2': ('dodgerblue', 'D', (-60, 5), "\\textsc{AVX2}", None), + 'best_impl_avx512': ('deeppink', 'o', (-60, -25), "\\textsc{AVX512}", None), + 'data_order_nhwc_tensor_macro1': ('brown', 'h', (-380, 43), "\\textsc{Tensor Macro}", -23), + 'original': ('blueviolet', '^', (-190, 0), "\\textsc{Original}", None), + 't2r_gemmLU': ('darkcyan', 'H', (-45, 10), "\\textsc{Merged}", None) } -title = "Increasing Stride" +title = "\\textbf{Increasing Stride}" conv_types = [conv_type for conv_type in ConvType] functions = [function_type for function_type in Function]