summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2018-01-14 19:50:27 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2018-01-14 19:50:27 +0100
commitb35e3d1e5326cdc257daa170eb243800616cfc26 (patch)
tree8088a74e204ab9723854f0e70450c9840af85ac6
parent6d52eb2956c294a46b43627c468813cf64f60b99 (diff)
Small improvements to benchmarking for cuBLAS
-rw-r--r--scripts/benchmark/benchmark_all.py2
-rw-r--r--scripts/benchmark/plot.py11
-rw-r--r--test/performance/client.cpp5
3 files changed, 13 insertions, 5 deletions
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])),
diff --git a/test/performance/client.cpp b/test/performance/client.cpp
index 83088223..9480d11a 100644
--- a/test/performance/client.cpp
+++ b/test/performance/client.cpp
@@ -271,7 +271,10 @@ void Client<T,U>::PerformanceTest(Arguments<U> &args, const SetMetric set_sizes)
auto buffers_cuda = BuffersCUDA<T>();
DeviceToHost(args, buffers, buffers_host, queue, buffers_in_);
HostToCUDA(args, buffers_cuda, buffers_host, buffers_in_);
- auto ms_cublas = TimedExecution(args.num_runs, args, buffers_cuda, queue, run_reference3_, "cuBLAS");
+ auto ms_cublas = 0.0;
+ try {
+ ms_cublas = TimedExecution(args.num_runs, args, buffers_cuda, queue, run_reference3_, "cuBLAS");
+ } catch (std::runtime_error e) { }
CUDAToHost(args, buffers_cuda, buffers_host, buffers_out_);
HostToDevice(args, buffers, buffers_host, queue, buffers_out_);
timings.push_back(std::pair<std::string, double>("cuBLAS", ms_cublas));