Skip to content
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

Remove duplicate optimization loop in level 3 PassManager #8785

Merged
merged 2 commits into from
Sep 24, 2022

Conversation

mtreinish
Copy link
Member

Summary

For some time (I expect since #6403 but maybe before) we've been running the optimization loop for optimization level 3 twice for no reason. This is clearly a mistake as it adds a single extra run of all the optimization passes since we've already reached a steady state in depth and size by this point. This is just a waste of time and was unintentional. This commit removes the unintended duplication.

Details and comments

For some time (I expect since Qiskit#6403 but maybe before) we've been running
the optimization loop for optimization level 3 twice for no reason. This
is clearly a mistake as it adds a single extra run of all the optimization
passes since we've already reached a steady state in depth and size by this
point. This is just a waste of time and was unintentional. This commit
removes the unintended duplication.
@mtreinish mtreinish added the Changelog: None Do not include in changelog label Sep 23, 2022
@mtreinish mtreinish added this to the 0.22 milestone Sep 23, 2022
@mtreinish mtreinish requested a review from a team as a code owner September 23, 2022 21:53
@qiskit-bot
Copy link
Collaborator

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:

  • @Qiskit/terra-core

@mtreinish
Copy link
Member Author

To see the difference you can look at the drawn pass manager. Before this PR the generated preset pass manager for level 3 is:

level3

After this PR the duplicate do while loop is removed:

level3_updated

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtreinish
Copy link
Member Author

Heh, well I wish I could claim this would substantial speed things up, in practice it just saves us a couple of dag iterations with no real work being done :)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3115861362

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.001%) to 84.395%

Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/preset_passmanagers/level3.py 1 91.79%
Totals Coverage Status
Change from base Build 3115540571: 0.001%
Covered Lines: 59344
Relevant Lines: 70317

💛 - Coveralls

@mergify mergify bot merged commit 09706be into Qiskit:main Sep 24, 2022
@mtreinish mtreinish deleted the remove-level3-duplicate-loop branch September 24, 2022 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants