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] Switch from binding qnode_kwargs to execution_config #6991

Merged
merged 13 commits into from
Feb 24, 2025

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Feb 21, 2025

Context:

As the capture workflow is getting more complicated, we should start using the well-defined ExecutionConfig object instead of the ambiguous and unspecified qnode_kwargs.

We also need to start passing the execution_config to the device, as that information is needed for handling mid circuit measurements.

Description of the Change:

Switches from binding a qnode_kwargs dictionary to an execution_config object.

Benefits:

Easier to manage the configuration of a workflow. Can specify MCM configuration info for device execution.

Possible Drawbacks:

Technically a breaking change, but a breaking change to an experimental project.

Related GitHub Issues:

[sc-84916]

@albi3ro albi3ro marked this pull request as ready for review February 21, 2025 15:56
Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

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

Should this PR also update DefaultQubitInterpreter to accept ExecutionConfig? It's not really used for anything inside the device yet, so I'm okay with doing it in #6961 as well.

@albi3ro
Copy link
Contributor Author

albi3ro commented Feb 21, 2025

Should this PR also update DefaultQubitInterpreter to accept ExecutionConfig? It's not really used for anything inside the device yet, so I'm okay with doing it in #6961 as well.

I'm fine either way, but I think that it makes sense in #6961 since that's when it actually starts using it.

@albi3ro albi3ro requested a review from andrijapau February 24, 2025 14:41
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.59%. Comparing base (d57655c) to head (26f3a68).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6991      +/-   ##
==========================================
- Coverage   99.59%   99.59%   -0.01%     
==========================================
  Files         483      483              
  Lines       46069    46066       -3     
==========================================
- Hits        45884    45881       -3     
  Misses        185      185              

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

Copy link
Contributor

@andrijapau andrijapau left a comment

Choose a reason for hiding this comment

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

This looks good to me! 🚀

@albi3ro
Copy link
Contributor Author

albi3ro commented Feb 24, 2025

Blocked by PennyLaneAI/pennylane-lightning#1067

Will merge once that goes in.

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.

🚀

albi3ro added a commit to PennyLaneAI/pennylane-lightning that referenced this pull request Feb 24, 2025
**Context:**

In PennyLaneAI/pennylane#6991 we are adding an
`execution_config` kwarg to `Device.eval_jaxpr`. We need to make sure
this change doesn't break lightning.

**Description of the Change:**

Adds an `execution_config : Optional[ExecutionConfig] = None` keyword
argument to `Device.eval_jaxpr`.

**Benefits:**

Lightning won't break when that change gets merged into pennylane. The
lightning device jaxpr execution can be configured in the future.

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-84916]

---------

Co-authored-by: ringo-but-quantum <[email protected]>
Co-authored-by: Amintor Dusko <[email protected]>
@albi3ro albi3ro merged commit 76b585d into master Feb 24, 2025
46 checks passed
@albi3ro albi3ro deleted the qnode-prim-execution-config branch February 24, 2025 19:17
josephleekl pushed a commit to PennyLaneAI/pennylane-lightning that referenced this pull request Feb 25, 2025
**Context:**

In PennyLaneAI/pennylane#6991 we are adding an
`execution_config` kwarg to `Device.eval_jaxpr`. We need to make sure
this change doesn't break lightning.

**Description of the Change:**

Adds an `execution_config : Optional[ExecutionConfig] = None` keyword
argument to `Device.eval_jaxpr`.

**Benefits:**

Lightning won't break when that change gets merged into pennylane. The
lightning device jaxpr execution can be configured in the future.

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-84916]

---------

Co-authored-by: ringo-but-quantum <[email protected]>
Co-authored-by: Amintor Dusko <[email protected]>
albi3ro added a commit to PennyLaneAI/catalyst that referenced this pull request Feb 26, 2025
**Context:**

In [pennylane PR
#6991](PennyLaneAI/pennylane#6991) we switched
from binding a `qnode_kwargs` to an `execution_config` with
`qnode_prim`.

**Description of the Change:**

Update the call siganture for `qnode_prim`.

**Benefits:**

Consistency with catalyst and pennylane.

**Possible Drawbacks:**

**Related GitHub Issues:**

---------

Co-authored-by: erick-xanadu <[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.

4 participants