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

[Frontend] Add pennylane.compilers entry points interface #331

Merged
merged 3 commits into from
Oct 24, 2023

Conversation

maliasadi
Copy link
Member

For any compiler packages seeking to be registered in PennyLane, this PR adds the entry_points metadata under the the group name pennylane.compilers, with the following entry points:

  • context: Path to the compilation evaluation context manager. This context manager should have the method context.is_tracing(), which returns True if called within a program that is being traced or captured.

  • ops: Path to the compiler operations module. This operations module may contain compiler specific versions of PennyLane operations. Within a JIT context, PennyLane operations may dispatch to these

  • qjit: Path to the JIT compiler decorator provided by the compiler. This decorator should have the signature qjit(fn, *args, **kwargs), where fn is the function to be compiled.

@maliasadi
Copy link
Member Author

@josh146 @dime10 I'm hoping to get this PR merges so that I can check the integration tests in PL against the master branch. This is the only vital update in Catalyst required for the PL-Catalyst integration at the moment.

Copy link
Collaborator

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Looks great my side 💯
I like the 3 objects a compiler must provide 👍

Don't forget to add a changelog!

setup.py Show resolved Hide resolved
@dime10
Copy link
Collaborator

dime10 commented Oct 24, 2023

How is this different from #321?

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Thanks Ali!

Don't forget to update the changelog :)

@maliasadi
Copy link
Member Author

@dime10 I created that draft PR to address all changes required for the integration. So far the only requirement was the addition entry points. But we may want to update the signature of Catalyst functions (pennylane_extensions.py) to make them consistent with PL ones.

@maliasadi maliasadi merged commit 6c0ed0b into main Oct 24, 2023
19 checks passed
@maliasadi maliasadi deleted the maa/frontend/entry_points branch October 24, 2023 21:34
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.

None yet

3 participants