-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
base: main
Are you sure you want to change the base?
Conversation
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>
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. |
@@ -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): |
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.
Optional: Test when function opset versions do not match?
Signed-off-by: gramalingam <grama@microsoft.com>
Signed-off-by: gramalingam <grama@microsoft.com>
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.