Skip to content

fix: resolve_device/resolve_eps uses get_registered_ep_devices#712

Merged
xieofxie merged 8 commits into
mainfrom
hualxie/fix_resolve_device
May 25, 2026
Merged

fix: resolve_device/resolve_eps uses get_registered_ep_devices#712
xieofxie merged 8 commits into
mainfrom
hualxie/fix_resolve_device

Conversation

@xieofxie
Copy link
Copy Markdown
Contributor

@xieofxie xieofxie commented May 22, 2026

For a device without openvino gpu but have openvino cpu, the follow command will crash before

winml compile -m "resnet-cpu\model.onnx" -v --ep openvino

Because it will be resolved to gpu device since dml has gpu device

@xieofxie xieofxie requested a review from a team as a code owner May 22, 2026 08:12
Copy link
Copy Markdown
Collaborator

@timenick timenick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One concern: the new _get_device_ep_map_from_ort() and the existing _get_available_eps() now use different ORT APIs, and your error messages mix the two so users can see contradictory output.

Comment thread src/winml/modelkit/sysinfo/device.py
Copy link
Copy Markdown
Collaborator

@DingmaomaoBJTU DingmaomaoBJTU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the direction is right — using get_registered_ep_devices() (the authoritative ORT API) instead of WMI hardware probes eliminates the DML-GPU false positive that caused the original crash. Nice simplification of the test mocking too — single mock point via _patch_device_ep_map is much cleaner.

A few issues to address before merging (1 bug, 2 robustness, 2 nits).

Comment thread src/winml/modelkit/winml.py Outdated
Comment thread src/winml/modelkit/sysinfo/device.py Outdated
Comment thread src/winml/modelkit/sysinfo/device.py
Comment thread src/winml/modelkit/sysinfo/device.py
Comment thread src/winml/modelkit/winml.py Outdated
Comment thread tests/unit/sysinfo/test_device.py Outdated
@xieofxie xieofxie merged commit 4d8e1e5 into main May 25, 2026
9 checks passed
@xieofxie xieofxie deleted the hualxie/fix_resolve_device branch May 25, 2026 03:26
xieofxie added a commit that referenced this pull request May 26, 2026
- remove class WinML as it is confusing
- also incidentally fixes a bug introduced by
#712 — the two independent
singletons (WinML and WinMLEPRegistry) both call
ort.register_execution_provider_library(...) but dedup separately, so
after #712 winml perf
--device npu emits a library is already registered under
QNNExecutionProvider traceback (benign but alarming, swallowed by except
Exception)

---------

Co-authored-by: hualxie <hualxie@microsoft.com>
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.

3 participants