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
Quick question on the switch to with EpCatalog() as catalog: — the old code at ep_registry.py:92-104 had a long workaround comment explaining that WinMLEpCatalogRelease (called from EpCatalog.close() / __del__) crashes with ACCESS_VIOLATION (0xC0000005) on some QNN NPU driver configurations — a Windows SEH exception that Python try/except cannot catch. The workaround was to null out self._catalog._handle = None so close() becomes a no-op.
The new with EpCatalog() as catalog: still invokes close() via __exit__, which puts that crash path back — just relocated from interpreter shutdown to the return of _load_ep_catalog.
Two questions:
Has the underlying WinMLEpCatalogRelease issue been fixed upstream in windowsml? The original TODO said "Remove once windowsml fixes WinMLEpCatalogRelease to be safe during process teardown."
If not, has winml perf --device npu been verified on a QNN NPU machine after this change to confirm the crash doesn't return?
Side note: this PR also incidentally fixes a bug introduced by #712 — the two independent singletons (WinML and WinMLEPRegistry) both call ort.register_execution_provider_library(...) but dedup separately, so after #712winml perf --device npu emits a library is already registered under QNNExecutionProvider traceback (benign but alarming, swallowed by except Exception). Worth calling out in the PR title/description so it shows up in git log --grep later.
Quick question on the switch to with EpCatalog() as catalog: — the old code at ep_registry.py:92-104 had a long workaround comment explaining that WinMLEpCatalogRelease (called from EpCatalog.close() / __del__) crashes with ACCESS_VIOLATION (0xC0000005) on some QNN NPU driver configurations — a Windows SEH exception that Python try/except cannot catch. The workaround was to null out self._catalog._handle = None so close() becomes a no-op.
The new with EpCatalog() as catalog: still invokes close() via __exit__, which puts that crash path back — just relocated from interpreter shutdown to the return of _load_ep_catalog.
Two questions:
Has the underlying WinMLEpCatalogRelease issue been fixed upstream in windowsml? The original TODO said "Remove once windowsml fixes WinMLEpCatalogRelease to be safe during process teardown."
If not, has winml perf --device npu been verified on a QNN NPU machine after this change to confirm the crash doesn't return?
Side note: this PR also incidentally fixes a bug introduced by #712 — the two independent singletons (WinML and WinMLEPRegistry) both call ort.register_execution_provider_library(...) but dedup separately, so after #712winml perf --device npu emits a library is already registered under QNNExecutionProvider traceback (benign but alarming, swallowed by except Exception). Worth calling out in the PR title/description so it shows up in git log --grep later.
Generated with Claude Code
from my understanding, this is the official usage of windowsml lib https://pypi.org/project/windowsml/ I feel it should be well tested so that access violation should not exist
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
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.
Uh oh!
There was an error while loading. Please reload this page.