Repository navigation
Add executable EPContext fixture for encrypted binding tests - #33216
Gopalakrishnan Nallasamy (GopalakrishnanN) wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Embed mode produces an unloadable executable fixture, and the new execution path lacks in-tree regression coverage.
3 open findings
What changed in this PR
Adds an opt-in executable EPContext fixture for encrypted binding integration tests while preserving default example-provider behavior.
Changes:
- Adds external float32 Mul descriptor serialization/restoration.
- Adds a reproducible two-input ONNX fixture.
- Documents planned language-binding workflows and exclusions.
| File | Description |
|---|---|
.gitignore |
Tracks the generated ONNX fixture. |
docs/design/Compiled_Model_Encryption.md |
Documents binding workflows. |
onnxruntime/test/autoep/library/example_plugin_ep/ep.cc |
Implements descriptor generation, restoration, and execution. |
onnxruntime/test/autoep/library/example_plugin_ep/ep.h |
Adds executable-context state and configuration. |
onnxruntime/test/autoep/library/example_plugin_ep/ep_factory.cc |
Parses the opt-in session setting. |
onnxruntime/test/testdata/encrypted_ep_context_mul.py |
Generates the Mul test model. |
onnxruntime/test/testdata/encrypted_ep_context_mul.onnx |
Provides the generated model fixture. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the existing unordered-map overload explicitly so GCC and Clang do not have to choose between the map and parallel-vector options overloads. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Fixed the common Linux/wasm CI compiler error: the fixture now explicitly selects the unordered-map AppendExecutionProvider_V2 overload instead of ambiguous {} options. Validated the corrected call with MSVC C++17 /W4 /WX, and pushed 8fe6336. New-head CI started automatically; no stale-head runs were retriggered. |
Tianlei Wu (tianleiwu)
left a comment
There was a problem hiding this comment.
LGTM! Clean, well-scoped opt-in executable external EPContext fixture (ep.example.test_execute_ep_context=1) and native round-trip test coverage (PluginEp_ExecutableExternalContextRoundTrip).
Verified locally on Linux (onnxruntime_autoep_test --gtest_filter=OrtEpLibrary.PluginEp_ExecutableExternalContextRoundTrip:OrtEpLibrary.PluginEp_GenEpContextModel_EmbedModeDoesNotUseCallbacks:OrtEpLibrary.PluginEp_LoadEpContextModel_ExternalDataUsesReadCallback:OrtEpLibrary.PluginEp_EpContextInference_NotImplemented — 4/4 passed). Left two minor non-blocking nitpicks inline.
Edward Chen (edgchen1)
left a comment
There was a problem hiding this comment.
Four nonblocking maintainability and documentation suggestions.
🤖 Written by GitHub Copilot on behalf of Edward Chen (@edgchen1).
Validate boolean options consistently, defer kernel registration until context creation succeeds, clarify restricted execution and companion availability, and remove redundant ignore exception. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Description
Add an opt-in executable external EPContext fixture for encrypted compiled-model binding tests.
ep.example.test_execute_ep_context=1emits and restores a versioned float32 Mul descriptor.NOT_IMPLEMENTEDinference behavior.This is the shared prerequisite for C# #33221, Java #33217, Python #33218, Node.js #33219, and Rust #33220. Their branches include this identical prerequisite commit so that each PR can target main and receive ordinary PR CI. Merge this prerequisite first; the shared diff then disappears from the language PRs.
Draft pending CI and review. Documentation describes the companion changes; Objective-C and React Native encrypted workflows are not implemented or verified.
Review follow-up
Added the prerequisite native executable-context regression and reject embedded executable contexts at compilation. Companion documentation is explicitly pending the respective binding PR merges. All branches also contain the shared generator import fix, native fixture regression, and qualified companion documentation.
Native validation:
onnxruntime_autoep_test.exe --gtest_filter=OrtEpLibrary.PluginEp_ExecutableExternalContextRoundTrip:OrtEpLibrary.PluginEp_GenEpContextModel_EmbedModeDoesNotUseCallbacks:OrtEpLibrary.PluginEp_LoadEpContextModel_ExternalDataUsesReadCallback:OrtEpLibrary.PluginEp_EpContextInference_NotImplemented— 4 passed, 0 skipped, using a rebuilt matching API31 test/plugin and cached runtime objects. Current API32 test source passed compiler syntax validation; latest-main CI is still pending.October 23 approved-review follow-up
Defer Mul kernel/compute-info registration until EPContext creation succeeds; clarify default versus restricted executable mode; consistently validate boolean options through a shared helper; remove the redundant ONNX ignore exception; describe companion availability without a stale pending heading.
Validation:
onnxruntime_autoep_test.exe --gtest_filter=OrtEpLibrary.PluginEp_BooleanConfigRejectsInvalidValues:OrtEpLibrary.PluginEp_ExecutableExternalContextRoundTrip:OrtEpLibrary.PluginEp_GenEpContextModel_EmbedModeDoesNotUseCallbacks:OrtEpLibrary.PluginEp_LoadEpContextModel_ExternalDataUsesReadCallback:OrtEpLibrary.PluginEp_EpContextInference_NotImplemented: 5 passed, zero skipped with rebuilt compatible API31 test/plugin and cached core objects. The new config test checks all seven boolean keys. Current API32 test source syntax check and standalone API32 plugin build also passed. Full API32 runtime execution awaits new-head CI.The shared fixture corrections are included on all six approved branches. git diff --check passed. Updated-head CI is pending; no old-head results are claimed for these changes.
Motivation and Context
Follow-up validation for #32265 and its merged language bindings. The old example provider could compile external context but could not execute a restored context, so ordinary encrypted CPU-model tests would not prove compiled-state loading.
Validation on Windows, using the newly built provider and a matching ONNX Runtime 1.31 runtime:
Result: 7 passed, zero skips. Run from the isolated native output directory.
git diff --checkpassed. Changed C++ formatting checks passed. Local behavioral validation used the pre-publication source; publication branches were cherry-picked onto current main without conflicts, but no full current-main runtime rebuild was performed.Not covered: production EP binary formats, external initializer encryption, Apple/mobile execution.