-
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
Convert BIPMaping
transpiler pass into an external plugin
#8662
Labels
Comments
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
Dec 7, 2022
This commit updates all the layout and routing passes which leverage hardware constraints to have a new optional keyword argument, target, to specify a Target object for modelling the constraints of the target backend. This option will superscede any other specified arguments for backend constraints. For most of these passes the target argument is just internally leveraged to build a CouplingMap (and in 2 cases a BackendProperties) as most of the algorithms don't need more than the global connectivity graph and there is minimal overhead to convert from a target to a CouplingMap. The 2 passes which take backend properties should be refactored to work natively with the target because the conversion adds extra overhead which isn't needed, but in those cases the passes aren't enabled by default (or are slated to be moved out of tree as a plugin, see Qiskit#8662) so the extra overhead isn't of particular concern. This is part of the first step towards making all backend constraints for the transpiler used the Target internally (see Qiskit#9256). Once all passes that take hardware constraints parameters as an input are updated to have a target we can start internally using the Target only for all preset pass manager construction and start the long process of deprecating the legacy interface in these passes. Related to Qiskit#9256
jakelishman
pushed a commit
that referenced
this issue
Apr 6, 2023
* Make all Layout and Routing passes target aware This commit updates all the layout and routing passes which leverage hardware constraints to have a new optional keyword argument, target, to specify a Target object for modelling the constraints of the target backend. This option will superscede any other specified arguments for backend constraints. For most of these passes the target argument is just internally leveraged to build a CouplingMap (and in 2 cases a BackendProperties) as most of the algorithms don't need more than the global connectivity graph and there is minimal overhead to convert from a target to a CouplingMap. The 2 passes which take backend properties should be refactored to work natively with the target because the conversion adds extra overhead which isn't needed, but in those cases the passes aren't enabled by default (or are slated to be moved out of tree as a plugin, see #8662) so the extra overhead isn't of particular concern. This is part of the first step towards making all backend constraints for the transpiler used the Target internally (see #9256). Once all passes that take hardware constraints parameters as an input are updated to have a target we can start internally using the Target only for all preset pass manager construction and start the long process of deprecating the legacy interface in these passes. Related to #9256 * Update pass manager drawer reference dot files The pass manager drawer tests were comparing the dot output for statically built pass managers to test that the output visualization is generated correctly. However, the new arguments for the taget are changing the visualization (to show the new option) and caused these tests to fail. This commit updates the reference images to include the new argument. * Fix lint * Optimize CheckMap This commit optimizes the logic of the CheckMap pass. Previously we were unecessarily creating a distance matrix from the coupling graph, and with a target unecessarily creating a CouplingMap object. Instead of doing this instead the pass now creates a list of bidirectional edges for adjacent nodes in the coupling graph and then a set lookup is done for each check instead of checking for a distance of 1 in the distance matrix. * Fix test failures * Update qiskit/transpiler/passes/layout/full_ancilla_allocation.py * Add test coverage for passes not run in preset pass managers * Fix lint * Fix reference dot for new preset pass managers * Rework arguments to take CouplingMap or Target This commit updates the pass constructors to use a single positional argument for both the coupling map or a target. This replaces the previous behavior where a new keyword argument was added to pass in the target. The exception to this is passes where the target was used differently than the coupling map for extra functionality. * Expand test coverage * Small typo fixes from review * Fix lint and test failure * Update qiskit/transpiler/preset_passmanagers/level0.py Co-authored-by: Ali Javadi-Abhari <[email protected]> * Update logic to favor target in all optimization levels In an earlier commit we updated the logic in optimization level 0 to favor target instead of a coupling map. But, that ignored the other optimization levels. This commit corrects this oversight and adds the same logically change to all the preset pass managers. * Update release note for api changes in earlier iterations * Update docstrings * Use a single positional argument for embed pm function --------- Co-authored-by: Ali Javadi-Abhari <[email protected]>
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
Apr 6, 2023
This commit deprecates the BIPMapping transpiler pass. Since its introduction the pass has been in a weird state since it's introduction. It is a standalone transpiler pass that we never integrated it into transpile() because it has an external dependency on cplex which is a proprietary software package that most people don't have access too. With the introduction of the transpiler stage plugin interface the pass has been turned into an external package: https://github.com/qiskit-community/qiskit-bip-mapper By using the plugin interface the pass can now be cleanly integrates into the transpile() function and also makes the requirement to have cplex installed much more explicit. For users with cplex it's much easier to run the BIPMapping pass as part of a transpilation workflow with `transpile(..., routing_method="bip")`. Closes Qiskit#8662
mtreinish
added a commit
to mtreinish/qiskit-core
that referenced
this issue
Apr 6, 2023
This commit deprecates the BIPMapping transpiler pass. Since its introduction the pass has been in a weird state since it's introduction. It is a standalone transpiler pass that we never integrated it into transpile() because it has an external dependency on cplex which is a proprietary software package that most people don't have access too. With the introduction of the transpiler stage plugin interface the pass has been turned into an external package: https://github.com/qiskit-community/qiskit-bip-mapper By using the plugin interface the pass can now be cleanly integrates into the transpile() function and also makes the requirement to have cplex installed much more explicit. For users with cplex it's much easier to run the BIPMapping pass as part of a transpilation workflow with `transpile(..., routing_method="bip")`. Closes Qiskit#8662
giacomoRanieri
pushed a commit
to giacomoRanieri/qiskit-terra
that referenced
this issue
Apr 16, 2023
* Make all Layout and Routing passes target aware This commit updates all the layout and routing passes which leverage hardware constraints to have a new optional keyword argument, target, to specify a Target object for modelling the constraints of the target backend. This option will superscede any other specified arguments for backend constraints. For most of these passes the target argument is just internally leveraged to build a CouplingMap (and in 2 cases a BackendProperties) as most of the algorithms don't need more than the global connectivity graph and there is minimal overhead to convert from a target to a CouplingMap. The 2 passes which take backend properties should be refactored to work natively with the target because the conversion adds extra overhead which isn't needed, but in those cases the passes aren't enabled by default (or are slated to be moved out of tree as a plugin, see Qiskit#8662) so the extra overhead isn't of particular concern. This is part of the first step towards making all backend constraints for the transpiler used the Target internally (see Qiskit#9256). Once all passes that take hardware constraints parameters as an input are updated to have a target we can start internally using the Target only for all preset pass manager construction and start the long process of deprecating the legacy interface in these passes. Related to Qiskit#9256 * Update pass manager drawer reference dot files The pass manager drawer tests were comparing the dot output for statically built pass managers to test that the output visualization is generated correctly. However, the new arguments for the taget are changing the visualization (to show the new option) and caused these tests to fail. This commit updates the reference images to include the new argument. * Fix lint * Optimize CheckMap This commit optimizes the logic of the CheckMap pass. Previously we were unecessarily creating a distance matrix from the coupling graph, and with a target unecessarily creating a CouplingMap object. Instead of doing this instead the pass now creates a list of bidirectional edges for adjacent nodes in the coupling graph and then a set lookup is done for each check instead of checking for a distance of 1 in the distance matrix. * Fix test failures * Update qiskit/transpiler/passes/layout/full_ancilla_allocation.py * Add test coverage for passes not run in preset pass managers * Fix lint * Fix reference dot for new preset pass managers * Rework arguments to take CouplingMap or Target This commit updates the pass constructors to use a single positional argument for both the coupling map or a target. This replaces the previous behavior where a new keyword argument was added to pass in the target. The exception to this is passes where the target was used differently than the coupling map for extra functionality. * Expand test coverage * Small typo fixes from review * Fix lint and test failure * Update qiskit/transpiler/preset_passmanagers/level0.py Co-authored-by: Ali Javadi-Abhari <[email protected]> * Update logic to favor target in all optimization levels In an earlier commit we updated the logic in optimization level 0 to favor target instead of a coupling map. But, that ignored the other optimization levels. This commit corrects this oversight and adds the same logically change to all the preset pass managers. * Update release note for api changes in earlier iterations * Update docstrings * Use a single positional argument for embed pm function --------- Co-authored-by: Ali Javadi-Abhari <[email protected]>
giacomoRanieri
pushed a commit
to giacomoRanieri/qiskit-terra
that referenced
this issue
Apr 16, 2023
…iskit#9924) * Deprecate the BIPMapping transpiler pass in favor of external plugin This commit deprecates the BIPMapping transpiler pass. Since its introduction the pass has been in a weird state since it's introduction. It is a standalone transpiler pass that we never integrated it into transpile() because it has an external dependency on cplex which is a proprietary software package that most people don't have access too. With the introduction of the transpiler stage plugin interface the pass has been turned into an external package: https://github.com/qiskit-community/qiskit-bip-mapper By using the plugin interface the pass can now be cleanly integrates into the transpile() function and also makes the requirement to have cplex installed much more explicit. For users with cplex it's much easier to run the BIPMapping pass as part of a transpilation workflow with `transpile(..., routing_method="bip")`. Closes Qiskit#8662 * Catch deprecation warnings in tests * Fix lint
king-p3nguin
pushed a commit
to king-p3nguin/qiskit-terra
that referenced
this issue
May 22, 2023
* Make all Layout and Routing passes target aware This commit updates all the layout and routing passes which leverage hardware constraints to have a new optional keyword argument, target, to specify a Target object for modelling the constraints of the target backend. This option will superscede any other specified arguments for backend constraints. For most of these passes the target argument is just internally leveraged to build a CouplingMap (and in 2 cases a BackendProperties) as most of the algorithms don't need more than the global connectivity graph and there is minimal overhead to convert from a target to a CouplingMap. The 2 passes which take backend properties should be refactored to work natively with the target because the conversion adds extra overhead which isn't needed, but in those cases the passes aren't enabled by default (or are slated to be moved out of tree as a plugin, see Qiskit#8662) so the extra overhead isn't of particular concern. This is part of the first step towards making all backend constraints for the transpiler used the Target internally (see Qiskit#9256). Once all passes that take hardware constraints parameters as an input are updated to have a target we can start internally using the Target only for all preset pass manager construction and start the long process of deprecating the legacy interface in these passes. Related to Qiskit#9256 * Update pass manager drawer reference dot files The pass manager drawer tests were comparing the dot output for statically built pass managers to test that the output visualization is generated correctly. However, the new arguments for the taget are changing the visualization (to show the new option) and caused these tests to fail. This commit updates the reference images to include the new argument. * Fix lint * Optimize CheckMap This commit optimizes the logic of the CheckMap pass. Previously we were unecessarily creating a distance matrix from the coupling graph, and with a target unecessarily creating a CouplingMap object. Instead of doing this instead the pass now creates a list of bidirectional edges for adjacent nodes in the coupling graph and then a set lookup is done for each check instead of checking for a distance of 1 in the distance matrix. * Fix test failures * Update qiskit/transpiler/passes/layout/full_ancilla_allocation.py * Add test coverage for passes not run in preset pass managers * Fix lint * Fix reference dot for new preset pass managers * Rework arguments to take CouplingMap or Target This commit updates the pass constructors to use a single positional argument for both the coupling map or a target. This replaces the previous behavior where a new keyword argument was added to pass in the target. The exception to this is passes where the target was used differently than the coupling map for extra functionality. * Expand test coverage * Small typo fixes from review * Fix lint and test failure * Update qiskit/transpiler/preset_passmanagers/level0.py Co-authored-by: Ali Javadi-Abhari <[email protected]> * Update logic to favor target in all optimization levels In an earlier commit we updated the logic in optimization level 0 to favor target instead of a coupling map. But, that ignored the other optimization levels. This commit corrects this oversight and adds the same logically change to all the preset pass managers. * Update release note for api changes in earlier iterations * Update docstrings * Use a single positional argument for embed pm function --------- Co-authored-by: Ali Javadi-Abhari <[email protected]>
king-p3nguin
pushed a commit
to king-p3nguin/qiskit-terra
that referenced
this issue
May 22, 2023
…iskit#9924) * Deprecate the BIPMapping transpiler pass in favor of external plugin This commit deprecates the BIPMapping transpiler pass. Since its introduction the pass has been in a weird state since it's introduction. It is a standalone transpiler pass that we never integrated it into transpile() because it has an external dependency on cplex which is a proprietary software package that most people don't have access too. With the introduction of the transpiler stage plugin interface the pass has been turned into an external package: https://github.com/qiskit-community/qiskit-bip-mapper By using the plugin interface the pass can now be cleanly integrates into the transpile() function and also makes the requirement to have cplex installed much more explicit. For users with cplex it's much easier to run the BIPMapping pass as part of a transpilation workflow with `transpile(..., routing_method="bip")`. Closes Qiskit#8662 * Catch deprecation warnings in tests * Fix lint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What should we add?
The
BIPMapping
transpiler pass has been in a weird state since it's introduction. It is a standalone transpiler pass that is used for both the layout and routing stage but we never integrated it intotranspile
because it has an external dependency oncplex
which is a proprietary software package that most people don't have access too.. Now that we've added an external plugin interface for transpiler stages (which was added in #8305) we have a better option for how to advertise and use theBipMapping
pass. We can create an external package for the pass that contains the code of the transpiler pass and offers a plugin that cleanly integrates into thetranspile()
function. Basically the workflow for using the bip mapper would change to bepip install qiskit-bip-mapper
(or whatever the package name we pick is) and then doingtranspile(qc, backend, layout_method="bip_mapping")
. This make it easier for users to run and also separates the dependency on cplex into a separate package where we can more cleanly document the extra requirements around installing and/or purchasing a commercial license depending on the size of the circuits.Steps:
BipMapping
passBIPMapping
pass in qiskit-terra after release of pThe text was updated successfully, but these errors were encountered: