-
Notifications
You must be signed in to change notification settings - Fork 603
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
[Compiler] Integrate with Catalyst Frontend #4692
Conversation
Hello. You may have forgotten to update the changelog!
|
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 @maliasadi, I just left some quick 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.
Thanks @maliasadi, I like this entry point design! I do have some concerns though:
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 @maliasadi! I think I mostly have the same comments as @dime10, so once addressed this should be good to go 👍
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.
Some small comments, great PR 👍
…e. Add the AvailableCompilers dataclass and update tests
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4692 +/- ##
==========================================
- Coverage 99.65% 99.65% -0.01%
==========================================
Files 385 388 +3
Lines 34900 34700 -200
==========================================
- Hits 34780 34579 -201
- Misses 120 121 +1 ☔ View full report in Codecov by Sentry. |
1932672
to
4fc9672
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.
Really nice work @maliasadi -- the compiler
module docstring is really well written and structured!
I managed to get mostly through the PR, but haven't had a chance to review qml.qjit
yet, will do so tomorrow
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.
Looks great from my end @maliasadi, excited to have this in 😍
Should we add a #do not merge
label as a reminder not to merge this yet?
Co-authored-by: Josh Izaac <josh146@gmail.com>
⏰ This PR will be merged after the next release of Catalyst (v0.3.2) |
From the doc page of [pkg_resources](https://setuptools.pypa.io/en/latest/pkg_resources.html): > Use of pkg_resources is deprecated in favor of [importlib.resources](https://docs.python.org/3.11/library/importlib.resources.html#module-importlib.resources), [importlib.metadata](https://docs.python.org/3.11/library/importlib.metadata.html#module-importlib.metadata) and their backports ([importlib_resources](https://pypi.org/project/importlib_resources), [importlib_metadata](https://pypi.org/project/importlib_metadata)). Some useful APIs are also provided by [packaging](https://pypi.org/project/packaging) (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions. PR #4783 updates all occurrences of `pkg_resources` with `importlib.metadata` across the entire PL. This PR, however, addresses this replacement in the compiler driver, which has not yet been merged into PL. [sc-46399]
Context: This PR adds support for QJIT compatible `qml.jacobian` and `qml.grad`. Please see ADR 74 for implementation details. [sc-46406] --------- Co-authored-by: Josh Izaac <josh146@gmail.com>
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.
looks great, just a few things I'm curious about. Also, do we have a way of selecting which compiler to use if a user has more than one installed?
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'd fix the active_compiler
"Returns" docstring syntax and add the experimental warning to "Adding a compiler" in this PR, but otherwise lgtm!
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 @maliasadi!
…#4812) This PR updates the support and addresses code review suggestions in PR #4692. - [x] Activate integration tests in CI (using Catalyst v0.3.2) - [x] Fix docstring issues in the compiler and grad docs - [x] Use `h` instead of `step_size` in grad ops - [x] Update code coverage of the compiler module
Context:
We implement a
compiler
module that provides the PennyLane's native JIT compilation support.This
compiler
subpackage exclusively functions as a wrapper for PennyLane's JIT compiler packages, without independently implementing any compiler itself. Currently, it supports the 'pennylane-catalyst' package, with plans to incorporate additional packages in the near future.For any compiler packages seeking to be registered, it is imperative that they expose the 'entry_points' metadata under the designated group name:
pennylane.compilers
. (Check PR PennyLaneAI/catalyst#321 for details)Description of the Change:
qml.compiler
: The JIT compiler module containing all utilities and wrapper methods forqml.qjit
in PennyLane.qml.qjit
: A just-in-time decorator for PennyLane and JAX programs backed by CatalystBenefits: Compiling hybrid programs without explicitly importing Catalyst.
Possible Drawbacks: To use
qml.qjit
, users need to manually installpennylane-catalyst
.[sc-46400]
[sc-46401]