8000 Experiment with custom partitioning by inailuig · Pull Request #1932 · netket/netket · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Experiment with custom partitioning #1932

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

inailuig
Copy link
Collaborator

Addresses #1921.

Replaces shard_map with custom partitioning in the operators where it was used.
Infers the sharding from the inputs at compile time, instead of hardcoding it.

Copy link
codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 46.42857% with 15 lines in your changes missing coverage. Please review.

Project coverage is 84.65%. Comparing base (d444d83) to head (5423621).

Files with missing lines Patch % Lines
netket/jax/sharding.py 31.81% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1932      +/-   ##
==========================================
- Coverage   84.72%   84.65%   -0.08%     
==========================================
  Files         307      307              
  Lines       18695    18717      +22     
  Branches     3664     3669       +5     
==========================================
+ Hits        15839    15844       +5     
- Misses       2114     2130      +16     
- Partials      742      743       +1     

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

@@ -508,3 +510,51 @@ def device_count() -> int:
jax.device_count() if config.netket_experimental_sharding is True, and mpi.rank otherwise.
"""
return mpi.n_nodes * device_count_per_rank()

Copy link
Member

Choose a reason for hiding this comment

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

can we move this function to a separate file?

@inailuig inailuig marked this pull request as draft September 26, 2024 08:56
@PhilipVinc
Copy link
Member

bump?

@inailuig
Copy link
Collaborator Author
inailuig commented Oct 1, 2024

bump?

will require quite a bit more work to add the graidents.
Implementing just the jvp rule is trivial, but since we need reverse mode we also need the transposition rule (or the vjp rule (does scatter), but then we don't support forward mode). We'll have to use a custom primitive for this afaik.

@PhilipVinc
Copy link
Member

sigh. it would have been lovely

@PhilipVinc
Copy link
Member

For posterity. This is also missing the vmap rule.

@PhilipVinc PhilipVinc force-pushed the master branch 2 times, most recently from f6a2477 to 6e593ca Compare April 19, 2025 08:53
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.

2 participants
0