-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Frontend] Fix Python fallback errors with AutoGraph in certain insta…
…nces (#352) Improve robustness of AutoGraph conversion. List of changes: - fix bug when extracting the variable name in question for certain error messages - add input/output checking for while loops & add tests - setup fix for leftover JAX primitive when fallback is triggered, by adding access to the current JAXPR frame and quantum queuing context - remove for/while loop primitives from the JAXPR when a fallback to Python has occurred Enables to following to succeed for example: ```py @qjit(autograph=True) def f(): l = jnp.array([1, 2]) for _ in range(2): l = jnp.kron(l, l) # used to fail the lowering step of the leftover primitive, due to differently sized argument/return types return l ``` [sc-49491]
- Loading branch information
Showing
5 changed files
with
298 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.