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

jax.devices returns only the devices from the default backend #2898

Closed
gnecula opened this issue Apr 30, 2020 · 1 comment · Fixed by #3155
Closed

jax.devices returns only the devices from the default backend #2898

gnecula opened this issue Apr 30, 2020 · 1 comment · Fixed by #3155

Comments

@gnecula
Copy link
Collaborator

gnecula commented Apr 30, 2020

The documentation of jax.devices says that it returns all devices. This is not true in multi-backend setups, it returns only the devices from the default backend. This was confusing to me initially, and I also encountered this confusion in issue #2785

The simplest change would be to the documentation: if no backend is specified then only the devices on the default backend are returned (along with an explanation of what is the default backend).

A better change may be though to say that it returns all devices, in the order of backend priority, such that devices()[0] is the same as now. This may break some code though.

@gnecula
Copy link
Collaborator Author

gnecula commented Apr 30, 2020

I searched in Google3 and could not find any code that uses the backend parameter for jax.devices other than tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant