Skip to content

[Frontend] Make AOT happen for any function annotated with AbstractValue signatures #1774

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

erick-xanadu
Copy link
Contributor

Context: In preparation for quantum subroutines, I found the need to compile the following function:

@catalyst.qjit(target="mlir")
def identity(x : AbstractQreg()):
    return x
print(identity.mlir)

However, one small impediment was this check for types to decide whether AOT compilation is possible or not.

Description of the Change: Generalize small check to decide whether AOT compilation is possible or not by relying on isinstance of AbstractValue over ShapedArray. ShapedArray is derived from AbstractValue

Benefits: More general code, small progress towards quantum subroutines.

@erick-xanadu erick-xanadu requested a review from a team May 30, 2025 16:34
Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (f484b02) to head (dc42cb8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1774   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files          82       82           
  Lines        9211     9212    +1     
  Branches      872      872           
=======================================
+ Hits         8898     8899    +1     
  Misses        254      254           
  Partials       59       59           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dime10
Copy link
Contributor

dime10 commented May 30, 2025

Are you planing on using the full end-to-end compilation on subroutines?

@erick-xanadu
Copy link
Contributor Author

@dime10 at the moment, I just want to be able to generate plxpr / jaxpr. And stitch it together inside qjit during tracing.

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.

2 participants