perftest: Use plugin EP device allocators for input/output buffers - #32244
Open
Jaskaran Singh Nagi (jnagi-intel) wants to merge 2 commits into
Open
perftest: Use plugin EP device allocators for input/output buffers#32244Jaskaran Singh Nagi (jnagi-intel) wants to merge 2 commits into
Jaskaran Singh Nagi (jnagi-intel) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Jaskaran Singh Nagi (jnagi-intel)
August 24, 2026 20:53
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates perftest to select allocators exposed by plugin EP devices.
Changes:
- Returns selected plugin EP devices during session setup.
- Chooses a default or host-accessible plugin allocator.
- Falls back to the CPU allocator for ambiguous/unavailable devices.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
onnxruntime/test/perftest/utils.h |
Declares plugin device and allocator-selection APIs. |
onnxruntime/test/perftest/common_utils.cc |
Implements selected-device tracking and allocator lookup. |
onnxruntime/test/perftest/ort_test_session.cc |
Applies the selected allocator to perftest buffers. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jaskaran Singh Nagi (jnagi-intel)
force-pushed
the
plugin-ep-allocators
branch
from
August 24, 2026 21:17
7a786fa to
f2f28be
Compare
Copilot started reviewing on behalf of
Jaskaran Singh Nagi (jnagi-intel)
August 24, 2026 21:57
View session
Copilot started reviewing on behalf of
Jaskaran Singh Nagi (jnagi-intel)
August 24, 2026 22:24
View session
Comment on lines
+1018
to
+1019
| if (is_dynamic || (device_memory_name_.empty() && !has_plugin_ep_allocator_) || | ||
| (requires_input_staging_ && is_string_output)) { |
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.
Description
Adds support for using a plugin EP device's own allocator for input/output buffers in
onnxruntime_perf_test, instead of always using the CPU allocator.--plugin_eps),onnxruntime_perf_testnow selects an allocator from the appendedOrtEpDevice: it prefers the device's default (device-only) allocator, falls back to its host-accessible allocator, and falls back to the CPU allocator if neither is available or if more than one EP device was appended (no single unambiguous allocator to pick).-r) and pre-allocated fixed-shape outputs now use this allocator instead of the CPU allocator.Ort::Env::CopyTensor), instead of being copied per-Run()implicitly.std::stringis placement-constructed by ORT directly into the tensor's owned memory and can't safely live in device-only memory.[Plugin EP]-prefixed logging indicating which allocator was selected.Motivation and Context
onnxruntime_perf_testpreviously always allocated input/output buffers on the CPU when running with plugin EPs. For plugin EPs whose kernels expect device-resident inputs/outputs, this meant everyRun()iteration paid for an implicit host↔device copy that was entirely avoidable, skewing per-iteration latency measurements away from the EP's actual compute cost. Selecting and reusing the EP device's own allocator up front lets perf numbers better reflect steady-state inference cost for plugin EPs.