33#
44# SPDX-License-Identifier: BSD-3-Clause
55
6- import os
7-
86import reframe as rfm
97import reframe .utility .sanity as sn
108
119
1210@rfm .simple_test
1311class ICON4PyBenchmarks (rfm .RunOnlyRegressionTest ):
14- descr = 'ICON4Py GPU benchmarks -Diffusion & DyCore Granules-'
12+ descr = 'ICON4Py Check -Diffusion & DyCore Granules-'
1513 maintainers = ['SSA' ]
1614 valid_systems = ['+uenv +amdgpu' , '+uenv +nvgpu' ]
17- valid_prog_environs = ['+uenv +prgenv + rocm' , '+uenv +prgenv +cuda' ]
15+ valid_prog_environs = ['+uenv +rocm' , '+uenv +cuda' ]
1816 tags = {'uenv' , 'bencher' }
19- time_limit = '30m '
17+ time_limit = '60m '
2018 build_locally = False
2119 env_vars = {
20+ 'ICON4PY_PYTHON_VERSION' : '3.11' ,
21+ 'UV_NO_CACHE' : '1' ,
2222 'UV_CACHE_DIR' : '$SCRATCH/.cache/uv' ,
2323 'CC' : '$(which gcc)' ,
2424 'MPICH_CC' : '$(which gcc)' ,
2525 'CXX' : '$(which g++)' ,
2626 'MPICH_CXX' : '$(which g++)' ,
27+ 'HUGETLB_ELFMAP' : 'no' ,
28+ 'HUGETLB_MORECORE' : 'no' ,
29+ 'GT4PY_UNSTRUCTURED_HORIZONTAL_HAS_UNIT_STRIDE' : '1' ,
30+ 'PYTHONOPTIMIZE' : '2' ,
2731 # GT4Py cache does not work properly for dace backend yet
2832 # 'GT4PY_BUILD_CACHE_LIFETIME': 'persistent',
2933 # 'GT4PY_BUILD_CACHE_DIR': '...',
@@ -32,36 +36,33 @@ class ICON4PyBenchmarks(rfm.RunOnlyRegressionTest):
3236 executable_opts = ['2>&1' ]
3337
3438 @run_before ('run' )
35- def install_deps (self ):
36- self .prerun_cmds = ['./_install.sh &> _install.sh.log 2>&1' ]
37-
38- @run_before ('run' )
39- def prepare_run (self ):
40- if 'rocm' in self .current_environ .features :
41- gpu_arch = self .current_partition .select_devices ('gpu' )[0 ].arch
39+ def prepare_env (self ):
40+ gpu_arch = self .current_partition .select_devices ('gpu' )[0 ].arch
41+ if 'gfx' in gpu_arch : # AMD GPU
4242 self .env_vars ['CUPY_INSTALL_USE_HIP' ] = '1'
4343 self .env_vars ['HCC_AMDGPU_TARGET' ] = gpu_arch
4444 self .env_vars ['ROCM_HOME' ] = '/user-environment/env/default'
45+ # elif 'sm_' in gpu_arch: # CUDA GPU
46+
47+ @run_before ('run' )
48+ def install_deps (self ):
49+ self .prerun_cmds = ['./_install.sh &> _install.sh.log 2>&1' ]
4550
4651 @sanity_function
4752 def validate_test (self ):
48- rfm_stop = os .getenv ('RFM_ICON4PY_STOP' )
49- if rfm_stop == 'Y' :
50- diffusion_granule = sn .assert_found ('# INFO:' , self .stdout )
51- else :
52- diffusion_granule = sn .assert_found (
53- (r'^\s*model/atmosphere/diffusion/tests/'
54- r'diffusion/integration_tests/'
55- r'test_benchmark_diffusion\.py'
56- r'::test_diffusion_benchmark\s*PASSED'
57- ), self .stdout )
58- # dycore_granule = sn.assert_found(
59- # (r'^\s*model/atmosphere/dycore/tests/'
60- # r'dycore/integration_tests/test_benchmark_solve_nonhydro\.py'
61- # r'::test_benchmark_solve_nonhydro\[True-False\]\s*PASSED'),
62- # self.stdout)
53+ diffusion_granule = sn .assert_found (
54+ (r'^\s*model/atmosphere/diffusion/tests/'
55+ r'diffusion/integration_tests/'
56+ r'test_benchmark_diffusion\.py'
57+ r'::test_diffusion_benchmark\s*PASSED'
58+ ), self .stdout )
59+ dycore_granule = sn .assert_found (
60+ (r'^\s*model/atmosphere/dycore/tests/'
61+ r'dycore/integration_tests/test_benchmark_solve_nonhydro\.py'
62+ r'::test_benchmark_solve_nonhydro\[True-False\]\s*PASSED'
63+ ), self .stdout )
6364
64- return diffusion_granule # and dycore_granule
65+ return diffusion_granule and dycore_granule
6566
6667 @run_before ('performance' )
6768 def set_perf_vars (self ):
@@ -76,23 +77,23 @@ def set_perf_vars(self):
7677 diffusion_granule_mean = sn .extractsingle (
7778 diffusion_regex , self .stdout , 'mean' , float )
7879
79- # dycore_regex = (
80- # r'^\s*test_benchmark_solve_nonhydro\[True-False\]\s+'
81- # r'(?P<min>\d+(?:\.\d+)?)' # Min
82- # r'(?:\s+\([^)]+\))?\s+' # optional '(...)'
83- # r'(?P<max>\d+(?:\.\d+)?)' # Max
84- # r'(?:\s+\([^)]+\))?\s+' # optional '(...)'
85- # r'(?P<mean>\d+(?:\.\d+)?)' # Mean
86- # )
87- # dycore_granule_mean = sn.extractsingle(
88- # dycore_regex, self.stdout, 'mean', float)
80+ dycore_regex = (
81+ r'^\s*test_benchmark_solve_nonhydro\[True-False\]\s+'
82+ r'(?P<min>\d+(?:\.\d+)?)' # Min
83+ r'(?:\s+\([^)]+\))?\s+' # optional '(...)'
84+ r'(?P<max>\d+(?:\.\d+)?)' # Max
85+ r'(?:\s+\([^)]+\))?\s+' # optional '(...)'
86+ r'(?P<mean>\d+(?:\.\d+)?)' # Mean
87+ )
88+ dycore_granule_mean = sn .extractsingle (
89+ dycore_regex , self .stdout , 'mean' , float )
8990
9091 self .perf_variables = {
9192 'diffusion_granule' :
9293 sn .make_performance_function (diffusion_granule_mean , 'ms' ),
9394 #
94- # 'dycore_granule':
95- # sn.make_performance_function(dycore_granule_mean, 'ms'),
95+ 'dycore_granule' :
96+ sn .make_performance_function (dycore_granule_mean , 'ms' ),
9697 }
9798
9899 # TODO: add ref. (https://github.com/eth-cscs/cscs-reframe-tests/pull/440)
0 commit comments