Skip to content

[VitisAI] Add External EP Loader#26627

Merged
adrianlizarraga merged 2 commits intomicrosoft:mainfrom
BoarQing:external_ep_loader
Dec 5, 2025
Merged

[VitisAI] Add External EP Loader#26627
adrianlizarraga merged 2 commits intomicrosoft:mainfrom
BoarQing:external_ep_loader

Conversation

@BoarQing
Copy link
Copy Markdown
Contributor

@BoarQing BoarQing commented Nov 21, 2025

[VitisAI] Add External EP Loader

Description

This PR introduces a dynamic external execution provider loading mechanism for the VitisAI execution provider, enabling runtime loading of alternative execution providers through a plugin-style architecture.

Key Changes

1. New External EP Library Infrastructure (global_api.cc)

  • Added ExternalEpLibaray class to dynamically load external execution provider libraries at runtime
  • Implemented complete library lifecycle management (loading, unloading, symbol resolution)
  • Added global registry (g_external_ep_libaries) with caching to avoid redundant library loading
  • Created CreateExecutionProviderFromAnotherEp() function to instantiate execution providers from external libraries

Implementation Details:

  • Simplified symbol resolution: Only resolves the essential GetProvider symbol (required)
  • Removed optional symbols: No longer attempts to resolve CreateEpFactories or RyzenAI_SetSessionOptions
  • Lazy initialization pattern with Ensure() method
  • Safe cleanup with Clear() method and proper error handling
  • Platform-agnostic library loading using LIBRARY_PREFIX and LIBRARY_EXTENSION macros

2. API Extension (global_api.h)

  • Declared new public function: CreateExecutionProviderFromAnotherEp()
  • Added required includes:
    • core/framework/execution_provider.h for IExecutionProvider interface
    • <memory> for smart pointer support

3. Factory Integration (vitisai_provider_factory.cc)

  • Integrated external EP loading into the VitisAI provider factory workflow
  • Added provider option check for external_ep_libray key
  • Logic Flow:
    1. Check if external_ep_libray option is specified
    2. If yes, load and return the external execution provider
    3. If no, create and return standard VitisAI execution provider

@BoarQing BoarQing changed the title [VitisAI] add external EP loader [VitisAI] Add External Execution Provider Loader Nov 21, 2025
@BoarQing BoarQing changed the title [VitisAI] Add External Execution Provider Loader [VitisAI] Add External EP Loader Nov 21, 2025
@BoarQing BoarQing marked this pull request as ready for review November 21, 2025 08:54
@BoarQing
Copy link
Copy Markdown
Contributor Author

BoarQing commented Dec 3, 2025

@adrianlizarraga Hi, could u review this

@adrianlizarraga
Copy link
Copy Markdown
Contributor

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

@adrianlizarraga adrianlizarraga merged commit 10afbef into microsoft:main Dec 5, 2025
89 checks passed
alex-spacemit pushed a commit to spacemit-com/onnxruntime that referenced this pull request Dec 8, 2025
## [VitisAI] Add External EP Loader

### Description

This PR introduces a dynamic external execution provider loading
mechanism for the VitisAI execution provider, enabling runtime loading
of alternative execution providers through a plugin-style architecture.

### Key Changes

#### 1. **New External EP Library Infrastructure** (`global_api.cc`)
- Added `ExternalEpLibaray` class to dynamically load external execution
provider libraries at runtime
- Implemented complete library lifecycle management (loading, unloading,
symbol resolution)
- Added global registry (`g_external_ep_libaries`) with caching to avoid
redundant library loading
- Created `CreateExecutionProviderFromAnotherEp()` function to
instantiate execution providers from external libraries

**Implementation Details:**
- **Simplified symbol resolution**: Only resolves the essential
`GetProvider` symbol (required)
- **Removed optional symbols**: No longer attempts to resolve
`CreateEpFactories` or `RyzenAI_SetSessionOptions`
- Lazy initialization pattern with `Ensure()` method
- Safe cleanup with `Clear()` method and proper error handling
- Platform-agnostic library loading using `LIBRARY_PREFIX` and
`LIBRARY_EXTENSION` macros

#### 2. **API Extension** (`global_api.h`)
- Declared new public function: `CreateExecutionProviderFromAnotherEp()`
- Added required includes:
- `core/framework/execution_provider.h` for `IExecutionProvider`
interface
  - `<memory>` for smart pointer support

#### 3. **Factory Integration** (`vitisai_provider_factory.cc`)
- Integrated external EP loading into the VitisAI provider factory
workflow
- Added provider option check for `external_ep_libray` key
- **Logic Flow**:
  1. Check if `external_ep_libray` option is specified
  2. If yes, load and return the external execution provider
  3. If no, create and return standard VitisAI execution provider

Co-authored-by: Yueqing Zhang <yueqingz@amd.com>
Kevin-Taha pushed a commit that referenced this pull request Dec 11, 2025
## [VitisAI] Add External EP Loader

