Skip to content

Fix Ascend NUMA lookup with PCI sysfs fallback - #129

Open
zhachar14h-cell wants to merge 1 commit into
deepseek-ai:mainfrom
zhachar14h-cell:fix/ascend-pci-numa-fallback
Open

zhachar14h-cell wants to merge 1 commit into
deepseek-ai:mainfrom
zhachar14h-cell:fix/ascend-pci-numa-fallback

Conversation

@zhachar14h-cell

Copy link
Copy Markdown

On an Ascend910B3 container, which_numa(i_gpu=0) raises RuntimeError: NUMA metadata is unavailable for ascend device 0 even though the device's PCI numa_node is readable. npu-smi info -t topo is unsupported on this device and there are no ubcore NUMA entries, so the worker falls back from its NUMA lookup.

Add a PCI sysfs fallback when the existing topology and ubcore paths have no NUMA information. Resolve the runtime ordinal through npu-smi info -m, query that NPU ID and chip ID with info -t board, and read the corresponding PCI numa_node. Keep unknown/missing metadata as unavailable, and retain the current topology/ubcore priority.

Validated on a real A2 / Ascend910B3 with Linux 5.10, CANN 9.0.0 and driver 25.5.0:

  • Logical device 0 maps to NPU ID 1, chip 0, PCI 0000:0a:00.0.
  • Original code raises; patched device_numa_node(0) and which_numa(0) return 0, matching sysfs.
  • 14 regression cases pass on the A2 host with Python 3.11.4 / pytest 8.3.2 and locally with Python 3.13.12 / pytest 8.4.2. They cover remapped IDs, a nonzero chip ID, missing/unknown PCI metadata, and existing-path priority; both ci and ci_npu are selected.
  • Repository-wide Ruff lint/format and git diff --check pass locally.

Validation covers the runtime-independent discovery package only. A3/Ascend910C, Ascend950, full inference, CPU-binding permissions and H2D performance were not tested; this change does not establish full A2/A3 backend support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant