-
Notifications
You must be signed in to change notification settings - Fork 402
Add basic plugin EP library example in C# #552
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
Conversation
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.
Pull request overview
Adds a C# example for using the “basic plugin” Execution Provider (EP) via a NuGet-wrapped native EP library, along with a sample app that demonstrates registration and inference.
Changes:
- Introduces a NuGet package project (
Contoso.ML.OnnxRuntime.EP.Basic) that ships the native EP DLL underruntimes/*/native/and exposes helper APIs (BasicEp). - Adds a Windows batch setup script to copy the native DLL into the package layout and build/pack into a local NuGet feed.
- Adds a sample app that consumes the package and runs inference using the plugin EP.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin_execution_providers/basic/csharp/setup.bat | Builds/packs the NuGet package and stages the native EP DLL into the package runtime folder. |
| plugin_execution_providers/basic/csharp/readme.md | Documents how to build the native EP, pack the NuGet, and run the sample. |
| plugin_execution_providers/basic/csharp/nuget.config | Adds a local package source for consuming the newly built nupkg. |
| plugin_execution_providers/basic/csharp/SampleApp/SampleApp.csproj | Sample app project referencing ONNX Runtime and the EP package/project. |
| plugin_execution_providers/basic/csharp/SampleApp/Program.cs | Demonstrates registering the EP, selecting an EP device, and running inference. |
| plugin_execution_providers/basic/csharp/Contoso.ML.OnnxRuntime.EP.Basic/readme.md | Package README content for NuGet. |
| plugin_execution_providers/basic/csharp/Contoso.ML.OnnxRuntime.EP.Basic/Contoso.ML.OnnxRuntime.EP.Basic.csproj | NuGet package project packing basic_plugin_ep.dll into runtimes/*/native. |
| plugin_execution_providers/basic/csharp/Contoso.ML.OnnxRuntime.EP.Basic/BasicEp.cs | Helper methods to locate the packaged EP DLL and return EP names. |
| plugin_execution_providers/basic/csharp/BasicPluginEpExample.sln | Solution containing the package project and sample app. |
| plugin_execution_providers/basic/csharp/.gitignore | Ignores build artifacts and local feed outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugin_execution_providers/basic/csharp/Contoso.ML.OnnxRuntime.EP.Basic/BasicEp.cs
Outdated
Show resolved
Hide resolved
plugin_execution_providers/basic/csharp/Contoso.ML.OnnxRuntime.EP.Basic/BasicEp.cs
Show resolved
Hide resolved
….EP.Basic/BasicEp.cs
plugin_execution_providers/basic/csharp/Contoso.ML.OnnxRuntime.EP.Basic/BasicEp.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Builds upon #545