-
Couldn't load subscription status.
- Fork 394
[Plugin EP] Add examples for how to run a plugin EP with C++ and Python #536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added prerequisites for running inference with a Plugin EP.
Refactor plugin EP registration and session creation for TensorRTEp.
Added instructions for running inference with explicit and automatic EP selection.
Added a note about the location of the mul_1.onnx file.
Updated the README to include code examples for running inference with a Plugin EP and clarified the steps for explicit and automatic EP selection.
Updated README to reflect C++ API usage instead of Python API and added additional prerequisites.
| - A dynamic/shared EP library that exports the functions `CreateEpFactories()` and `ReleaseEpFactory()`. | ||
| - ONNX Runtime built as a shared library (e.g., `onnxruntime.dll` on Windows or `libonnxruntime.so` on Linux), since the EP library relies on the public ORT C API (which is ABI-stable) to interact with ONNX Runtime. | ||
| - The `onnxruntime_providers_shared.dll` (Windows) or `libonnxruntime_providers_shared.so` (Linux) is also required. When a plugin EP is registered, ONNX Runtime internally calls `LoadPluginOrProviderBridge`, which depends on this shared library to determine whether the EP DLL is a plugin or a provider-bridge. | ||
| - If you are using a pre-built ONNX Runtime package, all required libraries (e.g., `onnxruntime.dll`, `onnxruntime_providers_shared.dll`, etc.) are already included. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onnxruntime_providers_shared.dll is not required for new EPs that are only using the new binary-stable APIs. If this example is only meant for new EPs, perhaps we don't need to mention it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, i think this example is for how to run ORT inference with a plugin ep, so it's worth mentioning onnxruntime_providers_shared.dll is also required.
If users only have onnxruntime.dll but no onnxruntime_providers_shared.dll is present, it will get following error:
unknown file: error: C++ exception with description "C:\Users\lochi\repos\onnxruntime\onnxruntime\core\session\provider_bridge_ort.cc:1789 onnxruntime::ProviderSharedLibrary::Ensure [ONNXRuntimeError] : 1 : FAIL : Error loading "C:\Users\lochi\repos\plugin_trt_ep_test\plugin_execution_providers\test\tensorrt\build\Debug\onnxruntime_providers_shared.dll" which is missing. (Error 126: "The specified module could not be found.")
" thrown in the test body.
Add two examples to show users how to run a plugin EP with C++ and Python respectively.