### Description

This PR introduces a dynamic external execution provider loading
mechanism for the VitisAI execution provider, enabling runtime loading
of alternative execution providers through a plugin-style architecture.

### Key Changes

#### 1. **New External EP Library Infrastructure** (`global_api.cc`)
- Added `ExternalEpLibaray` class to dynamically load external execution
provider libraries at runtime
- Implemented complete library lifecycle management (loading, unloading,
symbol resolution)
- Added global registry (`g_external_ep_libaries`) with caching to avoid
redundant library loading
- Created `CreateExecutionProviderFromAnotherEp()` function to
instantiate execution providers from external libraries

**Implementation Details:**
- **Simplified symbol resolution**: Only resolves the essential
`GetProvider` symbol (required)
- **Removed optional symbols**: No longer attempts to resolve
`CreateEpFactories` or `RyzenAI_SetSessionOptions`
- Lazy initialization pattern with `Ensure()` method
- Safe cleanup with `Clear()` method and proper error handling
- Platform-agnostic library loading using `LIBRARY_PREFIX` and
`LIBRARY_EXTENSION` macros

#### 2. **API Extension** (`global_api.h`)
- Declared new public function: `CreateExecutionProviderFromAnotherEp()`
- Added required includes:
- `core/framework/execution_provider.h` for `IExecutionProvider`
interface
  - `<memory>` for smart pointer support

#### 3. **Factory Integration** (`vitisai_provider_factory.cc`)
- Integrated external EP loading into the VitisAI provider factory
workflow
- Added provider option check for `external_ep_libray` key
- **Logic Flow**:
  1. Check if `external_ep_libray` option is specified
  2. If yes, load and return the external execution provider
  3. If no, create and return standard VitisAI execution provider

Co-authored-by: Yueqing Zhang <yueqingz@amd.com>
Sumit2318 pushed a commit that referenced this pull request Jan 6, 2026
## [VitisAI] Add External EP Loader

### Description

This PR introduces a dynamic external execution provider loading
mechanism for the VitisAI execution provider, enabling runtime loading
of alternative execution providers through a plugin-style architecture.

### Key Changes

#### 1. **New External EP Library Infrastructure** (`global_api.cc`)
- Added `ExternalEpLibaray` class to dynamically load external execution
provider libraries at runtime
- Implemented complete library lifecycle management (loading, unloading,
symbol resolution)
- Added global registry (`g_external_ep_libaries`) with caching to avoid
redundant library loading
- Created `CreateExecutionProviderFromAnotherEp()` function to
instantiate execution providers from external libraries

**Implementation Details:**
- **Simplified symbol resolution**: Only resolves the essential
`GetProvider` symbol (required)
- **Removed optional symbols**: No longer attempts to resolve
`CreateEpFactories` or `RyzenAI_SetSessionOptions`
- Lazy initialization pattern with `Ensure()` method
- Safe cleanup with `Clear()` method and proper error handling
- Platform-agnostic library loading using `LIBRARY_PREFIX` and
`LIBRARY_EXTENSION` macros

#### 2. **API Extension** (`global_api.h`)
- Declared new public function: `CreateExecutionProviderFromAnotherEp()`
- Added required includes:
- `core/framework/execution_provider.h` for `IExecutionProvider`
interface
  - `<memory>` for smart pointer support

#### 3. **Factory Integration** (`vitisai_provider_factory.cc`)
- Integrated external EP loading into the VitisAI provider factory
workflow
- Added provider option check for `external_ep_libray` key
- **Logic Flow**:
  1. Check if `external_ep_libray` option is specified
  2. If yes, load and return the external execution provider
  3. If no, create and return standard VitisAI execution provider

Co-authored-by: Yueqing Zhang <yueqingz@amd.com>
baijumeswani pushed a commit to microsoft/onnxruntime-genai that referenced this pull request Jan 16, 2026
Supported for load external provider for VitisAI

see correlated PR: microsoft/onnxruntime#26627

replacement of #1911

---------

Co-authored-by: Yueqing Zhang <yueqingz@amd.com>
Co-authored-by: abalasa-amd <128863051+abalasa-amd@users.noreply.github.com>
Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
adrastogi pushed a commit that referenced this pull request Mar 17, 2026
## [VitisAI] Add External EP Loader

### Description

This PR introduces a dynamic external execution provider loading
mechanism for the VitisAI execution provider, enabling runtime loading
of alternative execution providers through a plugin-style architecture.

### Key Changes

#### 1. **New External EP Library Infrastructure** (`global_api.cc`)
- Added `ExternalEpLibaray` class to dynamically load external execution
provider libraries at runtime
- Implemented complete library lifecycle management (loading, unloading,
symbol resolution)
- Added global registry (`g_external_ep_libaries`) with caching to avoid
redundant library loading
- Created `CreateExecutionProviderFromAnotherEp()` function to
instantiate execution providers from external libraries

