-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch default routing/layout method to sabre for opt level 3
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 #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 #7112 and #7200
- Loading branch information
Showing
3 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
releasenotes/notes/sabre-opt-lvl3-default-550924470d683112.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
upgrade: | ||
- | | ||
The default routing pass and layout pass for optimization level 3 has | ||
changed to use :class:`~qiskit.transpiler.passes.SabreSwap` and | ||
:class:`~qiskit.transpiler.passes.SabreLayout` respectively. This | ||
was done to improve the quality of the output result as using the sabre | ||
passes produces better results than using | ||
:class:`~qiskit.transpiler.passes.StochasticSwap` and | ||
:class:`~qiskit.transpiler.passes.DenseLayout` which were used as the | ||
defaults in prior releases. This change will improve the quality of the | ||
results when running :func:`~qiskit.compiler.transpile` or | ||
:func:`~qiskit.execute_function.execute` functions with the | ||
``optimization_level`` kwarg set to ``3``. While this is generally an | ||
improvement if you need to retain the previous behavior for any reason | ||
you can do this by explicitly setting the ``routing_method="stochastic"`` | ||
and ``layout_method="dense"`` when calling | ||
:func:`~qiskit.compiler.transpile` with ``optimization_level=3``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters