-
-
Notifications
You must be signed in to change notification settings - Fork 44
🚧 MLIR | Implement QMAP Algorithm #1237
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
Draft
MatthiasReumann
wants to merge
18
commits into
main
Choose a base branch
from
enh/mlir-a-star-routing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+1,189
−312
Conversation
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
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Description
This pull requests adds the MLIRized QMAP algorithm to the routing pass. A sub-goal of this pull request is to improve and simplify the existing implementation for performance and maintainability. The name of this "enhanced" QMAP algorithm isn't determined yet.
Noteworthy Changes
Router
: A router now is simply a (configurable) combination of aLayerizer
and aPlanner
.RoutingContext
has been removed and all member variables have been moved to the router implementation. This way, I think, we should be able to use this router also for layout-ing (To be shown).ThinLayout
andLayout
: The search nodes in the QMAP algorithm don't have to care about SSA values. Hence I added a new data structure, theThinLayout
, that simply maps program indices to hardware indices. The oldLayout
now inherits from thisThinLayout
(Essentially aLayout
is a fatThinLayout
). This way we can simply pass aLayout
asThinLayout
and reduce the memory footprint of nodes.nadd
which counts the number of SWAPs added. Using statistics, we can also quite easily track the amount of milliseconds / seconds the routing took and print it via the-mlir-pass-statistics
flag.Algorithmic Changes:
Instead of computing all layers at startup, layers are computed on-demand. Moreover, the algorithm simply "steps over" already executable gates and doesn't include them in a layer (which to my knowledge the previous algorithm didn't). In other words, a layer always starts with a non-executable gate and crawls its way forward.
The (updated) cost function is
where$$n_{swaps}$$ is the number of swaps added, $$n_{depth}$$ is the additional "circuit" depth added by the swaps, and $$D$$ is the nearest neighbor length between $$g.q1$$ and $$g.q2$$ .
Checklist: