-
Notifications
You must be signed in to change notification settings - Fork 60
[multihost] Use make_array_from_process_local_data to create global array instead of device_put #1281
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
base: main
Are you sure you want to change the base?
[multihost] Use make_array_from_process_local_data to create global array instead of device_put #1281
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -270,7 +270,7 @@ def device_array(mesh: Mesh, *args, sharding=None, **kwargs) -> jax.Array: | |
| """ | ||
| if sharding is None: | ||
| sharding = NamedSharding(mesh, PartitionSpec(None)) | ||
| return jax.device_put(*args, device=sharding, **kwargs) | ||
| return jax.make_array_from_process_local_data(sharding, *args) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we doing this here and which problem does it solve? Imagine you want to load a 100GB Dataset onto your 8 TPUs (sharded). In this case local data should be sharded (before transferring to TPU) because it won't fit on individual RAMs. This is when The code will break in this setup (two hosts each 4 chips) that requires us to handle slicing manually in the code. |
||
|
|
||
|
|
||
| def get_hash_fn_by_name(hash_fn_name: str) -> Callable[[Any], bytes]: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.