Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion tests/test_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .fixtures.utils import get_gpu_nodeid_map
from .fixtures.utils import get_num_gpus
from .fixtures.utils import get_num_cpus

from madengine.core.context import Context

class TestContexts:

Expand Down Expand Up @@ -283,3 +283,24 @@ def test_docker_cpus(self, global_data, clean_test_temp_files):
pytest.fail("model in perf_test.csv did not run successfully.")
if not success:
pytest.fail("docker_cpus did not bind expected cpus in docker container.")

def test_gpu_product_name_matches_arch(self):
"""
Check MAD_SYSTEM_GPU_PRODUCT_NAME is not empty and is valid.

No models run for this test.
"""

context = Context()
product_name = context.ctx['docker_env_vars']["MAD_SYSTEM_GPU_PRODUCT_NAME"]

#fail the test if GPU product name is empty
if not product_name or not product_name.strip():
pytest.fail("GPU product name is empty or just whitespaces")

product_name = product_name.upper()

#if product name has AMD or NVIDIA in it then it's a safe bet
#that it was parsed properly
if not ("AMD" in product_name or "NVIDIA" in product_name):
pytest.fail(f"Incorrect product name={product_name!r}")