Skip to content

Bug Bash - EP+Performance compile paths and fixes - #634

Merged
adrastogi merged 5 commits into
microsoft:mainfrom
mahabayana:User/mahabayana/bugBash
May 5, 2026
Merged

Bug Bash - EP+Performance compile paths and fixes#634
adrastogi merged 5 commits into
microsoft:mainfrom
mahabayana:User/mahabayana/bugBash

Conversation

@mahabayana

@mahabayana mahabayana commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Changes

Bug 1 – Missing ready state output after EnsureReadyAsync

  • No feedback was printed after calling EnsureReadyAsync(), making EP readiness hard to debug
  • Added a Console.WriteLine to show the updated ReadyState after the call completes

Bug 2 – Remove DISABLE from ep_policy options

  • DISABLE was listed as a valid --ep_policy value but just set policy to null
  • Unknown values silently fell back to DISABLE instead of reporting an error
  • Removed DISABLE, unknown values now throw an error with valid options listed
  • Updated help text and READMEs in both C++ and C#

Bug 3 – EP+Performance-specific compiled model paths

  • Compiled models always saved as SqueezeNet_ctx.onnx, so different EP/perf configs overwrote each other
  • Added GenerateCompiledModelPath() in both C++ and C# that encodes EP policy/name, device type, and perf mode into the filename
  • Example: SqueezeNet_ctx_PREFER_NPU_MaxPerformance.onnx
  • Users can still override with --compiled_output
  • Updated READMEs with examples of auto-generated filenames
Comment thread Samples/WindowsML/Shared/cpp/ModelManager.cpp Outdated
Comment thread Samples/WindowsML/Shared/cs/ModelManager.cs Outdated
CppConsoleDesktop.exe [options]
Options:
--ep_policy <policy> Set execution provider policy (NPU, CPU, GPU, DEFAULT, DISABLE). Default: DISABLE
--ep_policy <policy> Set execution provider policy (NPU, CPU, GPU, DEFAULT)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see that there's an open PR for addressing the issue w/ the DISABLE option: (#620). How would you all like to reconcile this? mahabayana Gordon Lam (@yeelam-gordon)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

adrastogi Gordon Lam (@yeelam-gordon)
The samples require either --ep_policy or --ep_name to be set. The following scenarios fail due to DISABLE:

Scenario 1 : User explicitly passes DISABLE: The user runs --ep_policy DISABLE. The parser sets ep_policy = null and ep_name remains empty. Validation sees neither is set and throws: "Missing EP selection" - even though the user did specify a policy.

Scenario 2 : User passes an invalid value (e.g., a typo): The user runs --ep_policy NPUU. The parser prints "Unknown EP policy: NPUU, using default (DISABLE)" and silently sets ep_policy = null. Validation again throws "Missing EP selection" : masking the real error (an invalid value)

Thus I would propose this resolution

  • Removed DISABLE as a valid --ep_policy option. If the user's intention is to default to CPU behavior, they can use DEFAULT instead, making DISABLE redundant.
  • Unknown values now throw immediately with the list of valid options (NPU, CPU, GPU, DEFAULT), so typos and invalid inputs are caught at parse time rather than falling through to a incorrect validation error
@mahabayana

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@adrastogi
adrastogi merged commit a1f17bc into microsoft:main May 5, 2026
1 check passed
shisan (qiutongMS) pushed a commit that referenced this pull request Aug 25, 2026
Align the WindowsML central package set with stable Windows App SDK 2.1.3 and port the main-only EP performance chain from PRs #588, #634, #635, #629, #642, and #643.

Preserve release Central Package Management, defer the PR #643 legacy sample removals to final integration review, and record the x64 Release validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants