Skip to content
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

Optimize greedy rewrite passes #298

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

taalexander
Copy link
Collaborator

Optimize a number of greedy rewrite passes.

  • QUIRAngleConversionPass: Goes from about ~7.5s for 100x100 to 0.9s on my machine

@taalexander taalexander requested a review from a team as a code owner March 15, 2024 12:47
mbhealy
mbhealy previously approved these changes Mar 15, 2024
Copy link
Contributor

@mbhealy mbhealy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +104 to +106
config.strictMode = mlir::GreedyRewriteStrictness::ExistingOps;
// Each operation can only be modified once so limit
config.maxIterations = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of these two changes, which provides more benefit? I'm surprised that the first changes things at all since the rewrite pattern isn't adding any new operations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its maxIterations

Copy link
Contributor

@mbhealy mbhealy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@taalexander taalexander merged commit 239ea89 into openqasm:main Mar 15, 2024
3 checks passed
taalexander added a commit to taalexander/qe-compiler that referenced this pull request Mar 15, 2024
Optimize a number of greedy rewrite passes.
- QUIRAngleConversionPass: Goes from about ~7.5s for 100x100 to 0.9s on
my machine
taalexander added a commit that referenced this pull request Mar 16, 2024
Optimize a number of greedy rewrite passes.
- QUIRAngleConversionPass: Goes from about ~7.5s for 100x100 to 0.9s on
my machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants