Skip to content
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

[Capture] add plxpr_to_tape function #6343

Merged
merged 52 commits into from
Dec 12, 2024
Merged

[Capture] add plxpr_to_tape function #6343

merged 52 commits into from
Dec 12, 2024

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Oct 4, 2024

Context:

With the addition of the PlxprInterpreter class, we can now easily set up tools for converting from plxpr to something else.

For device execution, we need to be able to collect all the ops in a jaxpr in order to apply the adjoint or control transform primitivies. So I'm adding this in now.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

[sc-74926]

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.61%. Comparing base (ccba66f) to head (d03a254).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6343   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files         468      469    +1     
  Lines       44149    44233   +84     
=======================================
+ Hits        43979    44064   +85     
+ Misses        170      169    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@albi3ro albi3ro changed the title [Capture] add convert_to_tape function [Capture] add plxpr_to_tape function Dec 10, 2024
@albi3ro
Copy link
Contributor Author

albi3ro commented Dec 10, 2024

Leaving this warning from the docs build here:

/github/workspace/pennylane/capture/__init__.py:docstring of pennylane.capture.rst:49: WARNING: autosummary: stub file not found 'pennylane.pennylane.tape.plxpr_to_tape'. Check your autosummary_generate setting.

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Show resolved Hide resolved
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice stuff

Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One very minor comment/question, looks good to me!

pennylane/ops/op_math/adjoint.py Show resolved Hide resolved
pennylane/tape/plxpr_conversion.py Outdated Show resolved Hide resolved
@albi3ro albi3ro enabled auto-merge (squash) December 12, 2024 16:19
@albi3ro albi3ro merged commit 1e88c32 into master Dec 12, 2024
45 checks passed
@albi3ro albi3ro deleted the convert-to-tape branch December 12, 2024 16:33
mudit2812 pushed a commit that referenced this pull request Dec 13, 2024
**Context:**

With the addition of the `PlxprInterpreter` class, we can now easily set
up tools for converting from plxpr to something else.

For device execution, we need to be able to collect all the ops in a
jaxpr in order to apply the adjoint or control transform primitivies. So
I'm adding this in now.

**Description of the Change:**

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-74926]

---------

Co-authored-by: David Wierichs <[email protected]>
Co-authored-by: Pietropaolo Frisoni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants