Repository navigation
Adopt model editor custom ops - #34149
Open
Yateng Hong (toothache) wants to merge 2 commits into
Open
Yateng Hong (toothache) wants to merge 2 commits into
Yateng Hong (toothache) wants to merge 2 commits into
Conversation
Register session-option custom op domains before loading the model and add regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3959277e-1e1b-43f1-ae06-15c5f6b97d76
Rename the test operator to CustomOpOne and inline its compute function as a captureless lambda. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3959277e-1e1b-43f1-ae06-15c5f6b97d76
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the custom operator support change.
No open issues 🎉
What changed in this PR
Adds custom operator support to sessions created through the Model Editor C API, using domains registered in SessionOptions.
Changes:
- Registers custom operator domains before loading the model.
- Adds a regression test covering failure without registration and successful inference with a registered custom operator.
| File | Description |
|---|---|
onnxruntime/test/shared_lib/test_model_builder_api.cc |
Adds CustomOpSession coverage for custom operator registration and inference. |
onnxruntime/core/session/model_editor_c_api.cc |
Registers supplied custom operator domains before model loading. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for registering and using custom operator domains when creating sessions from models in the Model Editor C API. It also introduces a new test to verify this functionality.
Custom Operator Domain Support:
CreateSessionFromModel(inmodel_editor_c_api.cc) to register custom operator domains fromSessionOptionsbefore loading the model, ensuring custom ops are available during session creation.Testing Enhancements:
CustomOpSessiontest intest_model_builder_api.ccto validate that sessions with custom operators can be created and used for inference, including both negative and positive test cases.### DescriptionMotivation and Context