-
Notifications
You must be signed in to change notification settings - Fork 41
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
Update VJP and adjoint-jacobian methods #222
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #222 +/- ##
=======================================
Coverage 99.71% 99.71%
=======================================
Files 4 4
Lines 351 354 +3
=======================================
+ Hits 350 353 +3
Misses 1 1
Continue to review full report at Codecov.
|
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.
Hi Ali, nice work 👍 I here just drop several comments.
Co-authored-by: Chae-Yeun Park <[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.
Great work on this @maliasadi
I have some questions and thoughts. I reckon we can figure out the integration testing mentioned earlier and identify how to best examine the use with PL.
Maybe @josh146 would have an idea how to best do some runtime and integration testing with/against the Python-only implementation.
…nto up_aj_vjp_methods
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.
Hi Ali, I just wanna approve this PR. Great job 👍
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.
Excellent work on this @maliasadi
Happy to approve too. Once the PL changes come we can do the integration.
Context:
This PR includes the updates for VJP and AdjDiff in a way that the AdjointJacobian method is more efficient (with reducing the cost of finding trainable params in the list of operations and updating jacobian matrix cache-efficiently) and VJP methods return processing functions required to compute the VJPs.
Description of the Change:
JacobianData
to encapsulate the data required in AdjDiff and VJP methods.adjointJacobian
and addadjointJacobianJD
with a new optimization.vectorJacobianProduct
using lambda functions.adjointJacobian
and VJP methods inlightning.qubit
.Benchmark:
The new adjoint-jacobian is up to 6% faster than the current implementation for large enough circuits.