Handle null plugin EP allocators - #32683
Open
Vineeth Chelur (crvineeth97) wants to merge 3 commits into
Open
Vineeth Chelur (crvineeth97) wants to merge 3 commits into
Vineeth Chelur (crvineeth97) wants to merge 3 commits into
Conversation
OrtEp and OrtEpFactory CreateAllocator may succeed with a null allocator to request default CPU allocation. Skip that optional preferred allocator before Info() and ownership wrapping; preserve errors and non-null ownership paths. Add a default-off example EP option returning success/null for HOST_ACCESSIBLE session memory and reuse the Mul inference regression helper. CPU execution-provider fallback policy is unchanged.
Vineeth Chelur (crvineeth97)
marked this pull request as ready for review
September 17, 2026 20:48
Copilot started reviewing on behalf of
Vineeth Chelur (crvineeth97)
September 17, 2026 20:49
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Factory allocator creation can still dereference null during EP-library registration.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds null allocator handling for plugin EP session allocators.
Changes:
- Skips null preferred allocators.
- Adds an example EP configuration option.
- Adds regression coverage for the per-session path.
File summaries
| File | Description |
|---|---|
test_execution.cc |
Adds regression test. |
ep.h |
Adds allocator configuration flag. |
ep.cc |
Returns null for host-accessible allocation. |
ep_factory.cc |
Parses the test configuration. |
ep_plugin_provider_interfaces.cc |
Skips null session allocators. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
eserscor
reviewed
Sep 17, 2026
Vineeth Chelur (crvineeth97)
requested review from
eserscor
and
a balanced review from Copilot
September 17, 2026 22:56
Copilot started reviewing on behalf of
Vineeth Chelur (crvineeth97)
September 17, 2026 22:56
View session
eserscor
approved these changes
Sep 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
When the QNN HTP shared-memory allocator is disabled, QNN can validly return success with a null per-session
HOST_ACCESSIBLEallocator to request ORT's default CPU allocator.PluginExecutionProvider::CreatePreferredAllocatorsinstead dereferenced the null pointer during session initialization. CPU memory allocation here is independent of CPU execution-provider fallback.What Changed
Skip a null per-session allocator before querying allocator metadata or taking ownership. Add regression coverage for this path.
How Tested
Added
OrtEpLibrary.PluginEp_NullSessionAllocatorUsesDefaultCpuAllocator. Not run locally because this worktree has no existing compatible ORT build cache.