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

FR: expose device/sharding argument for NamedArray.wrap #80

Open
amifalk opened this issue Aug 8, 2024 · 2 comments
Open

FR: expose device/sharding argument for NamedArray.wrap #80

amifalk opened this issue Aug 8, 2024 · 2 comments

Comments

@amifalk
Copy link

amifalk commented Aug 8, 2024

No description provided.

@danieldjohnson
Copy link
Collaborator

Hm, I'm not sure this is necessary? You can provide the device and sharding for the array before wrapping it, and pz.nx.wrap should preserve it, e.g.

arr = pz.nx.wrap(jax.device_put(my_array, my_sharding))

@amifalk
Copy link
Author

amifalk commented Aug 8, 2024

Yep, just a little syntactic sugar :). When training large models, I often use a data loader to grab data from the disk and process it onto a numpy array, then directly from there convert it to a NamedArray sharded over devices.

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

No branches or pull requests

2 participants