Skip to content

fix(sys): keep --list-device consistent with the default view - #1227

Merged
KayMKM merged 1 commit into
mainfrom
yuesu/fix-sys-list-device-enrichment
Jul 28, 2026
Merged

fix(sys): keep --list-device consistent with the default view#1227
KayMKM merged 1 commit into
mainfrom
yuesu/fix-sys-list-device-enrichment

Conversation

@KayMKM

@KayMKM KayMKM commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

winml sys --list-device reported fewer device details than winml sys for
the same hardware. On the OV e2e agent (Intel Core Ultra 7 258V + Arc 140V + AI
Boost NPU) the NPU/GPU rows lost architecture entirely, failing
TestSysCrossViewConsistency::test_devices_match_across_default_and_list_device_views
in the pytest: test_sys_e2e.py step (build 20260727.1, E2E Test — OV).

Root cause

_gather_device_info folds device_facts (Architecture, and Driver when
sysinfo has none) into each device's details, and its only source for those
facts is the EP inventory returned by _gather_ep_info — filesystem-backed EPs
are registered in isolated subprocesses, so the parent process can only see
those facts through the serialized inventory.

_gather gathered that inventory only when the EP section was requested:

if eps:
    info["executionProviders"] = _gather_ep_info()
if devices:
    info["devices"] = _gather_device_info(info.get("executionProviders"))

The default view asks for both sections, so enrichment ran. --list-device
asks for devices only, so ep_info was None and enrichment silently
no-oped. The mismatch only surfaces on hosts whose EPs actually report an
Architecture fact, which is why the OV stage caught it and the others did not.

Fix

Gather the EP inventory whenever devices are requested, and let eps decide
only whether the executionProviders section is emitted. The JSON payload
shape of --list-device is unchanged (still {"devices": [...]}), so the
existing single-key shape guard still holds. Because enrichment is
best-effort, an EP probing failure stays non-fatal for a devices-only request;
an explicitly pinned --list-ep still raises as before.

Verification

On the OV agent, --list-device and the default view now agree:

match = True
"details": { "driver": "32.0.100.4724", "manufacturer": "Intel Corporation", "architecture": "4000" }
  • pytest -m e2e tests/e2e/test_sys_e2e.py — 19 passed (the failing case now passes)
  • pytest tests/unit/commands/test_sys_device_info.py — 8 passed (4 new)
  • pytest tests/unit/cli/test_main.py tests/cli/test_main.py — 48 passed

`winml sys --list-device` gathered only the device section, so `_gather_device_info` ran without `ep_info` and skipped the `device_facts` enrichment that folds Architecture (and Driver, when sysinfo has none) into each device's `details`. The default view gathers EPs too, so the same hardware reported different `details` keys depending on which view surfaced it -- on an Intel host the NPU/GPU rows lost `architecture` entirely.

Gather the EP inventory whenever devices are requested and let `eps` decide only whether the `executionProviders` section is emitted, so the JSON payload shape of `--list-device` is unchanged. EP probing failures stay non-fatal for a devices-only request since enrichment is best-effort.
@KayMKM
KayMKM requested a review from a team as a code owner July 27, 2026 09:50
@KayMKM
KayMKM merged commit 54e921a into main Jul 28, 2026
9 checks passed
@KayMKM
KayMKM deleted the yuesu/fix-sys-list-device-enrichment branch July 28, 2026 02:40
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.

2 participants