[CI] Check B200 NUMA mapping against sysfs numa_node (#40055)

Co-authored-by: Mohammad Angkad <mohammad.angkad@radixark.ai>
This commit is contained in:
Mohammad Miadh Angkad
2026-09-17 21:14:47 -07:00
committed by GitHub
co-authored by Mohammad Angkad
parent 826d5170ae
commit c055dc6ff6
+14 -9
View File
@@ -4,6 +4,8 @@ import unittest
from contextlib import ExitStack from contextlib import ExitStack
from unittest.mock import MagicMock, patch from unittest.mock import MagicMock, patch
import torch
from sglang.srt.environ import envs from sglang.srt.environ import envs
from sglang.srt.utils.numa_utils import ( from sglang.srt.utils.numa_utils import (
_handle_numa_bind_failure, _handle_numa_bind_failure,
@@ -12,6 +14,7 @@ from sglang.srt.utils.numa_utils import (
_numactl_cpu_mem_args, _numactl_cpu_mem_args,
_probe_numactl_args, _probe_numactl_args,
_query_numa_node_for_gpu, _query_numa_node_for_gpu,
_read_pci_numa_node,
_strip_memory_args, _strip_memory_args,
configure_subprocess, configure_subprocess,
get_numa_node_if_available, get_numa_node_if_available,
@@ -306,18 +309,20 @@ class TestGraceBlackwellNumaTopology(unittest.TestCase):
"Requires 4-GPU B200 hardware", "Requires 4-GPU B200 hardware",
) )
class TestB200NumaTopology(unittest.TestCase): class TestB200NumaTopology(unittest.TestCase):
"""Hardware test validating expected NUMA topology on 4-GPU B200.""" """Hardware test for the 4-GPU B200 NUMA mapping; layout is BIOS-dependent."""
def test_gpu_numa_mapping(self): def test_gpu_numa_mapping(self):
self.assertEqual(_gpu_count, 4) self.assertEqual(_gpu_count, 4)
numa_nodes = { for gpu_id in range(_gpu_count):
_query_single_numa_node_for_gpu(gpu_id) for gpu_id in range(_gpu_count) # Not NVML: the index mapping under test must not validate itself.
} props = torch.cuda.get_device_properties(gpu_id)
self.assertEqual( pci_address = f"{props.pci_domain_id:04x}:{props.pci_bus_id:02x}:{props.pci_device_id:02x}.0"
len(numa_nodes), self.assertIn(
1, _read_pci_numa_node(pci_address)[0],
f"Expected all visible 4-GPU B200 devices on one NUMA node, got {numa_nodes}", _query_numa_node_for_gpu(gpu_id),
) f"GPU {gpu_id} ({pci_address}): NVML memory affinity omits the "
f"sysfs numa_node",
)
class TestNumaBindIntersection(unittest.TestCase): class TestNumaBindIntersection(unittest.TestCase):