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

PennyLane is compatible with JAX 0.4.28 #6255

Merged
merged 76 commits into from
Sep 17, 2024
Merged

PennyLane is compatible with JAX 0.4.28 #6255

merged 76 commits into from
Sep 17, 2024

Conversation

PietropaoloFrisoni
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni commented Sep 11, 2024

Context: As part of the effort to make PL compatible with Numpy 2.0 (see #6061), we need to upgrade JAX to 0.4.26+ since such a version introduced the support for Numpy 2.0. We opted for JAX 0.4.28 since it is the same version used by Catalyst.

Description of the Change: As above.

Benefits: PL is compatible with Numpy 2.0 and Jax 0.4.28.

Possible Drawbacks:

  • From JAX 0.4.27, in jax.jit, passing invalid static_argnums or static_argnames now leads to an error rather than a warning. In PL, this breaks every test where we set shots in the QNode call with static_argnames=["shots"]. At this stage, we decided to mark such tests with pytest.xfail to allow the upgrade.

Related GitHub Issues: None.

Related Shortcut Stories: [sc-61389]

EmilianoG-byte and others added 30 commits August 1, 2024 11:00
…aN to np.nan"

This reverts commit b3ab335.

Reverting changes from numpy formating and NAN
revert changes from numpy printing settings
attempt to use the legacy printing option
Base automatically changed from compatible-np-2.0 to master September 16, 2024 13:08
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.57%. Comparing base (b78565c) to head (5eed998).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6255      +/-   ##
==========================================
- Coverage   99.58%   99.57%   -0.01%     
==========================================
  Files         443      444       +1     
  Lines       42273    42336      +63     
==========================================
+ Hits        42096    42158      +62     
- Misses        177      178       +1     

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

Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @PietropaoloFrisoni 🎉

Just wanted to ask about documenting the change and potentially adapting requirements files to the new supported JAX version?

tests/devices/qutrit_mixed/test_qutrit_mixed_measure.py Outdated Show resolved Hide resolved
doc/releases/changelog-dev.md Show resolved Hide resolved
Copy link
Contributor

@astralcai astralcai left a comment

Choose a reason for hiding this comment

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

LGTM

@PietropaoloFrisoni PietropaoloFrisoni merged commit 7e21a76 into master Sep 17, 2024
37 checks passed
@PietropaoloFrisoni PietropaoloFrisoni deleted the update_jax branch September 17, 2024 15:43
mudit2812 pushed a commit that referenced this pull request Sep 18, 2024
**Context:** As part of the effort to make PL compatible with Numpy 2.0
(see #6061), we need to upgrade JAX to 0.4.26+ since such a version
introduced the support for Numpy 2.0. We opted for JAX 0.4.28 since it
is the same version used by Catalyst.

**Description of the Change:** As above.

**Benefits:** PL is compatible with Numpy 2.0 and Jax 0.4.28.

**Possible Drawbacks:** 

- From JAX 0.4.27, in `jax.jit`, passing invalid static_argnums or
static_argnames now leads to an error rather than a warning. In PL, this
breaks every test where we set `shots` in the `QNode` call with
`static_argnames=["shots"]`. At this stage, we decided to mark such
tests with `pytest.xfail` to allow the upgrade.

**Related GitHub Issues:** None.

**Related Shortcut Stories**: [sc-61389]

---------

Co-authored-by: dwierichs <david.wierichs@xanadu.ai>
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.

5 participants