Skip to content

Commit

Permalink
add partial node scales to the pt2pt gpu tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Moors committed Jan 12, 2025
1 parent 84f213f commit f27ba00
Showing 1 changed file with 47 additions and 14 deletions.
61 changes: 47 additions & 14 deletions eessi/testsuite/tests/apps/osu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from eessi.testsuite.utils import find_modules, log


def filter_scales_pt2pt():
def filter_scales_pt2pt_cpu():
"""
Filtering function for filtering scales for the pt2pt OSU test
Filtering function for filtering scales for the pt2pt OSU test on CPUs
returns all scales with either 2 cores, 1 full node, or 2 full nodes
"""
return [
Expand All @@ -29,6 +29,19 @@ def filter_scales_pt2pt():
]


def filter_scales_pt2pt_gpu():
"""
Filtering function for filtering scales for the pt2pt OSU test on GPUs
returns all scales with either a partial node, 1 full node, or 2 full nodes
"""
return [
k for (k, v) in SCALES.items()
if (v['num_nodes'] == 1 and v.get('node_part', 0) > 1)
or (v['num_nodes'] == 2 and v.get('node_part', 0) == 1)
or (v['num_nodes'] == 1 and v.get('node_part', 0) == 1)
]


def filter_scales_coll():
"""
Filtering function for filtering scales for the collective OSU test
Expand All @@ -45,7 +58,6 @@ class EESSI_OSU_Base(osu_benchmark):
""" base class for OSU tests """
time_limit = '30m'
module_name = parameter(find_modules('OSU-Micro-Benchmarks'))
device_type = parameter([DEVICE_TYPES[CPU], DEVICE_TYPES[GPU]])

# reset num_tasks_per_node from the hpctestlib: we handle it ourselves
num_tasks_per_node = None
Expand Down Expand Up @@ -87,17 +99,9 @@ def set_tags(self):
self.bench_name = self.benchmark_info[0]
self.tags.add(self.bench_name.split('.')[-1])

@run_after('setup', always_last=True)
def skip_test_1gpu(self):
if self.device_type == DEVICE_TYPES[GPU]:
num_gpus = self.num_gpus_per_node * self.num_nodes
self.skip_if(num_gpus < 2, "Skipping GPU test : only 1 GPU available for this test case")


@rfm.simple_test
class EESSI_OSU_Micro_Benchmarks_pt2pt(EESSI_OSU_Base, EESSI_Mixin):
''' point-to-point OSU test '''
scale = parameter(filter_scales_pt2pt())
class EESSI_OSU_pt2pt_Base(EESSI_OSU_Base):
''' point-to-point OSU test base class '''
compute_unit = COMPUTE_UNIT[NODE]

@run_after('init')
Expand Down Expand Up @@ -130,9 +134,32 @@ def adjust_executable_opts(self):


@rfm.simple_test
class EESSI_OSU_Micro_Benchmarks_coll(EESSI_OSU_Base, EESSI_Mixin):
class EESSI_OSU_pt2pt_CPU(EESSI_OSU_pt2pt_Base, EESSI_Mixin):
''' point-to-point OSU test on CPUs'''
scale = parameter(filter_scales_pt2pt_cpu())
device_type = DEVICE_TYPES[CPU]


@rfm.simple_test
class EESSI_OSU_pt2pt_GPU(EESSI_OSU_pt2pt_Base, EESSI_Mixin):
''' point-to-point OSU test on GPUs'''
scale = parameter(filter_scales_pt2pt_gpu())
device_type = DEVICE_TYPES[GPU]

@run_after('setup')
def skip_test_1gpu(self):
num_gpus = self.num_gpus_per_node * self.num_nodes
self.skip_if(
num_gpus != 2 and self.scale not in ['1_node', '2_nodes'],
f"Skipping test : {num_gpus} GPU(s) available for this test case, need exactly 2"
)


@rfm.simple_test
class EESSI_OSU_coll(EESSI_OSU_Base, EESSI_Mixin):
''' collective OSU test '''
scale = parameter(filter_scales_coll())
device_type = parameter([DEVICE_TYPES[CPU], DEVICE_TYPES[GPU]])

@run_after('init')
def filter_benchmark_coll(self):
Expand All @@ -157,3 +184,9 @@ def set_compute_unit(self):
DEVICE_TYPES[GPU]: COMPUTE_UNIT[GPU],
}
self.compute_unit = device_to_compute_unit.get(self.device_type)

@run_after('setup')
def skip_test_1gpu(self):
if self.device_type == DEVICE_TYPES[GPU]:
num_gpus = self.num_gpus_per_node * self.num_nodes
self.skip_if(num_gpus < 2, "Skipping GPU test : only 1 GPU available for this test case")

0 comments on commit f27ba00

Please sign in to comment.