catalyst
catalyst copied to clipboard
Support for value_and_grad at the MLIR side (inside a jitting context)
Context: Lowering of value_and_grad to MLIR is now supported when @qjit is used.
Description of the Change: A new ValueAndGradOp was added and the existing BackpropOp was modified to return two results: values and gradients.
Benefits: Code reutilization.
TODO:
- [ ] Add unit tests.
- [ ] Test corner cases.
- [ ] Update the changelog.md file
[sc-55116]
Hello. You may have forgotten to update the changelog!
Please edit doc/changelog.md on your branch with:
- A one-to-two sentence description of the change. You may include a small working example for new features.
- A link back to this PR.
- Your name (or GitHub username) in the contributors section.
Codecov Report
Attention: Patch coverage is 34.28571% with 23 lines in your changes missing coverage. Please review.
Project coverage is 99.25%. Comparing base (
21e0f5f) to head (a2935a9). Report is 337 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| frontend/catalyst/jax_primitives.py | 33.33% | 16 Missing :warning: |
| frontend/catalyst/pennylane_extensions.py | 36.36% | 6 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #622 +/- ##
==========================================
- Coverage 99.50% 99.25% -0.26%
==========================================
Files 53 53
Lines 8930 8959 +29
Branches 655 658 +3
==========================================
+ Hits 8886 8892 +6
- Misses 25 47 +22
- Partials 19 20 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Closing this as value_and_grad is merged in by #804