-
Notifications
You must be signed in to change notification settings - Fork 672
Raising a warning if latest JAX is installed #7369
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
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.41.1-rc0 #7369 +/- ##
==============================================
Coverage ? 99.64%
==============================================
Files ? 513
Lines ? 50191
Branches ? 0
==============================================
Hits ? 50015
Misses ? 176
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks @rashidnhm for raising this point. I don't think we should merge this branch into master, precisely for the reasons that you mentioned (also, there would be several merge conflicts). If needed, it's much faster for me to open a PR directly in master to copy the warning message implemented here. |
This PR applies some changes to master coming from [this PR](#7369), which has been merged in the release candidate branch for the bugfix release of PennyLane 0.41.1. More details can be found in the original PR description. This PR aims to update the master branch with the changes currently present in the stable version of PennyLane (0.41.1, no longer 0.41.0)
This PR applies some changes to master coming from [this PR](#7369), which has been merged in the release candidate branch for the bugfix release of PennyLane 0.41.1. More details can be found in the original PR description. This PR aims to update the master branch with the changes currently present in the stable version of PennyLane (0.41.1, no longer 0.41.0)
Hey there! So what is the current solution if I don't want to install from this branch but just from pip? Should I uninstall jax and install a version <= 0.4.28 Also, hi :D. Long time :) |
Hi @EmilianoG-byte! Long time indeed : ) The change in this PR is now part of PL 0.41.1. That is, the current stable version that you can install with pip (that is, Good luck with all your current and future endeavours! |
Thank you for the answer @PietropaoloFrisoni :D. I will downgrade to 0.4.28 for now then and wait for the next release! Also best of luck to you as well 😄🌞! |
Context: We need a bugfix release for
PennyLane 0.41
.The reason is that if a user installs PennyLane, then latext JAX, and then imports PennyLane (in this sequence), the following error is raised:
and there are no further details.
Therefore, we need to raise an informative warning at some point that tells the user that PL is not yet compatible with the latest JAX version.
Notice that this branch was created from the tag of the latest PennyLane release, as the PL release guidance recommends.
Description of the Change:
This is not a change implemented in this PR, but notice that
__version__
is set to"0.41.1"
on this branch. This change was implemented before pushing this branch to GitHub, as the PL release guidance recommends.We need to install the stable version of
pennylane-lightning
andpennylane-catalyst
instead of the latest, because the latest version of these packages is now incompatible with this branch (they are using thepennylane.exceptions
module, which was introduced after the 0.41 release). Obviously, this change will not be merged into master.The actual warning message. This triggered
pylint
failures in the entire file, and I had to stick:at the very top of the file. This is certainly not ideal, but this is only temporary before PL is compatible with the latest JAX version (WIP to be completed before the next release).
Notice that we might also raise this warning somewhere else, catching the first
import jax
inside the capture folder that causes the issue, instead of theinit
file in PennyLane. There was a brief discussion about this with @mlxd. Happy to change if needed, so please let me know what you think.sphinx
. The reason is that I was getting so manysphinx
failures.I noticed that
sphinx
was updated recently in this PR (@rashidnhm or @runora95), in whichPennyLaneAI/[email protected]
has been replaced withPennyLaneAI/sphinx-action@master
in.github/workflows/docs.yml
.This branch was using
PennyLaneAI/sphinx-action@master
, and it was created from the 0.41 tag, which therefore was also usingPennyLaneAI/sphinx-action@master
(you can check by downloading the source code from GitHub).Therefore, in between the 0.41 release and this PR, we must have changed
PennyLaneAI/sphinx-action@master
toPennyLaneAI/[email protected]
at some point.Maybe @rashidnhm or @runora95 have some insight about what and why this happened. Thanks!
Obviously, this change (that is, downgrading
sphinx
) will not be merged into master.qnn/__init__.py
. The reason is that I was getting an annoyingsphinx
failure:And I noticed that the link to this demo in the stable doc version is broken (most probably because the demo has been moved/renamed on March 20th, after the 0.41 release). I replaced the link with a working one in the only way I know.
Benefits: An informative warning is raised when importing pennylane with the latest JAX installed.
Possible Drawbacks: Strictly speaking, none as this is a bugfix release.
Related GitHub Issues: None.
Related Shortcut Story: [sc-90355]
Further details: I tested this in a virtual conda environment.
If
JAX
is installed with version <= 0.4.28 or if it is not installed at all, we get the following output when importing pennylane:If
JAX
is installed with version > 0.4.28, we get the following output when importing pennylane:I encourage you to try as well : )