-
Notifications
You must be signed in to change notification settings - Fork 174
QAT refactor #1131
QAT refactor #1131
Conversation
src/Passes/examples/QubitAllocationAnalysis/TeleportChain/TeleportChain.qs
Outdated
Show resolved
Hide resolved
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.
Overall this looks like nice clean up! Given that the code base is still heavily in flux and this goes into a feature branch, I'll approve it based on a quick read through to facilitate further work that builds on this cleaned up version. Once certain passes reach a more steady state we should do a more thorough review than I did.
| {"O1", "false"}, | ||
| {"O2", "false"}, | ||
| {"O3", "false"}, | ||
| {"verify-module", "false"}}}; |
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.
What exactly does verify-module do?
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.
It verifies the module (that the IR is valid) once the transformation was ran.
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.
Is this using built-in llvm infrastructure only or is there anything custom about it? I believe it is the former.
|
|
||
| microsoft_add_library(ProfilePass) | ||
| target_link_libraries(ProfilePass PRIVATE Rules) | ||
| # microsoft_add_library_tests(ProfilePass) |
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.
Why is this not enabled?
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.
We do not have any tests for this component yet aside from the running the examples. All the functionality that does the transformation is tested in the profiles test.
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.
Thanks for the explanation. I assume these are the tests that you wanted to add next week.
|
|
||
| if (instr1 == nullptr) | ||
| { | ||
| llvm::errs() << "; WARNING: cannot deal with non-instruction replacements\n"; |
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.
When would this case occur?
How does the tool deal with errors - what happens if the tool produces a warning (e.g. does it fail with a non-zero exit code), and what happens if it produces an error (is there a concept of an error or does it throw in that case)?
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 am not sure whether this will ever occur and whether this is even a relevant case to consider. The check is there as a sanity check and will be refactored once I've written a proper error/warning logger. I expect that this would be reported as an internal error.
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 agree with and like the idea of reporting it as an internal error.
Co-authored-by: bettinaheim <[email protected]>
Co-authored-by: bettinaheim <[email protected]>
Co-authored-by: bettinaheim <[email protected]>
Co-authored-by: bettinaheim <[email protected]>
QAT refactor
Previous versions of the QAT tool has been unable to correctly handle qubit allocations in following ways:
Additionally, previous also had following flaws:
This PR fixes these issues.
Dependencies
This PR has no dependencies.
Change log
Examples structure
One of the updates in this PR is a restructuring of examples allowing us to extend them with other frontends and with more examples. Each example can be ran as a test to ensure that the generated IR is valid and that no segfaults or exceptions happen during runtime.
All examples are kept in the
examplesfolder and each example contains subfolders for each of the frontends it supports. Currently, we have two examples:Example of the improved QAT
In addition to preserving the ability to transform the TeleportChain to the base profile, the new code deal with advanced logic that involves loops and recursion:
which after applying the profile
comes out as