-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Optimization stage as a plugin. #10581
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5825260943
💛 - Coveralls |
I think we should hold on this until #10621 merges. Then we can update the plugin construction to just call the plugin instead of needing the more involved logic. |
This commit changes the plugin construction logic slightly to adjust how the embedded translation stage is created. After Qiskit#10621 merged we only need to use the plugin interface to get the translation stage pass manager.
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.
This looks fine to me.
if optimization_level == 3: | ||
optimization.append(_minimum_point_check) | ||
else: | ||
optimization.append(_depth_check + _size_check) |
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.
Pre-existing, but I don't remember why we don't use the same check at all optimisation levels; there doesn't appear to be any discussion in #9612, but I know we talked about it more offline.
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.
It's a runtime thing. MinimumPoint
adds a lot of overhead for the deep copying on potentially each iteration to do the rollback. We only added it to O3 in #9612 because the real need for the pass was coming from the numeric precision in UnitarySynthesis
with the 2 qubit optimization causing the instability. For the optimizations we do in level 1 and 2 they're more stable (at least currently) and doing the fixed point comparison was reliable and significantly faster.
* Initial: Optimization stage as a plugin. * CI: Added fix to preset_passmanager test * Simplify inner translation stage creation logic This commit changes the plugin construction logic slightly to adjust how the embedded translation stage is created. After Qiskit#10621 merged we only need to use the plugin interface to get the translation stage pass manager. * Update documentation --------- Co-authored-by: Matthew Treinish <[email protected]>
Summary
Fixes #9457.
These commits aim to add the Optimization stage of transpile as a PassManager plugin, with the purpose of re-packaging current transpilation stages to work the same way external plugins do.
Details and comments