Skip to content

Conversation

@BoarQing
Copy link
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant