-
Notifications
You must be signed in to change notification settings - Fork 40
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
[MLIR + Frontend] Quantum Module Abstraction #1144
Conversation
3bc3bd4
to
6acdf4d
Compare
009342d
to
845e927
Compare
845e927
to
1f41812
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1144 +/- ##
==========================================
+ Coverage 97.86% 97.89% +0.03%
==========================================
Files 76 76
Lines 10819 10888 +69
Branches 1283 1290 +7
==========================================
+ Hits 10588 10659 +71
+ Misses 179 178 -1
+ Partials 52 51 -1 ☔ View full report in Codecov by Sentry. |
2979c40
to
a9e0c6b
Compare
a9e0c6b
to
97f4771
Compare
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 💯 I left some suggestions regarding the frontend which relate to a lot of your Todos as well I think :)
Thanks! 🥇 An unrelated comment: once this qnode module scope is in place I'd like to utilize it and convert how we schedule passes in |
Co-authored-by: David Ittah <[email protected]>
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 💯 I'm happy to approve pending resolution of the open comments :)
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.
🦝 🚀 🌔
**Context:** We create nested modules for qnodes that contain all the program for a specific qnode. This will allow us to perform transformations targetting specific qnodes. **Description of the Change:** * Adds `catalyst.launch_kernel` that can call functions in nested modules. * Adds pass to keep previous behaviour by: * determining the name of a function given a scope * renaming all functions in nested modules to be unique * creating a map from flat symbol names to symbol names with path * inlining nested modules * transforming `catalyst.launch_kernel` to `func.call` **Benefits:** Nothing is currently using this pass / abstraction. But now we have the scaffolding for qnode specific transformations and lowerings. **Possible Drawbacks:** More compilation time. Nested nested qnodes semantics are still needed. It was opted to disable tests with nested qnodes as they are not fully supported. Only nested qnodes where no qnode execution overlap was supported previously, but this is not the general case and could easily lead to runtime errors. **Related GitHub Issues:** [sc-67095] --------- Co-authored-by: David Ittah <[email protected]>
Context: We create nested modules for qnodes that contain all the program for a specific qnode. This will allow us to perform transformations targetting specific qnodes.
Description of the Change:
catalyst.launch_kernel
that can call functions in nested modules.catalyst.launch_kernel
tofunc.call
Benefits:
Nothing is currently using this pass / abstraction. But now we have the scaffolding for qnode specific transformations and lowerings.
Possible Drawbacks: More compilation time. Nested nested qnodes semantics are still needed. It was opted to disable tests with nested qnodes as they are not fully supported. Only nested qnodes where no qnode execution overlap was supported previously, but this is not the general case and could easily lead to runtime errors.
Related GitHub Issues:
TODO (minor changes):
func_p
?[sc-67095]