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.
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
Add support for custom backend transpiler stages #8648
Add support for custom backend transpiler stages #8648
Changes from 6 commits
77d717f
061ebc4
d7c479d
5eae0ee
caa9c49
69e5b25
cf6a7ec
b845ac3
3870356
ccbbe55
e7b2e8b
f8e8fde
bb45d9d
d004080
214d9f7
4eb107b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Are we planning to add a different interface for passes that are suggested but not required? For example,
ResetAfterMeasureSimplification
is (presumably) never required, but for certain backends, it's a generally good idea.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.
I guess required is probably too strong a word. I was trying to reinforce here that these passes will be run by default for every
transpile()
call so only use it for things you want to be run all the time. My intent was for something likeResetAfterMeasureSimplification
to be usable inpost-translation
which is why I put it in the example. For the appropriate backend it's an easy optimization that improves the fidelity, but that is a backend specific thing and only the backend object will have sufficient context to know whether it's a good idea or not. It's not something we can cleanly express via the target (which is the point of having this interface).But, writing this I just realize that I think we should add an optimization level kwarg to the hook method. Because, I realize to really support using
ResetAfterMeasureSimplification
we want to not inject that into the pipeline for level 0. So giving backends the context of which optimization level the pass will enable doing this and potential tweak the custom stages in a similar way for higher optimization levels.