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

Switch default routing/layout method to sabre for opt level 3 #7205

Merged
merged 4 commits into from
Nov 20, 2021

Conversation

mtreinish
Copy link
Member

Summary

This commit switches the default routing and layout method for
optimization level 3 to use SabreSwap and SabreLayout passes. The
quality of results is typically better with sabre than the default
stochastic swap and dense layout we're using now. For optimization
level 3 where we try to produce the best quality result and runtime
is of secondary concern using sabre makes the most sense (especially
after #7036 which improves the runtime performance). Also for
optimization level 3 currently sabre is typically faster because we
increase the number of trials for stochastic swap (which is generally
significantly faster) which slows it down as it's doing more work.
This should improve the quality and speed of the results in general
when running with optimization level 3. In the future we can do more
work to improve the runtime performance of the sabre passes and
hopefully make it fast enough to use for all the optimization levels
which have more constraints on the run time performance than level 3.

Details and comments

Related to #7112 and #7200

@mtreinish mtreinish added on hold Can not fix yet Changelog: API Change Include in the "Changed" section of the changelog labels Nov 1, 2021
@mtreinish mtreinish added this to the 0.19 milestone Nov 1, 2021
@mtreinish mtreinish requested a review from a team as a code owner November 1, 2021 17:03
@mtreinish
Copy link
Member Author

Marking as on hold until #7036 merges because I don't think we want to do this without having that performance improvement

This commit switches the default routing and layout method for
optimization level 3 to use SabreSwap and Sabre layout passes. The
quality of results is typically better with sabre than the default
stochastic swap and dense layout we're using now. For optimization
level 3 where we try to produce the best quality result and runtime
is of secondary concern using sabre makes the most sense (especially
after Qiskit#7036 which improves the runtime performance). Also for
optimization level 3 currently sabre is typically faster because we
increase the number of trials for stochastic swap (which is generally
significantly faster) which slows it down as it's doing more work.
This should improve the quality and speed of the results in general
when running with optimization level 3. In the future we can do more
work to improve the runtime performance of the sabre passes and
hopefully make it fast enough to use for all the optimization levels
which have more constraints on the run time performance than level 3.

Related to Qiskit#7112 and Qiskit#7200
@mtreinish
Copy link
Member Author

@mtreinish mtreinish removed the on hold Can not fix yet label Nov 1, 2021
@mtreinish mtreinish added the on hold Can not fix yet label Nov 1, 2021
@jakelishman jakelishman self-assigned this Nov 16, 2021
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.

This is just a straightforwards swap - doesn't look like anything should go wrong, since we're already testing Sabre significantly. I'll look at #7036 as well.

@coveralls
Copy link

coveralls commented Nov 18, 2021

Pull Request Test Coverage Report for Build 1483085405

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.007%) to 82.557%

Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/preset_passmanagers/level3.py 2 91.98%
Totals Coverage Status
Change from base Build 1483075115: 0.007%
Covered Lines: 49879
Relevant Lines: 60418

💛 - Coveralls

@mtreinish mtreinish added automerge and removed on hold Can not fix yet labels Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: API Change Include in the "Changed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants