-
Notifications
You must be signed in to change notification settings - Fork 72
[IR] Allow pass result as pass input #2220
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
Allow pass result as pass input so users can chain calls to multiple passes more easily Before: ```py result = pass1(model) result = pass(result.model) ``` Now it is also possible to do: ```py result = pass1(model) result = pass(result) ```
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.
Pull Request Overview
This pull request enables chaining passes by allowing a pass's result to be directly used as input for another pass. Key changes include:
- Updating the call method in _pass_infra.py to accept either an ir.Model or a PassResult.
- Adding tests in _pass_infra_test.py to verify that pass chaining works as expected.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
onnxscript/ir/passes/_pass_infra_test.py | Adds a new test to verify that PassResult instances can be used as inputs for passes. |
onnxscript/ir/passes/_pass_infra.py | Modifies the call method to accept a union of ir.Model and PassResult as input. |
❌ 16 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Allow pass result as pass input so users can chain calls to multiple passes more easily
Before:
Now it is also possible to do: