-
Notifications
You must be signed in to change notification settings - Fork 53
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
Introduce OpSignature to IR #1838
base: main
Are you sure you want to change the base?
Conversation
@@ -259,7 +260,7 @@ | |||
@property | |||
def op_schema(self) -> Optional[onnx.defs.OpSchema]: ... | |||
|
|||
def param_schemas(self) -> Optional[tuple[ParamSchema, ...]]: ... | |||
def signature(self) -> Optional[_schemas.OpSignature]: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
Test Results 24 files ± 0 24 suites ±0 2h 44m 6s ⏱️ + 4m 1s For more details on these failures and errors, see this check. Results for commit ff1aaa5. ± Comparison against base commit fac4825. ♻️ This comment has been updated with latest results. |
@@ -0,0 +1,548 @@ | |||
# Copyright (c) Microsoft Corporation. |
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.
Should we put a comment saying this should align to torch _schema.py until we move it to here?
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.
Actually, we only have the test for this file, which means that torch's _schema.py should be following this one.
When the signature property is defined, PyTorch onnx exporter will not generate a new signature, and instead use what is here. However, since it is doing isinstance checks on the signature the exporter itself defines, we get isinstance errors there. |
Introduce OpSignature accessible from the
.signature
property of all OpLike objects (traced function, onnx function and op). The OpSignature class leverages the IR to represent the signature of an operator, preserving ordering of all inputs and provides easy to work with type representations.The PR also deprecates the ParamSchema class and properties.
Fixes #1697
The next PR will replace param_schemas usage.