The builtin passes and apply_pass use qml.transform(pass_name="name")#2487
The builtin passes and apply_pass use qml.transform(pass_name="name")#2487lillian542 wants to merge 12 commits intomainfrom
apply_pass use qml.transform(pass_name="name")#2487Conversation
|
@dime10 Now that we have Any objections? |
Sure, just check with @isaacdevlugt |
|
We can also just update the implementation to use |
|
Hello. You may have forgotten to update the changelog!
|
@dime10 @albi3ro no issues from my side :). We have something better now! |
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
qml.transform(pass_name="name")
qml.transform(pass_name="name")apply_pass an alias for qml.transform(pass_name="name")
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
|
@lillian542 feel free to delete all the jaxpr lit tests (and I guess the jaxpr printer itself)! Now that we don't go through catalyst legacy frontend's own mechanism, there's no need to check these anymore. The important part of the lit tests is the generated MLIR, as long as those are correct, we're fine. |
|
Note that "frontend tests" CI fails but "frontend tests: kokkos" CI succeeds because frontend lit tests are only run in the "frontend tests" job, if you were wondering. |
apply_pass an alias for qml.transform(pass_name="name")apply_pass useqml.transform(pass_name="name")
apply_pass useqml.transform(pass_name="name")apply_pass use qml.transform(pass_name="name")
|
Closing in favour of #2525 which contains these changes and some other improvements. |
…Lane's new unified transforms API (#2525) Copies some of the changes made here: #2487. The goal of this PR is to get rid of `PassPipelineWrapper` and `QNodeWrapper` and use the new unified transforms API. Complimentary PR in PennyLane that follows up on the removal: PennyLaneAI/pennylane#9123 [sc-112140][sc-104261] --------- Co-authored-by: lillian542 <Lillian.frederiksen@xanadu.ai> Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com> Co-authored-by: Christina Lee <chrissie.c.l@gmail.com> Co-authored-by: Yushao Chen (Jerry) <chenys13@outlook.com>
Context:
If you use
apply_passwith program capture enabled, everything runs but it does not apply the pass. The same problem is true for any builtin pass that is accessed viafrom catalyst.passes import pass_name. This has created some situations that are difficult to debug.Description of the Change:
We switch the
apply_passfunction to use the more generalqml.transform(pass_name="name-of-pass")UI instead ofPassPipelineWrapper, which isn't compatible with program capture. We also update the builtin passes to use the new more general UI.Note that there are still two functions in the
pass_api,pipelineandapply_pass_plugin, that do return aPassPipelineWrapper, so it is still currently possible to encounter one in specific cases.Benefits:
Less confusing behaviour when switching to program capture.
Downsides
PassPipelineWrapperraised a clear error message if passed a non-Qnode function, and these errors are no longer raised when we switch toqml.transform.pipelineandapply_pass_pluginwill still return PassPipelineWrapper, which creates an issue if these are used alongside (specifically if they are used before) builtin passes orqml.transform(pass_name...)[sc-112140][sc-104261]