Skip to content

Commit 718c432

Browse files
committed
split the parameter definition
1 parent ee6c3d6 commit 718c432

File tree

1 file changed

+16
-43
lines changed

1 file changed

+16
-43
lines changed

cscs-checks/microbenchmarks/gpu/roofline/berkeley-ert-gpu.py

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,12 @@ def check_gnuplot(self):
191191
# {{{ P100_RunErt
192192
@rfm.simple_test
193193
class P100_RunErt(RunErt_Base):
194-
config = parameter([
195-
[ert_precision, ert_flop, ert_gpu_threads]
196-
for ert_precision in ert_precisions
197-
for ert_flop in ert_flops
198-
for ert_gpu_threads in [int(2 ** (log(32, 2)))] # = 32
199-
# uncomment for full search:
200-
# for ert_gpu_threads in [2 ** x for x in range(
201-
# int(log(gpu_specs['P100']['warp_size'], 2)),
202-
# int(log(gpu_specs['P100']['maximum_number_of_threads_per_block'],
203-
# 2) + 1),
204-
# )
205-
# ]
206-
])
194+
ert_precision = parameter([
195+
ert_precision for ert_precision in ert_precisions])
196+
ert_flop = parameter([
197+
ert_flop for ert_flop in ert_flops])
198+
ert_gpu_threads = parameter([
199+
ert_gpu_threads for ert_gpu_threads in [int(2 ** (log(32, 2)))]])
207200
# {{{ pe
208201
gpu = 'V100'
209202
descr = f'Collect ERT data from NVIDIA {gpu}'
@@ -215,8 +208,6 @@ class P100_RunErt(RunErt_Base):
215208
# {{{ build
216209
cap = gpu_specs[gpu]['capability']
217210
ert_trials_min = 1
218-
ert_precision = variable(str)
219-
ert_flop = variable(int)
220211
# }}}
221212

222213
# {{{ run
@@ -226,16 +217,11 @@ class P100_RunErt(RunErt_Base):
226217
exclusive = True
227218
time_limit = '10m'
228219
# set blocks and threads per block:
229-
ert_gpu_threads = variable(int)
230220
maximum_number_of_threads = (
231221
gpu_specs[gpu]['multiprocessors'] *
232222
gpu_specs[gpu]['maximum_number_of_threads_per_multiprocessor']
233223
)
234224

235-
@run_after('init')
236-
def unpack_params(self):
237-
self.ert_precision, self.ert_flop, self.ert_gpu_threads = self.config
238-
239225
@run_after('init')
240226
def set_gpu_blocks(self):
241227
self.ert_gpu_blocks = int(
@@ -287,7 +273,7 @@ def set_dependencies(self):
287273
for ii in ert_precisions:
288274
for jj in ert_flops:
289275
for kk in self.ert_gpu_threads:
290-
self.depends_on(f'{self.dep_name}___{ii}___{jj}__{kk}_',
276+
self.depends_on(f'{self.dep_name}_{ii}_{jj}_{kk}',
291277
udeps.by_env)
292278

293279
# {{{ hooks
@@ -301,7 +287,7 @@ def prepare_logs(self, P100_RunErt):
301287
for jj in ert_flops:
302288
for kk in self.ert_gpu_threads:
303289
dir_fullpath = self.getdep(
304-
f'{self.dep_name}___{ii}___{jj}__{kk}_', part='gpu'
290+
f'{self.dep_name}_{ii}_{jj}_{kk}', part='gpu'
305291
).stagedir
306292
dir_basename = dir_fullpath.split('/')[-1]
307293
self.prerun_cmds.append(
@@ -321,19 +307,12 @@ def prepare_logs(self, P100_RunErt):
321307
# {{{ V100_RunErt
322308
@rfm.simple_test
323309
class V100_RunErt(RunErt_Base):
324-
config = parameter([
325-
[ert_precision, ert_flop, ert_gpu_threads]
326-
for ert_precision in ert_precisions
327-
for ert_flop in ert_flops
328-
for ert_gpu_threads in [32]
329-
# uncomment for full search:
330-
# for ert_gpu_threads in [2 ** x for x in range(
331-
# int(log(gpu_specs['V100']['warp_size'], 2)),
332-
# int(log(gpu_specs['V100']['maximum_number_of_threads_per_block'],
333-
# 2) + 1),
334-
# )
335-
# ]
336-
])
310+
ert_precision = parameter([
311+
ert_precision for ert_precision in ert_precisions])
312+
ert_flop = parameter([
313+
ert_flop for ert_flop in ert_flops])
314+
ert_gpu_threads = parameter([
315+
ert_gpu_threads for ert_gpu_threads in [32]])
337316
# {{{ pe
338317
gpu = 'V100'
339318
descr = f'Collect ERT data from NVIDIA {gpu}'
@@ -344,8 +323,6 @@ class V100_RunErt(RunErt_Base):
344323
# {{{ build
345324
cap = gpu_specs[gpu]['capability']
346325
ert_trials_min = 1
347-
ert_precision = variable(str)
348-
ert_flop = variable(int)
349326
# }}}
350327

351328
# {{{ run
@@ -359,10 +336,6 @@ class V100_RunErt(RunErt_Base):
359336
)
360337
time_limit = '5m'
361338

362-
@run_after('init')
363-
def unpack_params(self):
364-
self.ert_precision, self.ert_flop, self.ert_gpu_threads = self.config
365-
366339
@run_after('init')
367340
def set_gpu_blocks(self):
368341
# set blocks and threads per block:
@@ -414,7 +387,7 @@ def set_dependencies(self):
414387
for ii in ert_precisions:
415388
for jj in ert_flops:
416389
for kk in self.ert_gpu_threads:
417-
self.depends_on(f'{self.dep_name}___{ii}___{jj}__{kk}_',
390+
self.depends_on(f'{self.dep_name}_{ii}_{jj}_{kk}',
418391
udeps.by_env)
419392

420393
# {{{ hooks
@@ -428,7 +401,7 @@ def prepare_logs(self, V100_RunErt):
428401
for jj in ert_flops:
429402
for kk in self.ert_gpu_threads:
430403
dir_fullpath = self.getdep(
431-
f'{self.dep_name}___{ii}___{jj}__{kk}_', part='cn'
404+
f'{self.dep_name}_{ii}_{jj}_{kk}', part='cn'
432405
).stagedir
433406
dir_basename = dir_fullpath.split('/')[-1]
434407
self.prerun_cmds.append(

0 commit comments

Comments
 (0)