Skip to content

Conversation

@andrijapau
Copy link
Contributor

@andrijapau andrijapau commented Jul 23, 2025

Context:

Jax released a new version with a lot of breaking changes. Unfortunately our v0.42 release is not compatible with this version and so there are runtime errors.

ℹ️ : This PR was created by branching the v0.42.0 tag.

Description of the Change:

  • The fix will check if the user has jax and if they do it will perform a version check to ensure compatibility.
>>> import pennylane as qml
~/Documents/pennylane/pennylane/__init__.py:29: RuntimeWarning: PennyLane is not yet compatible with JAX versions > 0.6.2. You have version 0.7.0 installed. Please downgrade JAX to <=0.6.2 to avoid runtime errors.
  • We need to install the stable version of pennylane-lightning and pennylane-catalyst instead of the latest, because the latest version of these packages is now incompatible with this branch (they are using the pennylane.exceptions module for some custom exceptions). This change will not be merged into master.

Benefits: Better UI.

Possible Drawbacks: None.

[sc-96104]

@github-actions

This comment was marked as resolved.

@andrijapau andrijapau changed the title [BF Release] raise warning if jax > 0.6.2 is installed Jul 23, 2025
@codecov
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (2a74df8) to head (17a0e94).
⚠️ Report is 1 commits behind head on v0.42.1-rc0.

Additional details and impacted files
@@             Coverage Diff              @@
##           v0.42.1-rc0    #7949   +/-   ##
============================================
  Coverage        99.68%   99.68%           
============================================
  Files              543      543           
  Lines            55314    55321    +7     
============================================
+ Hits             55140    55147    +7     
  Misses             174      174           

☔ 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.
@andrijapau andrijapau changed the title [Bug Fix Release] raise warning if jax > 0.6.2 is installed Jul 23, 2025
andrijapau and others added 3 commits July 23, 2025 13:39
Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

Can confirm that importing PL with latest JAX results in a warning message:

>>> import pennylane as qml
RuntimeWarning: PennyLane is not yet compatible with JAX versions > 0.6.2. You have version 0.7.0 installed. Please downgrade JAX to <=0.6.2 to avoid runtime errors.
  warnings.warn(

💯

Not sure about the sphinx failures (I had to struggle with it even last time, and I had to downgrade)

@andrijapau
Copy link
Contributor Author

Can confirm that importing PL with latest JAX results in a warning message:

>>> import pennylane as qml
RuntimeWarning: PennyLane is not yet compatible with JAX versions > 0.6.2. You have version 0.7.0 installed. Please downgrade JAX to <=0.6.2 to avoid runtime errors.
  warnings.warn(

💯

Not sure about the sphinx failures (I had to struggle with it even last time, and I had to downgrade)

I got around them by aliasing the imports as private (eb4a11d)

@andrijapau andrijapau requested a review from mudit2812 July 23, 2025 19:53
andrijapau and others added 2 commits July 23, 2025 16:22
Co-authored-by: Lee James O'Riordan <mlxd@users.noreply.github.com>
@andrijapau andrijapau requested a review from DSGuala July 23, 2025 20:27
@andrijapau
Copy link
Contributor Author

Tagging @jay-selby @Alex-Preciado as they were present on the last BF release PR. 👋🏼

Copy link
Contributor

@DSGuala DSGuala left a comment

Choose a reason for hiding this comment

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

Thanks for updating the error/warning messages 👍
Looks good to me.

@andrijapau andrijapau requested a review from mlxd July 24, 2025 17:29
@andrijapau andrijapau merged commit b5cc3bf into v0.42.1-rc0 Jul 24, 2025
49 checks passed
@andrijapau andrijapau deleted the bf-release branch July 24, 2025 17:32
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

🥇

github-merge-queue bot pushed a commit that referenced this pull request Jul 30, 2025
**Context:**

A `v0.42.1` bug fix was released with changes from
#7949. In order to keep up
to date, this PR merges relevant changes here. Since `0.7.0` won't be
compatible any time soon (waiting on Catalyst) might as well have this
warning on master as well.

[sc-96620]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants