Summary
WinMLSession._build_session_options takes provider_options from ep_config and passes them only in the explicit-EP path (add_provider_for_devices). In the policy-based path (the default for device="npu"/"auto"), they are silently ignored.
Affected code
src/winml/modelkit/session/session.py L387-L414
# Explicit EP path — provider_options correctly forwarded
opts.add_provider_for_devices([matched], self._provider_options) # ✓
# Policy-based path (default) — provider_options silently dropped
opts.set_provider_selection_policy(policy)
return opts # ✗ self._provider_options never used
Impact
Any option set via ep_config.provider_options is silently dropped during a normal winml compile run. Confirmed affected option: htp_performance_mode, set in:
The compile pipeline (CompileStage) passes ep_config to WinMLSession, but the session never applies provider_options when using the standard policy path. As a result, QNN provider options (HTP performance mode, SOC model, etc.) have no effect.
Expected behavior
provider_options should be forwarded to ORT regardless of whether explicit-EP or policy-based selection is used.
Steps to reproduce
from winml.modelkit.compiler.configs import WinMLCompileConfig
config = WinMLCompileConfig.for_qnn()
config.ep_config.provider_options["htp_performance_mode"] = "burst"
# Compile a model — htp_performance_mode is silently ignored
Notes
- Discovered during investigation of QNN compilation behavior for deberta Slice ops.
- The policy-based path uses
set_provider_selection_policy, which may have a different API for passing provider options — needs investigation.
Summary
WinMLSession._build_session_optionstakesprovider_optionsfromep_configand passes them only in the explicit-EP path (add_provider_for_devices). In the policy-based path (the default fordevice="npu"/"auto"), they are silently ignored.Affected code
src/winml/modelkit/session/session.pyL387-L414Impact
Any option set via
ep_config.provider_optionsis silently dropped during a normalwinml compilerun. Confirmed affected option:htp_performance_mode, set in:src/winml/modelkit/compiler/__init__.pyL23:config.ep_config.provider_options["htp_performance_mode"] = "default"src/winml/modelkit/compiler/configs.pyL75: docstring example setshtp_performance_mode = "default"The compile pipeline (
CompileStage) passesep_configtoWinMLSession, but the session never appliesprovider_optionswhen using the standard policy path. As a result, QNN provider options (HTP performance mode, SOC model, etc.) have no effect.Expected behavior
provider_optionsshould be forwarded to ORT regardless of whether explicit-EP or policy-based selection is used.Steps to reproduce
Notes
set_provider_selection_policy, which may have a different API for passing provider options — needs investigation.