From 775b996843bf77462c006583ed65b120a7afb14c Mon Sep 17 00:00:00 2001 From: ajocksch Date: Thu, 16 May 2019 15:03:44 +0200 Subject: [PATCH 1/4] [test] revise magma benchmark --- cscs-checks/libraries/magma/magma_checks.py | 30 +++++---------------- cscs-checks/libraries/magma/src/patch.txt | 2 +- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/cscs-checks/libraries/magma/magma_checks.py b/cscs-checks/libraries/magma/magma_checks.py index b6ca0a562a..094489ce6c 100644 --- a/cscs-checks/libraries/magma/magma_checks.py +++ b/cscs-checks/libraries/magma/magma_checks.py @@ -42,78 +42,60 @@ def __init__(self, subtest): elif subtest == 'zgemm': self.perf_patterns = { 'magma': sn.extractsingle(r'MAGMA GFlops: (?P\S+)', - self.stdout, 'magma_gflops', float), + self.stdout, 'magma_gflops', float, 2), 'cublas': sn.extractsingle( r'cuBLAS GFlops: (?P\S+)', self.stdout, - 'cublas_gflops', float), - 'cpu': sn.extractsingle(r'CPU GFlops: (?P\S+)', - self.stdout, 'cpu_gflops', float) + 'cublas_gflops', float, 2) } self.reference = { 'daint:gpu': { - 'magma': (3344, -0.05, None, 'Gflop/s'), - 'cublas': (3709, -0.05, None, 'Gflop/s'), - 'cpu': (42.8, -0.27, None, 'Gflop/s'), + 'magma': (3749, -0.05, None, 'Gflop/s'), + 'cublas': (4050, -0.05, None, 'Gflop/s'), }, 'dom:gpu': { - 'magma': (3344, -0.05, None, 'Gflop/s'), - 'cublas': (3709, -0.05, None, 'Gflop/s'), - 'cpu': (42.8, -0.27, None, 'Gflop/s'), + 'magma': (3749, -0.05, None, 'Gflop/s'), + 'cublas': (4050, -0.05, None, 'Gflop/s'), }, } elif subtest == 'zsymmetrize': self.perf_patterns = { - 'cpu_perf': sn.extractsingle(r'CPU performance: (\S+)', - self.stdout, 1, float), 'gpu_perf': sn.extractsingle(r'GPU performance: (\S+)', self.stdout, 1, float), } self.reference = { 'daint:gpu': { - 'cpu_perf': (0.91, -0.05, None, 'GB/s'), 'gpu_perf': (158.3, -0.05, None, 'GB/s'), }, 'dom:gpu': { - 'cpu_perf': (0.91, -0.05, None, 'GB/s'), 'gpu_perf': (158.3, -0.05, None, 'GB/s'), }, } elif subtest == 'ztranspose': self.perf_patterns = { - 'cpu_perf': - sn.extractsingle(r'CPU performance: (?P\S+)', - self.stdout, 'cpu_performance', float), 'gpu_perf': sn.extractsingle(r'GPU performance: (?P\S+)', self.stdout, 'gpu_performance', float) } self.reference = { 'daint:gpu': { - 'cpu_perf': (1.51, -0.05, None, 'GB/s'), 'gpu_perf': (498.2, -0.05, None, 'GB/s'), }, 'dom:gpu': { - 'cpu_perf': (1.51, -0.05, None, 'GB/s'), 'gpu_perf': (498.2, -0.05, None, 'GB/s'), }, } elif subtest == 'zunmbr': # This test fails to compile with Magma 2.4 self.perf_patterns = { - 'cpu_perf': - sn.extractsingle(r'CPU performance: (?P\S+)', - self.stdout, 'cpu_performance', float), 'gpu_perf': sn.extractsingle(r'GPU performance: (?P\S+)', self.stdout, 'gpu_performance', float) } self.reference = { 'daint:gpu': { - 'cpu_perf': (36.6, -0.05, None, 'Gflop/s'), 'gpu_perf': (254.7, -0.05, None, 'Gflop/s'), }, 'dom:gpu': { - 'cpu_perf': (36.6, -0.05, None, 'Gflop/s'), 'gpu_perf': (254.7, -0.05, None, 'Gflop/s'), }, } diff --git a/cscs-checks/libraries/magma/src/patch.txt b/cscs-checks/libraries/magma/src/patch.txt index 5f3b3bb31e..66945cb9ab 100644 --- a/cscs-checks/libraries/magma/src/patch.txt +++ b/cscs-checks/libraries/magma/src/patch.txt @@ -73,7 +73,7 @@ diff -Naur src/testing_zgemm.cpp src_patched/testing_zgemm.cpp printf("%%========================================================================================================\n"); - for( int itest = 0; itest < opts.ntest; ++itest ) { +//ajajajaj for( int itest = 0; itest < opts.ntest; ++itest ) { -+ for( int itest = 0; itest < opts.ntest; itest+=100 ) { ++ for( int itest = 0; itest < 3; itest++ ) { for( int iter = 0; iter < opts.niter; ++iter ) { M = opts.msize[itest]; N = opts.nsize[itest]; From f02baa1654cc0e12d71aa350a4dab74a8ae10394 Mon Sep 17 00:00:00 2001 From: ajocksch Date: Thu, 16 May 2019 15:11:14 +0200 Subject: [PATCH 2/4] shorter lines --- cscs-checks/libraries/magma/magma_checks.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cscs-checks/libraries/magma/magma_checks.py b/cscs-checks/libraries/magma/magma_checks.py index 094489ce6c..ddf6de70b2 100644 --- a/cscs-checks/libraries/magma/magma_checks.py +++ b/cscs-checks/libraries/magma/magma_checks.py @@ -41,8 +41,10 @@ def __init__(self, subtest): } elif subtest == 'zgemm': self.perf_patterns = { - 'magma': sn.extractsingle(r'MAGMA GFlops: (?P\S+)', - self.stdout, 'magma_gflops', float, 2), + 'magma': sn.extractsingle( + r'MAGMA GFlops: (?P\S+)', + self.stdout, 'magma_gflops', float, 2 + ), 'cublas': sn.extractsingle( r'cuBLAS GFlops: (?P\S+)', self.stdout, 'cublas_gflops', float, 2) @@ -73,8 +75,10 @@ def __init__(self, subtest): elif subtest == 'ztranspose': self.perf_patterns = { 'gpu_perf': - sn.extractsingle(r'GPU performance: (?P\S+)', - self.stdout, 'gpu_performance', float) + sn.extractsingle( + r'GPU performance: (?P\S+)', + self.stdout, 'gpu_performance', float + ) } self.reference = { 'daint:gpu': { @@ -88,8 +92,10 @@ def __init__(self, subtest): # This test fails to compile with Magma 2.4 self.perf_patterns = { 'gpu_perf': - sn.extractsingle(r'GPU performance: (?P\S+)', - self.stdout, 'gpu_performance', float) + sn.extractsingle( + r'GPU performance: (?P\S+)', + self.stdout, 'gpu_performance', float + ) } self.reference = { 'daint:gpu': { From 9ebe7480e01be09c3610a74cb0cc01177ba80133 Mon Sep 17 00:00:00 2001 From: ajocksch Date: Mon, 27 May 2019 12:08:33 +0200 Subject: [PATCH 3/4] shorter patch; new performance data for zgemm --- cscs-checks/libraries/magma/magma_checks.py | 9 +++++---- cscs-checks/libraries/magma/src/patch.txt | 10 ---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cscs-checks/libraries/magma/magma_checks.py b/cscs-checks/libraries/magma/magma_checks.py index ddf6de70b2..61e05d765b 100644 --- a/cscs-checks/libraries/magma/magma_checks.py +++ b/cscs-checks/libraries/magma/magma_checks.py @@ -40,6 +40,7 @@ def __init__(self, subtest): }, } elif subtest == 'zgemm': + self.executable_opts = ['--range 1088:3136:1024'] self.perf_patterns = { 'magma': sn.extractsingle( r'MAGMA GFlops: (?P\S+)', @@ -51,12 +52,12 @@ def __init__(self, subtest): } self.reference = { 'daint:gpu': { - 'magma': (3749, -0.05, None, 'Gflop/s'), - 'cublas': (4050, -0.05, None, 'Gflop/s'), + 'magma': (3692.65, -0.05, None, 'Gflop/s'), + 'cublas': (4269.31, -0.0847, None, 'Gflop/s'), }, 'dom:gpu': { - 'magma': (3749, -0.05, None, 'Gflop/s'), - 'cublas': (4050, -0.05, None, 'Gflop/s'), + 'magma': (3692.65, -0.05, None, 'Gflop/s'), + 'cublas': (4269.31, -0.0847, None, 'Gflop/s'), }, } elif subtest == 'zsymmetrize': diff --git a/cscs-checks/libraries/magma/src/patch.txt b/cscs-checks/libraries/magma/src/patch.txt index 66945cb9ab..cae9612884 100644 --- a/cscs-checks/libraries/magma/src/patch.txt +++ b/cscs-checks/libraries/magma/src/patch.txt @@ -67,16 +67,6 @@ diff -Naur src/testing_zgemm.cpp src_patched/testing_zgemm.cpp // Allow 3*eps; complex needs 2*sqrt(2) factor; see Higham, 2002, sec. 3.6. double eps = lapackf77_dlamch("E"); -@@ -87,7 +88,8 @@ - g_platform_str, g_platform_str ); - #endif - printf("%%========================================================================================================\n"); -- for( int itest = 0; itest < opts.ntest; ++itest ) { -+//ajajajaj for( int itest = 0; itest < opts.ntest; ++itest ) { -+ for( int itest = 0; itest < 3; itest++ ) { - for( int iter = 0; iter < opts.niter; ++iter ) { - M = opts.msize[itest]; - N = opts.nsize[itest]; @@ -220,6 +222,9 @@ cpu_perf, 1000.*cpu_time, magma_error, dev_error, From d69b0b00246f6b3b6c7ada5158cd96feab094064 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Mon, 27 May 2019 18:02:03 +0200 Subject: [PATCH 4/4] Make MAGMA check generic + coding style fixes --- cscs-checks/libraries/magma/magma_checks.py | 23 ++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/cscs-checks/libraries/magma/magma_checks.py b/cscs-checks/libraries/magma/magma_checks.py index 61e05d765b..31cf71d45e 100644 --- a/cscs-checks/libraries/magma/magma_checks.py +++ b/cscs-checks/libraries/magma/magma_checks.py @@ -43,9 +43,9 @@ def __init__(self, subtest): self.executable_opts = ['--range 1088:3136:1024'] self.perf_patterns = { 'magma': sn.extractsingle( - r'MAGMA GFlops: (?P\S+)', - self.stdout, 'magma_gflops', float, 2 - ), + r'MAGMA GFlops: (?P\S+)', + self.stdout, 'magma_gflops', float, 2 + ), 'cublas': sn.extractsingle( r'cuBLAS GFlops: (?P\S+)', self.stdout, 'cublas_gflops', float, 2) @@ -53,11 +53,15 @@ def __init__(self, subtest): self.reference = { 'daint:gpu': { 'magma': (3692.65, -0.05, None, 'Gflop/s'), - 'cublas': (4269.31, -0.0847, None, 'Gflop/s'), + 'cublas': (4269.31, -0.09, None, 'Gflop/s'), }, 'dom:gpu': { 'magma': (3692.65, -0.05, None, 'Gflop/s'), - 'cublas': (4269.31, -0.0847, None, 'Gflop/s'), + 'cublas': (4269.31, -0.09, None, 'Gflop/s'), + }, + '*': { + 'magma': (0, None, None, 'Gflop/s'), + 'cublas': (0, None, None, 'Gflop/s'), }, } elif subtest == 'zsymmetrize': @@ -72,6 +76,9 @@ def __init__(self, subtest): 'dom:gpu': { 'gpu_perf': (158.3, -0.05, None, 'GB/s'), }, + '*': { + 'gpu_perf': (0, None, None, 'GB/s'), + }, } elif subtest == 'ztranspose': self.perf_patterns = { @@ -88,6 +95,9 @@ def __init__(self, subtest): 'dom:gpu': { 'gpu_perf': (498.2, -0.05, None, 'GB/s'), }, + '*': { + 'gpu_perf': (0, None, None, 'GB/s'), + }, } elif subtest == 'zunmbr': # This test fails to compile with Magma 2.4 @@ -105,4 +115,7 @@ def __init__(self, subtest): 'dom:gpu': { 'gpu_perf': (254.7, -0.05, None, 'Gflop/s'), }, + '*': { + 'gpu_perf': (0, None, None, 'Gflop/s'), + }, }