Add infrastructure for auto EP selection by skottmckay · Pull Request #24430 · microsoft/onnxruntime

added 2 commits

April 15, 2025 21:46

github-actions[bot]

skottmckay

github-advanced-security[bot]

skottmckay

skottmckay

@skottmckay @github-actions

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

yuslepukhin

skottmckay

skottmckay

fs-eire

adrianlizarraga

adrianlizarraga

adrianlizarraga

@skottmckay

Disable EP registration/auto selection testing on non-Windows platforms. There's no device discovery so it can't be used.

RyanUnderhill

adrianlizarraga

adrianlizarraga

adrianlizarraga

adrianlizarraga

@skottmckay

Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>

@skottmckay

@skottmckay

@skottmckay

@skottmckay

@skottmckay

- move provider bridge support to the EP side
- change SessionOptionsAppendExecutionProvider_V2 to take OrtEpDevices as input
- better device discovery (pending final implementation)

@skottmckay

Avoid double lock for Provider Get when it calls Load.

@skottmckay

adrianlizarraga

Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>
Disable setting device_id for DML. Need to investigate why we get an invalid bus number in device discovery. The device discovery code is temporary and most likely has an issue.

@skottmckay

@skottmckay

jywu-msft

@skottmckay skottmckay deleted the skottmckay/AutoSelectEpInfrastructure_PR branch

April 20, 2025 06:14

ashrit-ms pushed a commit that referenced this pull request

Apr 24, 2025
### Description
<!-- Describe your changes. -->
Add infrastructure to enable auto EP selection.

Device discovery for CPU/GPU/NPU on Windows.
Supports internal (CPU/DML/WebGPU) and provider bridge (CUDA) EPs
currently.
Infrastructure will be used with plugin EPs next.

Selection policy implementation will be added next, so in the interim
there's a temporary function with manually specified selection so unit
tests can cover the end-to-end.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>

adrianlizarraga added a commit that referenced this pull request

Apr 25, 2025
### Description
Fixes a segfault that occurs when an EP library is re-loaded in the same
process.


### Motivation and Context
A recent [PR ](#24430)
updated the Environment to unload all EP libraries on destruction of
`OrtEnv`. We forgot to properly update the state to mark the EP library
as unloaded. Therefore, this caused a segfault when the EP library was
re-loaded.

intbf pushed a commit to intbf/onnxruntime that referenced this pull request

Apr 25, 2025
### Description
<!-- Describe your changes. -->
Add infrastructure to enable auto EP selection.

Device discovery for CPU/GPU/NPU on Windows.
Supports internal (CPU/DML/WebGPU) and provider bridge (CUDA) EPs
currently.
Infrastructure will be used with plugin EPs next.

Selection policy implementation will be added next, so in the interim
there's a temporary function with manually specified selection so unit
tests can cover the end-to-end.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>
Signed-off-by: bfilipek <bartlomiej.filipek@intel.com>

vraspar pushed a commit that referenced this pull request

Apr 28, 2025
### Description
Fixes a segfault that occurs when an EP library is re-loaded in the same
process.


### Motivation and Context
A recent [PR ](#24430)
updated the Environment to unload all EP libraries on destruction of
`OrtEnv`. We forgot to properly update the state to mark the EP library
as unloaded. Therefore, this caused a segfault when the EP library was
re-loaded.

ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request

May 12, 2025
### Description
Fixes a segfault that occurs when an EP library is re-loaded in the same
process.


### Motivation and Context
A recent [PR ](microsoft#24430)
updated the Environment to unload all EP libraries on destruction of
`OrtEnv`. We forgot to properly update the state to mark the EP library
as unloaded. Therefore, this caused a segfault when the EP library was
re-loaded.

@fdwr fdwr mentioned this pull request

Sep 18, 2025