@@ -92,6 +92,20 @@ class FFTCheck(rfm.RunOnlyRegressionTest):
9292 '3D' : 1 ,
9393 }
9494
95+ # convert time in ms to bandwith in TB/s
96+ def runtime_to_bandwidth (self , time ):
97+ # estimate total size with 16 bytes per element and
98+ # 1 / 2 / 3 reads per element depending on dimension
99+ read_bytes = self .fft_size * 16.0
100+ if self .fft_dim == '2D' :
101+ read_bytes *= self .fft_size * 2.0
102+ if self .fft_dim == '3D' :
103+ read_bytes *= self .fft_size * self .fft_size * 3.0
104+
105+ read_bytes *= self .batch_sizes [self .fft_dim ]
106+
107+ return read_bytes / (time * 1e-3 ) / 1e12
108+
95109 @run_after ('init' )
96110 def setup_dependency (self ):
97111 self .depends_on ('FFTBenchBuild' , udeps .fully )
@@ -115,19 +129,24 @@ def assert_reference(self):
115129 def set_perf_vars (self ):
116130 make_perf = sn .make_performance_function
117131 runtime = sn .extractsingle ('Mean time \[ms\]: (?P<time>\S+)' , self .stdout , 'time' , float )
132+ bandwidth = self .runtime_to_bandwidth (runtime )
118133
119134 self .perf_variables = {
120- 'runtime ' : make_perf (runtime , 'ms ' ),
135+ 'bandwidth ' : make_perf (bandwidth , 'TB/s ' ),
121136 }
122137
123138 @run_before ('performance' )
124139 def set_references (self ):
125140 self .uarch = uarch (self .current_partition )
126141
127- self .reference = {
128- self .current_partition .fullname :
129- {
130- 'runtime' : (self .reference_timings [self .fft_dim ][self .uarch ][str (self .fft_size )], None , 0.2 , 'ms' ),
142+ runtime = self .reference_timings .get (self .fft_dim , {}).get (self .uarch , {}).get (str (self .fft_size ))
143+
144+ if runtime is not None :
145+ bandwidth = self .runtime_to_bandwidth (runtime )
146+ self .reference = {
147+ self .current_partition .fullname :
148+ {
149+ 'bandwidth' : (bandwidth , - 0.2 , None , 'TB/s' ),
150+ }
131151 }
132- }
133152
0 commit comments