[Intel][XPU] Add NUMA node binding support for Intel XPU (#31113)

This commit is contained in:
Siju Samuel
2026-09-07 10:39:21 +08:00
committed by GitHub
parent 1c992bbd94
commit c8207e32b6
3 changed files with 518 additions and 9 deletions
+5 -1
View File
@@ -27,8 +27,9 @@ register_cuda_ci(est_time=6, stage="base-c", runner_config="4-gpu-b200")
class TestIsNumaAvailable(unittest.TestCase):
"""Tests for _is_numa_available on both NUMA and non-NUMA systems."""
@patch("sglang.srt.utils.numa_utils._is_xpu", False)
@patch("sglang.srt.utils.numa_utils._is_cuda", False)
def test_returns_false_when_not_cuda(self):
def test_returns_false_when_not_cuda_or_xpu(self):
self.assertFalse(_is_numa_available())
@patch("sglang.srt.utils.numa_utils._is_cuda", True)
@@ -65,6 +66,9 @@ class TestIsNumaAvailable(unittest.TestCase):
mock_isdir.assert_called_with("/sys/devices/system/node/node1")
# Pin _is_xpu=False so these cases still reach the mocked pynvml on a real XPU
# host, where _query_numa_node_for_gpu short-circuits into the XPU sysfs branch.
@patch("sglang.srt.utils.numa_utils._is_xpu", False)
class TestQueryNumaNodeForGpu(unittest.TestCase):
"""Tests for _query_numa_node_for_gpu with mocked pynvml."""