8000 Extend function inliner to support schema-defined functions by gramalingam · Pull Request #6931 · onnx/onnx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Extend function inliner to support schema-defined functions #6931

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

gramalingam
Copy link
Contributor

Description

The previous version of inliner supported inlining only for model-local functions. This PR extends the support for schema-defined functions as well.

Motivation and Context

The increasing focus on extending the ONNX standard via new function-ops makes it useful for users to be able to inline these functions.

Signed-off-by: gramalingam <grama@microsoft.com>
Signed-off-by: gramalingam <grama@microsoft.com>
Signed-off-by: gramalingam <grama@microsoft.com>
Signed-off-by: gramalingam <grama@microsoft.com>
Signed-off-by: gramalingam <grama@microsoft.com>
Signed-off-by: gramalingam <grama@microsoft.com>
@gramalingam gramalingam requested review from a team as code owners April 28, 2025 18:46
@github-project-automation github-project-automation bot moved this to In progress in PR Tracker Apr 28, 2025
@gramalingam gramalingam added module: inliner topic: enhancement Request for new feature or operator labels Apr 28, 2025
@yuanyao-nv
Copy link
Contributor

I wonder if it would be useful for the inliner to also retain info about the original function in the expanded nodes. For example, this could be through incorporating additional ValueInfo in the nodes or by keeping the new nodes in a model-local function instead of the top-level graph?

@gramalingam
Copy link
Contributor Author

I wonder if it would be useful for the inliner to also retain info about the original function in the expanded nodes. For example, this could be through incorporating additional ValueInfo in the nodes or by keeping the new nodes in a model-local function instead of the top-level graph?

I did think if it would be useful to create a model-local function from the schema-function. I ended up doing the inlining as the simplest.

@github-project-automation github-project-automation bot moved this from In progress to Reviewer approved in PR Tracker May 13, 2025
@gramalingam gramalingam enabled auto-merge May 16, 2025 21:56
@@ -111,6 +112,22 @@ def test_selective_exclusion(self):
self.assertEqual(function_nodes[0].op_type, "Add")
self.assertEqual(function_nodes[1].op_type, "Mul")

def test_schema_function_inlining(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: Test when function opset versions do not match?

Signed-off-by: gramalingam <grama@microsoft.com>
Signed-off-by: gramalingam <grama@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: inliner topic: enhancement Request for new feature or operator
Projects
Status: Reviewer approved
Development

Successfully merging this pull request may close these issues.

4 participants
0