-
Notifications
You must be signed in to change notification settings - Fork 41
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
[WIP] Added loop boundary optimization pass #1476
base: main
Are you sure you want to change the base?
Conversation
mlir/lib/Quantum/Transforms/LoopBoundaryOptimizationPatterns.cpp
Outdated
Show resolved
Hide resolved
Hello. You may have forgotten to update the changelog!
|
Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com>
Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com>
Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com>
mlir/lib/Quantum/Transforms/LoopBoundaryOptimizationPatterns.cpp
Outdated
Show resolved
Hide resolved
mlir/lib/Quantum/Transforms/LoopBoundaryOptimizationPatterns.cpp
Outdated
Show resolved
Hide resolved
Improve the code dynamic
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.
Nice work so far! I left a few comments regarding the foundations of the pass, but since it's still a work in progress I didn't look at the code too closely yet :)
mlir/lib/Quantum/Transforms/LoopBoundaryOptimizationPatterns.cpp
Outdated
Show resolved
Hide resolved
mlir/lib/Quantum/Transforms/LoopBoundaryOptimizationPatterns.cpp
Outdated
Show resolved
Hide resolved
#define GEN_PASS_DECL_LOOPBOUNDARYOPTIMIZATIONPASS | ||
#include "Quantum/Transforms/Passes.h.inc" | ||
|
||
struct LoopBoundaryOptimizationPass |
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.
This doesn't have to be solved now, but I do think in the future we'll want a single pass that applies many quantum peephole optimizations, similarly to the canonicalize pass in MLIR. That way, we can actually make use of the fixed-point greedy pattern applicator, taking advantage of one peephole optimization enabling another.
Remember to link to the shortcut story! You can see how this is done on other PRs :D |
Of course, will do. Thanks Paul! |
Integrate with merge rotation and cancel inverse Improve code dynamic
Add new tests
Context:
The Loop Boundary Optimization identifies and optimizes redundant quantum operations that occur at loop iteration boundaries, where operations at iteration boundaries often cancel each other out.
This method is standalone pass but also integrated in merge rotation and cancel inverses pass.
It specifically targets:
Description of the Change:
merge_rotation
andcancel_inverses
passBenefits:
Limited Scope
Possible Drawbacks:
[sc-83037]