diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-04-16 16:55:49 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-04-16 16:55:49 +0200 |
commit | 063ef729e123aa2cebc7f67c73f99f3e15606fe2 (patch) | |
tree | 649ec331c89c5a5341c27ce66808afd284bda594 /scripts/benchmark | |
parent | c88ad94338ddd6eb05d04d6e91e9ee74cd38cddc (diff) |
Added settings for benchmarking batched routines
Diffstat (limited to 'scripts/benchmark')
-rw-r--r-- | scripts/benchmark/benchmark.py | 4 | ||||
-rw-r--r-- | scripts/benchmark/settings.py | 60 |
2 files changed, 63 insertions, 1 deletions
diff --git a/scripts/benchmark/benchmark.py b/scripts/benchmark/benchmark.py index 46f2c503..c4054669 100644 --- a/scripts/benchmark/benchmark.py +++ b/scripts/benchmark/benchmark.py @@ -17,9 +17,11 @@ import utils EXPERIMENTS = { "axpy": settings.AXPY, + "axpybatched": settings.AXPYBATCHED, "gemv": settings.GEMV, "gemm": settings.GEMM, "gemm_small": settings.GEMM_SMALL, + "gemmbatched": settings.GEMMBATCHED, "symm": settings.SYMM, "syrk": settings.SYRK, "summary": settings.SUMMARY, @@ -62,7 +64,7 @@ def run_benchmark(name, arguments_list, precision, num_runs, platform, device): def parse_arguments(argv): parser = argparse.ArgumentParser(description="Runs a full benchmark for a specific routine on a specific device") - parser.add_argument("-b", "--benchmark", required=True, help="The benchmark to perform (choose from %s)" % EXPERIMENTS.keys()) + parser.add_argument("-b", "--benchmark", required=True, help="The benchmark to perform (choose from %s)" % sorted(EXPERIMENTS.keys())) parser.add_argument("-p", "--platform", required=True, type=int, help="The ID of the OpenCL platform to test on") parser.add_argument("-d", "--device", required=True, type=int, help="The ID of the OpenCL device to test on") parser.add_argument("-n", "--num_runs", type=int, default=None, help="Overrides the default number of benchmark repeats for averaging") diff --git a/scripts/benchmark/settings.py b/scripts/benchmark/settings.py index 77f5fc21..13b7c359 100644 --- a/scripts/benchmark/settings.py +++ b/scripts/benchmark/settings.py @@ -60,6 +60,35 @@ AXPY = { ] } +AXPYBATCHED = { + "label_names": ["CLBlast", "clBLAS (non batched)"], + "num_rows": 1, "num_cols": 3, + "benchmarks": [ + { + "name": "axpybatched", "num_runs": 40, + "title": "10 batches", + "x_label": "sizes (n)", "x_keys": ["n"], + "y_label": "GB/s (higher is better)", "y_keys": ["GBs_1", "GBs_2"], + "arguments": [{"batch_num": 10, "n": utils.k(32), "incx": 1, "incy": 1, "step": utils.k(16), "num_steps": 16}], + }, + { + "name": "axpybatched", "num_runs": 20, + "title": "50 batches", + "x_label": "sizes (m=n=k)", "x_keys": ["n"], + "y_label": "GB/s (higher is better)", "y_keys": ["GBs_1", "GBs_2"], + "arguments": [{"batch_num": 50, "n": utils.k(32), "incx": 1, "incy": 1, "step": utils.k(16), "num_steps": 16}], + }, + { + "name": "axpybatched", "num_runs": 40, + "title": "n=128K", + "x_label": "number of batches", "x_keys": ["batch_num"], + "y_label": "GB/s (higher is better)", "y_keys": ["GBs_1", "GBs_2"], + "arguments": [{"batch_num": b, "n": utils.k(128), "incx": 1, "incy": 1, "step": 1, "num_steps": 1} + for b in utils.powers_of_2(1, 128)], + } + ] +} + GEMV = { "label_names": ["CLBlast", "clBLAS"], "num_rows": 2, "num_cols": 3, @@ -191,6 +220,37 @@ GEMM_SMALL = { ] } +GEMMBATCHED = { + "label_names": ["CLBlast", "clBLAS (non batched)"], + "num_rows": 1, "num_cols": 3, + "benchmarks": [ + { + "name": "gemmbatched", "num_runs": 40, + "title": "10 batches", + "x_label": "sizes (m=n=k)", "x_keys": ["m"], + "y_label": "GFLOPS (higher is better)", "y_keys": ["GFLOPS_1", "GFLOPS_2"], + "arguments": [{"batch_num": 10, "m": 16, "n": 16, "k": 16, "layout": 102, + "transA": 111, "transB": 111, "step": 16, "num_steps": 16}], + }, + { + "name": "gemmbatched", "num_runs": 20, + "title": "50 batches", + "x_label": "sizes (m=n=k)", "x_keys": ["m"], + "y_label": "GFLOPS (higher is better)", "y_keys": ["GFLOPS_1", "GFLOPS_2"], + "arguments": [{"batch_num": 50, "m": 16, "n": 16, "k": 16, "layout": 102, + "transA": 111, "transB": 111, "step": 16, "num_steps": 16}], + }, + { + "name": "gemmbatched", "num_runs": 40, + "title": "m=n=k=32", + "x_label": "number of batches", "x_keys": ["batch_num"], + "y_label": "GFLOPS (higher is better)", "y_keys": ["GFLOPS_1", "GFLOPS_2"], + "arguments": [{"batch_num": b, "m": 32, "n": 32, "k": 32, "layout": 102, + "transA": 111, "transB": 111} for b in utils.powers_of_2(1, 128)], + } + ] +} + SYMM = { "label_names": ["CLBlast", "clBLAS"], "num_rows": 2, "num_cols": 3, |