fix(compile): derive Device label from resolved EP, not CLI default#280
Merged
Conversation
…ault Use _EP_TO_DEVICE[provider] to display the correct device when --ep overrides the default device (e.g. --ep dml shows 'gpu' not 'npu'). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
compile_onnx and WinMLCompileConfig are imported inside the function body, so they're never bound at the commands.compile module level. The correct patch target for lazy imports is the source module (winml.modelkit.compiler). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
is_compiled_onnx is a module-level import that parses the ONNX file before the Device label is printed; patch it so the test doesn't need a valid model. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zhenchaoni
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_EP_TO_DEVICEincompile.pyand use_EP_TO_DEVICE.get(provider, device)to derive the displayedDevice:label from the resolved execution provider rather than the raw CLI--devicedefault (npu).wmk compile --ep dmlwould displayDevice: npuinstead ofDevice: gpu.Test plan
TestCompileDeviceDisplayLabel::test_dml_ep_shows_gpu_device— invokes compile with--ep dmland asserts output containsDevice: gpuand notDevice: npuExtracted from #209 (Bug C only).
🤖 Generated with Claude Code