You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: thread ep parameter through to WinMLSession (#404)
## Summary
- The `--ep` flag was silently dropped in the model construction path:
`WinMLAutoModel` received it but never forwarded it to
`WinMLPreTrainedModel` → `WinMLSession`
- Added `ep` parameter to `WinMLPreTrainedModel.__init__()` and
forwarded it to `WinMLSession`
- Passed `ep` at all three `winml_class(...)` construction sites in
`WinMLAutoModel` (`from_pretrained`, `from_onnx` skip-build path,
`from_onnx` build path)
### Default-path behavior change
Previously, when no `--ep` was set, `_build_session_options` always fell
through to `set_provider_selection_policy(...)` (PREFER_NPU/GPU/CPU) and
let ORT pick the EP. This PR also changes that path: for non-CPU
devices, it now first calls `_find_ep_for_device` and, if a match is
found, uses `add_provider_for_devices` directly — bypassing the device
policy. This is intentional: it gives us explicit control over which
physical device is used (matching what we already do for the `--ep`
path) and avoids WinML EP registration issues that the `providers=`
string-based path cannot handle.
Fixes#402
🤖 Generated with [Claude Code](https://claude.com/claude-code)
0 commit comments