Skip to content

Commit 74c6079

Browse files
committed
Merge branch 'alex_amdsmi' into alex_amdsmi_utests
2 parents 25963a8 + 107fd46 commit 74c6079

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

nodescraper/plugins/inband/amdsmi/amdsmi_collector.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,8 @@ def _to_int(x: Any, default: int = 0) -> int:
291291
for idx, h in enumerate(devices):
292292
bdf = self._smi_try(amdsmi.amdsmi_get_gpu_device_bdf, h, default="") or ""
293293
uuid = self._smi_try(amdsmi.amdsmi_get_gpu_device_uuid, h, default="") or ""
294-
kfd = self._smi_try(amdsmi.amdsmi_get_gpu_kfd_info, h, default={}) or {}
295-
296294
kfd = self._smi_try(amdsmi.amdsmi_get_gpu_kfd_info, h, default={}) or {}
297295
partition_id = 0
298-
if isinstance(kfd, dict):
299-
try:
300-
partition_id = int(kfd.get("current_partition_id", 0) or 0)
301-
except Exception:
302-
partition_id = 0
303296

304297
try:
305298
out.append(
@@ -692,12 +685,9 @@ def get_static(self) -> Optional[list[AmdSmiStatic]]:
692685
numa_node = int(kfd.get("node_id", 0) or 0)
693686
except Exception:
694687
numa_node = 0
695-
try:
696-
affinity = int(kfd.get("cpu_affinity", 0) or 0)
697-
except Exception:
698-
affinity = 0
699688
else:
700-
numa_node, affinity = 0, 0
689+
numa_node = 0
690+
affinity = 0
701691
numa_model = StaticNuma(node=numa_node, affinity=affinity)
702692

703693
# VRAM

test/unit/plugin/test_amdsmi_collector.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import importlib
22
import sys
33
import types
4-
from typing import Tuple
4+
from typing import Optional, Tuple
55

66
import pytest
77

@@ -29,7 +29,7 @@ class AmdSmiTimeoutError(_BaseAmdSmiError): ...
2929

3030
def make_fake_amdsmi(
3131
*,
32-
handles: Tuple[object, ...] | None = None,
32+
handles: Optional[Tuple[object, ...]] = None,
3333
lib_version="1.2.3",
3434
rocm_version="6.1.0",
3535
pcie_static=True,
@@ -81,8 +81,6 @@ def amdsmi_get_processor_handles():
8181
m.amdsmi_get_gpu_kfd_info = lambda h: {
8282
"kfd_id": 7,
8383
"node_id": 3,
84-
"cpu_affinity": 0xFF,
85-
"current_partition_id": 0,
8684
}
8785
m.amdsmi_get_gpu_board_info = lambda h: {
8886
"vbios_name": "vbiosA",

0 commit comments

Comments
 (0)