diff --git a/reframe/core/systems.py b/reframe/core/systems.py index d51247f8c0..7c5a785e31 100644 --- a/reframe/core/systems.py +++ b/reframe/core/systems.py @@ -128,7 +128,7 @@ class DeviceInfo(_ReadOnlyInfo, jsonext.JSONSerializable): ''' __slots__ = () - _known_attrs = ('type', 'arch') + _known_attrs = ('type', 'arch', 'model') @property def info(self): diff --git a/reframe/schemas/config.json b/reframe/schemas/config.json index f487212829..01f3b9e7ef 100644 --- a/reframe/schemas/config.json +++ b/reframe/schemas/config.json @@ -233,6 +233,7 @@ "properties": { "type": {"type": "string"}, "arch": {"type": "string"}, + "model": {"type": "string"}, "num_devices": {"type": "number"} } }, diff --git a/unittests/resources/config/settings.py b/unittests/resources/config/settings.py index 9a622e0de7..6c0c2fa56f 100644 --- a/unittests/resources/config/settings.py +++ b/unittests/resources/config/settings.py @@ -117,7 +117,8 @@ def hostname(): 'devices': [ { 'type': 'gpu', - 'arch': 'p100', + 'arch': 'sm_60', + 'model': 'p100', 'num_devices': 1 } ] diff --git a/unittests/test_autodetect.py b/unittests/test_autodetect.py index cc59007abc..bf53f6f8d9 100644 --- a/unittests/test_autodetect.py +++ b/unittests/test_autodetect.py @@ -26,7 +26,8 @@ def temp_topo(tmp_path, monkeypatch): json.dump([ { 'type': 'gpu', - 'arch': 'a100', + 'arch': 'sm_80', + 'model': 'a100', 'num_devices': 8 } ], fp) @@ -79,10 +80,14 @@ def test_autotect(default_exec_ctx): assert len(part.devices) == 1 assert part.devices[0].info == { 'type': 'gpu', - 'arch': 'a100', + 'arch': 'sm_80', + 'model': 'a100', 'num_devices': 8 } assert part.devices[0].device_type == 'gpu' + assert part.devices[0].type == 'gpu' + assert part.devices[0].arch == 'sm_80' + assert part.devices[0].model == 'a100' # Test immutability of ProcessorInfo and DeviceInfo with pytest.raises(AttributeError): diff --git a/unittests/test_config.py b/unittests/test_config.py index ddb7e012f7..bbefa0e5c7 100644 --- a/unittests/test_config.py +++ b/unittests/test_config.py @@ -474,6 +474,14 @@ def test_system_create(site_config): assert partition.processor.num_numa_nodes == 1 assert partition.processor.num_cores_per_numa_node == 4 + # Check device info + assert len(partition.devices) == 1 + assert partition.devices[0].type == 'gpu' + assert partition.devices[0].device_type == 'gpu' + assert partition.devices[0].arch == 'sm_60' + assert partition.devices[0].model == 'p100' + assert partition.devices[0].num_devices == 1 + # Select another subconfig and check that the default selection of # container runtime is done properly site_config.select_subconfig('testsys:login')