Revert "Port star_preroute to rust"#14381
Merged
Merged
Conversation
This commit reverts the move of star prerouting to run in Rust. At the time of this commit it was before the majority of the transpiler infrastructure was ported to rust. At that time the pass was ported we had a few one off passes that were ported to rust and we had to manage the Python rust boundary carefully. The pattern was typically to define custom rust data types that provided an alternate view of the DAGCircuit and the target for compilation that was built out of the Python space dag and target. The star prerouting pass was ported to Rust and leveraged the existing infrastructure used by SabreSwap and SabreLayout as the function of the pass on a DAG was very similar to Sabre (finding where to insert swaps and rebuilding the dag where swaps are needed). At the time this was a pragmatic choice to accelerate the pass and not need to wait for the needed infrastructure to be written in Rust. However in practice the performance gains the Rust porting of the algorithm provided were not as large as was originally hoped and now the code of the pass is tied directly to the current implementation of sabre. As the sabre interface layer is being re-written in Qiskit#14317 this is proving to be a blocker for that effort. This commit reverts the current rust implementation to unblock the sabre refactoring effort. It's still definitely worth porting this pass to Rust but we now have sufficient infrastructure in Rust to write full transpiler passes without Python. We should follow up this PR and rewrite the star prerouting pass so that full pass operates completely in rust and directly leverages the native data structures that exist in Rust now instead of the hybrid approach that ties the is tightly coupled to the internals of the sabre pass. This reverts commit b23c545.
Collaborator
|
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 15066436418Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
jakelishman
approved these changes
May 16, 2025
jakelishman
left a comment
Member
There was a problem hiding this comment.
Thanks for taking care that the new test added by the patch still passes as well.
12 tasks
rahaman-quantum
pushed a commit
to rahaman-quantum/qiskit
that referenced
this pull request
Jun 20, 2025
* Revert "Port star_preroute to rust" This commit reverts the move of star prerouting to run in Rust. At the time of this commit it was before the majority of the transpiler infrastructure was ported to rust. At that time the pass was ported we had a few one off passes that were ported to rust and we had to manage the Python rust boundary carefully. The pattern was typically to define custom rust data types that provided an alternate view of the DAGCircuit and the target for compilation that was built out of the Python space dag and target. The star prerouting pass was ported to Rust and leveraged the existing infrastructure used by SabreSwap and SabreLayout as the function of the pass on a DAG was very similar to Sabre (finding where to insert swaps and rebuilding the dag where swaps are needed). At the time this was a pragmatic choice to accelerate the pass and not need to wait for the needed infrastructure to be written in Rust. However in practice the performance gains the Rust porting of the algorithm provided were not as large as was originally hoped and now the code of the pass is tied directly to the current implementation of sabre. As the sabre interface layer is being re-written in Qiskit#14317 this is proving to be a blocker for that effort. This commit reverts the current rust implementation to unblock the sabre refactoring effort. It's still definitely worth porting this pass to Rust but we now have sufficient infrastructure in Rust to write full transpiler passes without Python. We should follow up this PR and rewrite the star prerouting pass so that full pass operates completely in rust and directly leverages the native data structures that exist in Rust now instead of the hybrid approach that ties the is tightly coupled to the internals of the sabre pass. This reverts commit b23c545. * Add back reverted alt text for plot in docs
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This commit reverts the move of star prerouting to run in Rust. At the time of this commit it was before the majority of the transpiler infrastructure was ported to rust. At that time the pass was ported we had a few one off passes that were ported to rust and we had to manage the Python rust boundary carefully. The pattern was typically to define custom rust data types that provided an alternate view of the DAGCircuit and the target for compilation that was built out of the Python space dag and target. The star prerouting pass was ported to Rust and leveraged the existing infrastructure used by SabreSwap and SabreLayout as the function of the pass on a DAG was very similar to Sabre (finding where to insert swaps and rebuilding the dag where swaps are needed). At the time this was a pragmatic choice to accelerate the pass and not need to wait for the needed infrastructure to be written in Rust. However in practice the performance gains the Rust porting of the algorithm provided were not as large as was originally hoped and now the code of the pass is tied directly to the current implementation of sabre. As the sabre interface layer is being re-written in #14317 this is proving to be a blocker for that effort. This commit reverts the current rust implementation to unblock the sabre refactoring effort.
It's still definitely worth porting this pass to Rust but we now have sufficient infrastructure in Rust to write full transpiler passes without Python. We should follow up this PR and rewrite the star prerouting pass so that full pass operates completely in rust and directly leverages the native data structures that exist in Rust now instead of the hybrid approach that ties the is tightly coupled to the internals of the sabre pass.
Details and comments
This reverts commit b23c545.