**Implementation Details:**
- **Simplified symbol resolution**: Only resolves the essential
`GetProvider` symbol (required)
- **Removed optional symbols**: No longer attempts to resolve
`CreateEpFactories` or `RyzenAI_SetSessionOptions`
- Lazy initialization pattern with `Ensure()` method
- Safe cleanup with `Clear()` method and proper error handling
- Platform-agnostic library loading using `LIBRARY_PREFIX` and
`LIBRARY_EXTENSION` macros

#### 2. **API Extension** (`global_api.h`)
- Declared new public function: `CreateExecutionProviderFromAnotherEp()`
- Added required includes:
- `core/framework/execution_provider.h` for `IExecutionProvider`
interface
  - `<memory>` for smart pointer support

#### 3. **Factory Integration** (`vitisai_provider_factory.cc`)
- Integrated external EP loading into the VitisAI provider factory
workflow
- Added provider option check for `external_ep_libray` key
- **Logic Flow**:
  1. Check if `external_ep_libray` option is specified
  2. If yes, load and return the external execution provider
  3. If no, create and return standard VitisAI execution provider

Co-authored-by: Yueqing Zhang <yueqingz@amd.com>
adrastogi pushed a commit that referenced this pull request Mar 19, 2026
## [VitisAI] Add External EP Loader

### Description

This PR introduces a dynamic external execution provider loading
mechanism for the VitisAI execution provider, enabling runtime loading
of alternative execution providers through a plugin-style architecture.

### Key Changes

#### 1. **New External EP Library Infrastructure** (`global_api.cc`)
- Added `ExternalEpLibaray` class to dynamically load external execution
provider libraries at runtime
- Implemented complete library lifecycle management (loading, unloading,
symbol resolution)
- Added global registry (`g_external_ep_libaries`) with caching to avoid
redundant library loading
- Created `CreateExecutionProviderFromAnotherEp()` function to
instantiate execution providers from external libraries

**Implementation Details:**
- **Simplified symbol resolution**: Only resolves the essential
`GetProvider` symbol (required)
- **Removed optional symbols**: No longer attempts to resolve
`CreateEpFactories` or `RyzenAI_SetSessionOptions`
- Lazy initialization pattern with `Ensure()` method
- Safe cleanup with `Clear()` method and proper error handling
- Platform-agnostic library loading using `LIBRARY_PREFIX` and
`LIBRARY_EXTENSION` macros

#### 2. **API Extension** (`global_api.h`)
- Declared new public function: `CreateExecutionProviderFromAnotherEp()`
- Added required includes:
- `core/framework/execution_provider.h` for `IExecutionProvider`
interface
  - `<memory>` for smart pointer support

#### 3. **Factory Integration** (`vitisai_provider_factory.cc`)
- Integrated external EP loading into the VitisAI provider factory
workflow
- Added provider option check for `external_ep_libray` key
- **Logic Flow**:
  1. Check if `external_ep_libray` option is specified
  2. If yes, load and return the external execution provider
  3. If no, create and return standard VitisAI execution provider

Co-authored-by: Yueqing Zhang <yueqingz@amd.com>
adrastogi added a commit that referenced this pull request Mar 31, 2026
This cherry-picks the following commits for the release:

- #26434 [VitisAI]add tensor type bool
- #26452 [VitisAI EP] Fix error in graph resolving
- #26487 [VitisAI] Enable ort::logger usage in
compile_onnx_model_vitisai_ep_v4
- #26519 [VitisAI] Remove unused function body handling in graph fusion
- #26627 [VitisAI] Add External EP Loader
- #26699 [VitisAI] Add support compiled model compatibility information
retrieval and validation
- #27295 Remove s_kernel_registry_vitisaiep.reset() in
deinitialize_vitisai_ep()
- #27356 Add/Update telemetry events
- #27626 Add PE version info to onnxruntime_providers_vitisai.dll
- #27693 Fix integer division by zero crash in CPU EP Div operator
- #27815 Fix overflow in DmlGraphFusionHelper::ProcessInputData
- #27823 Fix new-delete mismatch in DML EP's QuantizeLinear operator

---------

Co-authored-by: Yueqing Zhang <yuz75@Pitt.edu>
Co-authored-by: Yueqing Zhang <yueqingz@amd.com>
Co-authored-by: zpye <yezupei92@foxmail.com>
Co-authored-by: Chunye Wang@AMD <chunywan@amd.com>
Co-authored-by: mingyue <131847423+mingyueliuh@users.noreply.github.com>
Co-authored-by: zz002 <zhenzew@amd.com>
Co-authored-by: Darshak Bhatti <47045043+dabhattimsft@users.noreply.github.com>
Co-authored-by: Darshak Bhatti <dabhatti@micorsoft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Xiaoxi Han <xiha@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Co-authored-by: skottmckay <979079+skottmckay@users.noreply.github.com>
Co-authored-by: Tianlei Wu <tlwu@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants