-
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
Ensure we run VF2PostLayout when needed in optimization level 1 #9941
Ensure we run VF2PostLayout when needed in optimization level 1 #9941
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 4670573548
💛 - Coveralls |
This commit fixes an issue where we were incorrectly not running VF2PostLayout in the one case where it should be run. Optimization level 1 is more involved than higher optimization levels because for backwards compatibility it runs multiple different passes to try and find a perfect layout, first starting with TrivialLayout, then VF2Layout, and only if those 2 fail to find a perfect match do we run SabreLayout (or DenseLayout and StochasticSwap if control flow are present). We only should run VF2PostLayout if we're running the heuristic layout pass. However, when we integrated routing into SabreLayout the checking for whether we found a pefect layout in the layout stage stopped working as expected. To fix this issue a new flag is added to the CheckMap pass to specify an alternative property set field to store the results of the check in. The underlying issue was that the property set field between the earlier check that we found a perfect layout and the later check whether we should run a standalone routing pass. To fix this the new flag is used to spearate the results from the multiple CheckMap calls. and then we only condition the VF2PostLayout condition on the results of the perfect layout check and not the later routing check. Fixes Qiskit#9936
429d4b0
to
6071f05
Compare
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.
All the actual code looks good, there's just some issues in the tests where the comments about the assertions don't actually match the assertions.
Sigh, that's what I get for copy and pasting tests while I was in meetings. Let me remove those inaccurate comments. |
…it#9941) * Ensure we run VF2PostLayout when needed in optimization level 1 This commit fixes an issue where we were incorrectly not running VF2PostLayout in the one case where it should be run. Optimization level 1 is more involved than higher optimization levels because for backwards compatibility it runs multiple different passes to try and find a perfect layout, first starting with TrivialLayout, then VF2Layout, and only if those 2 fail to find a perfect match do we run SabreLayout (or DenseLayout and StochasticSwap if control flow are present). We only should run VF2PostLayout if we're running the heuristic layout pass. However, when we integrated routing into SabreLayout the checking for whether we found a pefect layout in the layout stage stopped working as expected. To fix this issue a new flag is added to the CheckMap pass to specify an alternative property set field to store the results of the check in. The underlying issue was that the property set field between the earlier check that we found a perfect layout and the later check whether we should run a standalone routing pass. To fix this the new flag is used to spearate the results from the multiple CheckMap calls. and then we only condition the VF2PostLayout condition on the results of the perfect layout check and not the later routing check. Fixes Qiskit#9936 * Fix remove out of date comments
…it#9941) * Ensure we run VF2PostLayout when needed in optimization level 1 This commit fixes an issue where we were incorrectly not running VF2PostLayout in the one case where it should be run. Optimization level 1 is more involved than higher optimization levels because for backwards compatibility it runs multiple different passes to try and find a perfect layout, first starting with TrivialLayout, then VF2Layout, and only if those 2 fail to find a perfect match do we run SabreLayout (or DenseLayout and StochasticSwap if control flow are present). We only should run VF2PostLayout if we're running the heuristic layout pass. However, when we integrated routing into SabreLayout the checking for whether we found a pefect layout in the layout stage stopped working as expected. To fix this issue a new flag is added to the CheckMap pass to specify an alternative property set field to store the results of the check in. The underlying issue was that the property set field between the earlier check that we found a perfect layout and the later check whether we should run a standalone routing pass. To fix this the new flag is used to spearate the results from the multiple CheckMap calls. and then we only condition the VF2PostLayout condition on the results of the perfect layout check and not the later routing check. Fixes Qiskit#9936 * Fix remove out of date comments
Summary
This commit fixes an issue where we were incorrectly not running
VF2PostLayout in the one case where it should be run. Optimization level
1 is more involved than higher optimization levels because for backwards
compatibility it runs multiple different passes to try and find a
perfect layout, first starting with TrivialLayout, then VF2Layout, and
only if those 2 fail to find a perfect match do we run SabreLayout (or
DenseLayout and StochasticSwap if control flow are present). We only
should run VF2PostLayout if we're running the heuristic layout pass.
However, when we integrated routing into SabreLayout the checking for
whether we found a pefect layout in the layout stage stopped working as
expected.
To fix this issue a new flag is added to the CheckMap pass to specify an
alternative property set field to store the results of the check in. The
underlying issue was that the property set field between the earlier
check that we found a perfect layout and the later check whether we
should run a standalone routing pass. To fix this the new flag is used
to separate the results from the multiple CheckMap calls. and then we
only condition the VF2PostLayout condition on the results of the perfect
layout check and not the later routing check.
Details and comments
Fixes #9936