[python] Move kernel signature inference out of MLIR compilation#3930
[python] Move kernel signature inference out of MLIR compilation#3930lmondada merged 9 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Luca Mondada <luca@mondada.net>
|
EDIT: done
|
Signed-off-by: Luca Mondada <luca@mondada.net>
Signed-off-by: Luca Mondada <luca@mondada.net>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
khalatepradnya
left a comment
There was a problem hiding this comment.
Commit#1 looks good. One Q.
khalatepradnya
left a comment
There was a problem hiding this comment.
Commit#2 looks good to me.
One minor comment and request to extend tests.
khalatepradnya
left a comment
There was a problem hiding this comment.
Suggest moving commit# 3 in a separate PR.
taalexander
left a comment
There was a problem hiding this comment.
At a high-level this looks good to me. As I am unfamiliar I will leave to others to approve.
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Luca Mondada <luca@mondada.net>
This reverts commit 93666dd.
Signed-off-by: Luca Mondada <luca@mondada.net>
Signed-off-by: Luca Mondada <luca@mondada.net>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
khalatepradnya
left a comment
There was a problem hiding this comment.
LGTM. Thanks, @lmondada !
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
I've broken up this PR into two commits that can be reviewed independently:
The first commit contains "clean-ups". It doesn't introduce any new functionality nor should it change how anything is currently working. It just removes function arguments that aren't used, renames a couple of things and should make the code more readable. I'm including this here because it made my actual work much easier. These breaking changes are acceptable as they are within the
python/cudaq/kernelfolder, which is not publicly exposed (discussed with Bettina).The second commit is the real contribution:
python/cudaq/kernel/analysis.pyis extended to parse the function annotations. This can be run before MLIR compilationKernelSignatureis introduced to consolidate all kernel type information that was scattered across many attributes in one place.KernelSignaturenow only stores the kernel types as MLIR types (before, both Python and MLIR types were stored). This makes it easier to handle as there is a single source of truth (and Python types can be recovered usingmlirTypeToPyType)EDIT: Added a third commit that fixes issue #2895
I've noted that a lot of this Python code uses CamelCase, even though our style guide (Google style guide) recommends snake_case. I'm using snake_case where new names/variables are introduced, but limited the number of existing names that had to be changed.
closes #2895