Skip to content

WinMLCG emits misleading EPContext fallback warning during normal ONNX compilation #1442

Description

Summary

Compiling a regular ONNX model with WinMLCG emits a warning containing EPContext fallback, has_attrs=0, and is_epctx=0, even though this is the initial creation of an EP context from a source ONNX model. Compilation and subsequent GPU execution succeed.

The wording and warning severity make a successful first-time compilation look like a failed cache load or execution fallback. This report concerns the WinMLCG diagnostic surfaced by winml compile; it may need routing to the Windows ML / WinMLCG EP owners.

Environment

  • Windows 11 x64; Python 3.11.14
  • winml-cli: 0.4.0
  • windowsml: 2.7.52a0
  • onnxruntime-windowsml: 1.30.0.202609102321
  • GPU: NVIDIA GeForce RTX 5080
  • Model: microsoft/resnet-50

Steps to reproduce

Run in Command Prompt with the environment activated:

winml export -m microsoft/resnet-50 -o temp\bugbash-cgc\resnet50.onnx --overwrite
winml compile -m temp\bugbash-cgc\resnet50.onnx --ep winmlcg --device gpu -o temp\bugbash-cgc\resnet50-winmlcg-ctx.onnx --overwrite
winml perf -m temp\bugbash-cgc\resnet50-winmlcg-ctx.onnx --ep winmlcg --device gpu --runtime winml-ort --iterations 100 --output temp\bugbash-cgc\perf-compiled-ep.json --overwrite

On a machine with multiple GPUs, use --device-luid from winml sys to select the intended adapter for the performance command. The observed run explicitly selected the RTX 5080.

Actual behavior

During the compile command, stderr includes the following warning (the generated fused-node suffix is abbreviated):

[W:onnxruntime:, winmlcg_ep.cpp:3185 winmlcg_ep::WinMLCGExecutionProvider::CompileEPContextSubgraph] EPContext fallback: fused_op=WinMLCGExecutionProvider_<generated-id>_0 fused_domain=WinMLCGExecutionProvider has_attrs=0 is_epctx=0

The command then reports Success! Model compiled and exits 0. The subsequent performance run completes 100/100 iterations and exits 0.

Validation

  • The input to compile is the original source ONNX, not an already compiled EP context.
  • The output contains one com.microsoft:EPContext node with winmlcg_compiled=1 and an existing external MLIR sidecar.
  • A separate session reloaded this existing context with session.disable_cpu_ep_fallback=1 and profiling enabled. Three inferences succeeded with finite [1, 1000] outputs.
  • The profile contained three WinMLCGExecutionProvider kernel events and zero CPUExecutionProvider kernel events. These observations do not support interpreting this warning as a CPU fallback or an invalid compiled result.

Expected behavior

An ordinary first-time ONNX-to-EP-context compilation should not emit a warning that implies cache failure or execution fallback solely because its source graph has no EPContext attributes. Use an informational/debug message for normal path selection, and reserve warning-level diagnostics for an unexpected condition requiring user attention. If a real fallback occurs, identify its source and destination explicitly.

Impact

Users cannot tell from this warning whether compilation is following the expected path or whether the requested provider/cache failed. This is a diagnostic-quality issue; no inference failure was observed in the tested workflow.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneed triageNeeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions