Skip to content

[VitisAI] external_ep_library typo fix#2027

Open
akholodnamdcom wants to merge 1 commit intomicrosoft:mainfrom
akholodnamdcom:akholodn/external_ep_library_typo_fix
Open

[VitisAI] external_ep_library typo fix#2027
akholodnamdcom wants to merge 1 commit intomicrosoft:mainfrom
akholodnamdcom:akholodn/external_ep_library_typo_fix

Conversation

@akholodnamdcom
Copy link
Copy Markdown
Contributor

@akholodnamdcom akholodnamdcom commented Mar 13, 2026

@baijumeswani
Copy link
Copy Markdown
Collaborator

akholodnamdcom is this pull-request needed for the next release?

@kunal-vaishnavi kunal-vaishnavi marked this pull request as ready for review March 25, 2026 01:58
Copilot AI review requested due to automatic review settings March 25, 2026 01:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a misspelled VitisAI provider option key so the Windows-specific logic can locate the configured external EP library when the correct option name is used.

Changes:

  • Update the VitisAI provider option lookup key from external_ep_libray to external_ep_library.

Comment on lines 855 to 858
if (provider_options.name == "VitisAI") {
if (const auto opt_it = std::find_if(provider_options.options.begin(), provider_options.options.end(),
[](const auto& pair) { return pair.first == "external_ep_libray"; });
[](const auto& pair) { return pair.first == "external_ep_library"; });
opt_it != provider_options.options.end()) {
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the VitisAI provider option key from "external_ep_libray" to "external_ep_library" is a user-facing behavior change: any existing configs/scripts using the old misspelling will no longer trigger this branch. Consider accepting both keys (and optionally emitting a deprecation warning when the misspelling is used) to preserve backwards compatibility while fixing the typo.

Copilot uses AI. Check for mistakes.
if (provider_options.name == "VitisAI") {
if (const auto opt_it = std::find_if(provider_options.options.begin(), provider_options.options.end(),
[](const auto& pair) { return pair.first == "external_ep_libray"; });
[](const auto& pair) { return pair.first == "external_ep_library"; });
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add backwards compatibility support. Since we do not know the version of the runtime library, we should support this failing and then falling back to the old name with the typo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This thing appears in configs of models, not runtime library. Not sure we should care about backward compatibility. Will double check.

[](const auto& pair) { return pair.first == "external_ep_library"; });
opt_it != provider_options.options.end()) {
auto lib_name = opt_it->second;
auto lib = LoadLibrary(lib_name.c_str());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loadlibrary call seems buggy. It loads the library, does not check for errors when loading the library, and does not close the library (leaking the resource).

Please use proper RAII. See existing support here for loading libraries.

Also, let's not guard this on windows if that is possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ask original author (@BoarQing) of that thing to take a look. I do not have an env to try this out.

[](const auto& pair) { return pair.first == "external_ep_library"; });
opt_it != provider_options.options.end()) {
auto lib_name = opt_it->second;
auto lib = LoadLibrary(lib_name.c_str());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a separate note, why does the library need to be loaded inside ort-genai? It seems the library will be loaded inside ort anyway since we are registering it as a custom opes library. What value does it add to load it here?

Will CreateEpFactories not be invoked when the plug-in library is loaded inside ort?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BoarQing could you please answer the question.

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.

4 participants