-
Notifications
You must be signed in to change notification settings - Fork 72
[pass] Create check to ensure in-place passes are actually inplace #2192
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
Conversation
❌ 24 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
onnxscript/ir/passes/_pass_infra.py:141
- [nitpick] Consider appending debug information (e.g., using id(model) and id(result.model)) to the error message to help diagnose discrepancies in object identity.
if self.in_place and result.model is not model:
onnxscript/ir/passes/_pass_infra.py:147
- [nitpick] Consider appending debug information (e.g., using id(model) and id(result.model)) to the error message, which would aid in diagnosing cases where a non in-place pass inadvertently returns the input object.
if not self.in_place and result.model is model:
This pull request introduces validation to ensure the in-place property of a pass is respected.
Validation of in-place property:
onnxscript/ir/passes/_pass_infra.py
: Added checks to ensure that if a pass is declared in-place, the returned model must be the same object as the input model, and if not in-place, the returned model must be a different object. RaisesPassError
if these conditions are not met.