array-api icon indicating copy to clipboard operation
array-api copied to clipboard

docs: `default_device()` can be `None`

Open ev-br opened this issue 5 months ago • 2 comments

closes gh-923.

Per discussion in the community meeting, https://hackmd.io/zn5bvdZTQIeJmb3RW1B-8g#Meeting-minutes-15-May-2025 and the resolution of https://github.com/data-apis/array-api/issues/923#issuecomment-2885639657, spell out explicitly that None is an allowed return value of the default_device.

ev-br avatar Jun 23 '25 10:06 ev-br

A comment here: the wording implies that None has a special meaning – but my understanding is that the spec makes no requirements of what objects libraries use to represent devices, and so adding special meaning to None is not really necessary.

In the motivating example, JAX doesn't use None to mean that "the default device is not predictable due to library specific device placement rules", it uses None to represent the concept of uncommitted placement on the default device.

jakevdp avatar Jun 23 '25 14:06 jakevdp

JAX ... uses None to represent the concept of uncommitted placement on the default device.

This is one example of thea library specific device placement rule, I'd say :-).

That said, there's nothing special about the proposed wording here. Anything which says "None is allowed" is strictly better than what's in main, so if you've PR with a better wording, I'm happy to close this PR in favor of yours.

ev-br avatar Jun 23 '25 15:06 ev-br