From b35e3d1e5326cdc257daa170eb243800616cfc26 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Sun, 14 Jan 2018 19:50:27 +0100 Subject: Small improvements to benchmarking for cuBLAS --- scripts/benchmark/benchmark_all.py | 2 +- scripts/benchmark/plot.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/benchmark/benchmark_all.py b/scripts/benchmark/benchmark_all.py index 2a7f6c9a..42803614 100644 --- a/scripts/benchmark/benchmark_all.py +++ b/scripts/benchmark/benchmark_all.py @@ -23,7 +23,7 @@ def parse_arguments(argv): parser.add_argument("-d", "--device", required=True, type=int, help="The ID of the OpenCL device to test on") parser.add_argument("-x", "--precision", type=int, default=32, help="The precision to test for (choose from 16, 32, 64, 3232, 6464") parser.add_argument("-l", "--load_from_disk", action="store_true", help="Increase verbosity of the script") - parser.add_argument("-t", "--plot_title", default=None, help="The title for the plots, defaults to benchmark name") + parser.add_argument("-t", "--plot_title", default="", help="The title for the plots, defaults to benchmark name") parser.add_argument("-o", "--output_folder", default=os.getcwd(), help="Sets the folder for output plots (defaults to current folder)") parser.add_argument("-v", "--verbose", action="store_true", help="Increase verbosity of the script") cl_args = parser.parse_args(argv) diff --git a/scripts/benchmark/plot.py b/scripts/benchmark/plot.py index b90a7bf5..06fb278f 100644 --- a/scripts/benchmark/plot.py +++ b/scripts/benchmark/plot.py @@ -15,7 +15,8 @@ import matplotlib.pyplot as plt BLUEISH = [c / 255.0 for c in [71, 101, 177]] # #4765b1 REDISH = [c / 255.0 for c in [214, 117, 104]] # #d67568 PURPLISH = [c / 255.0 for c in [85, 0, 119]] # #550077 -COLORS = [BLUEISH, REDISH, PURPLISH] +GREEN = [c / 255.0 for c in [144, 224, 98]] # #90e062 +COLORS = [BLUEISH, REDISH, PURPLISH, GREEN] MARKERS = ["o-", "x-", ".-"] @@ -86,7 +87,8 @@ def plot_graphs(results, file_name, num_rows, num_cols, # Sets the y-data y_list = [[r[y_key] if y_key in r.keys() else 0 for r in result] for y_key in y_keys[index]] - y_max = max([max(y) for y in y_list]) + y_max = [max(y) if len(y) else 1 for y in y_list] + y_max = max(y_max) if len(y_list) > 0 else 1 # Sets the axes y_rounding = 10 if y_max < 80 else 50 if y_max < 400 else 200 @@ -106,7 +108,10 @@ def plot_graphs(results, file_name, num_rows, num_cols, assert len(MARKERS) >= len(y_keys[index]) assert len(label_names) == len(y_keys[index]) for i in range(len(y_keys[index])): - ax.plot(x_location, y_list[i], MARKERS[i], label=label_names[i], color=COLORS[i]) + color = COLORS[i] + if label_names[i] == "cuBLAS": + color = GREEN + ax.plot(x_location, y_list[i], MARKERS[i], label=label_names[i], color=color) # Sets the legend leg = ax.legend(loc=(0.02, 1.0 - legend_from_top - legend_from_top_per_item * len(y_keys[index])), -- cgit v1.2.3