[Feat] Add support for per GPU worker RDMA NIC selection (#42083)

Signed-off-by: Raj Joshi <rajjoshi@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Raj Joshi
2026-05-28 12:45:23 -07:00
committed by GitHub
co-authored by Cursor
parent 085ac221a3
commit 9090368b65
7 changed files with 365 additions and 0 deletions
+16
View File
@@ -809,6 +809,22 @@ class NvmlCudaPlatform(CudaPlatformBase):
logger.warning("Failed to get NUMA nodes for GPUs: %s", e)
return None
@classmethod
@with_nvml_context
def get_all_gpu_pci_bus_ids(cls) -> dict[int, str]:
"""Query NVML for GPU index -> PCI bus ID mapping."""
out: dict[int, str] = {}
for idx in range(pynvml.nvmlDeviceGetCount()):
handle = pynvml.nvmlDeviceGetHandleByIndex(idx)
pci_info = pynvml.nvmlDeviceGetPciInfo(handle)
bus_id = pci_info.busId
if isinstance(bus_id, bytes):
bus_id = bus_id.decode("utf-8")
out[idx] = bus_id.rstrip("\x00")
if not out:
raise RuntimeError("NVML returned no GPU PCI bus ID rows")
return out
@classmethod
@with_nvml_context
def log_warnings(cls):
+13
View File
@@ -381,6 +381,19 @@ class Platform:
"""Get the total memory of a device in bytes."""
raise NotImplementedError
@classmethod
def get_all_gpu_pci_bus_ids(cls) -> dict[int, str]:
"""Return a mapping of device index to PCI bus ID string.
Used by ``VLLM_GPU_NIC_PCIE_MAPPING`` for RDMA NIC selection.
Subclasses should override with platform-specific discovery
(e.g. pynvml for CUDA).
"""
raise NotImplementedError(
"VLLM_GPU_NIC_PCIE_MAPPING is not supported on the "
f"current platform ({cls.device_name})"
)
@classmethod
def inference_mode(cls):
"""A device-specific wrapper of `torch.inference_mode`.