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

Update to solve jax deprecations #1766

Merged
merged 7 commits into from
Apr 11, 2024

Conversation

PhilipVinc
Copy link
Member

Jax 0.4.25 deprecated jax.tree_map in favour of jax.tree.map.

However jax.tree.map is only available in recent jax versions, so to avoid breaking older versions I replaced all usages of jax.tree_map with jax.tree_util.tree_map, which should be updated to jax.tree.map in a few months when we drop older jax versions.

Documentation is updated to reflect latest jax versions, that is, jax.tree.map.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Attention: Patch coverage is 89.18919% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 51.74%. Comparing base (b4465f2) to head (60f9676).

❗ Current head 60f9676 differs from pull request most recent head 893f7e4. Consider uploading reports for the commit 893f7e4 to get more accurate results

Files Patch % Lines
netket/jax/_scanmap.py 33.33% 1 Missing and 1 partial ⚠️
netket/optimizer/qgt/common.py 50.00% 2 Missing ⚠️
netket/experimental/driver/tdvp_schmitt.py 0.00% 1 Missing ⚠️
netket/experimental/qsr/logic_helpers.py 66.66% 1 Missing ⚠️
netket/jax/_grad.py 0.00% 1 Missing ⚠️
netket/jax/sharding.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1766       +/-   ##
===========================================
- Coverage   82.60%   51.74%   -30.87%     
===========================================
  Files         309      309               
  Lines       18768    18192      -576     
  Branches     2757     2734       -23     
===========================================
- Hits        15503     9413     -6090     
- Misses       2581     8080     +5499     
- Partials      684      699       +15     

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

@PhilipVinc PhilipVinc merged commit 853ef27 into netket:master Apr 11, 2024
9 of 11 checks passed
@PhilipVinc PhilipVinc deleted the pv/tree_map_deprecation branch April 11, 2024 11:42
jwnys pushed a commit to jwnys/netket that referenced this pull request Apr 23, 2024
Jax 0.4.25 deprecated `jax.tree_map` in favour of `jax.tree.map`.

However `jax.tree.map` is only available in recent jax versions, so to
avoid breaking older versions I replaced all usages of `jax.tree_map`
with `jax.tree_util.tree_map`, which should be updated to `jax.tree.map`
in a few months when we drop older jax versions.

Documentation is updated to reflect latest jax versions, that is,
`jax.tree.map`.
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.

None yet

1 participant