Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Multi-device support meta-thread

Open
#918 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
numpy, python, pytorch

Research direction

This is a cross-project tracker covering the Array API, array-api-strict, array-api-tests, array-api-compat, array-api-extra, NumPy, CuPy, PyTorch, JAX, Dask, and SciPy. Start by selecting one concrete backend or test gap and read the linked issues and pull requests; the tracker does not define a single change or completion condition.

Written by the indexing model from the issue text.

Description

This is a tracker of the current state of support for more than one device at once in the Array API, its helper libraries, and the libraries that implement it.

Supporting multiple devices at the same time is typically substantially more fragile than pinning one of the available devices at interpreter level and then using that one exclusively, which typically works as intended.

Array API
array-api-strict
  • Supports three hardcoded devices, "cpu", "device1", "device2". This is fit for purpose for testing downstream bugs re. device propagation.
array-api-tests
array-api-compat
  • Adds device param to numpy 1, cupy, torch, and dask (read below).
  • Implements helper functions device() and to_device() to work around non-compliance of wrapped libraries
array-api-extra
  • Full support and testing for non-default devices, using array-api-strict only. Actual support from real backends entirely depends on the below.
NumPy
  • It supports a single dummy device, "cpu".
  • array-api-compat backports it to NumPy 1.x.
CuPy
  • Non-compliant support for multiple devices.
  • array-api-compat adds a dummy device= parameter to functions.
  • A compatibility layer is being added at the moment of writing by https://github.com/data-apis/array-api-compat/pull/293. [EDIT] it can't work, as array-api-compat can't patch methods.
  • As it doesn't have a "cpu" device, it's impossible to test multi-device ops without access to a dual-GPU host.
PyTorch
JAX
Dask
  • Dask doesn't have a concept of device
  • array-api-compat adds stub support, that returns "cpu" when wrapping around numpy and a dummy DASK_DEVICE otherwise. Notably, this is stored nowhere and does not survive a round-trip (device(to_device(x, d) == d can fail).
  • This is a non-issue when wrapping around numpy, or when wrapping around cupy with both client and workers mounting a single GPU.
  • Multi-GPU Dask+CuPy support could be achieved by starting separate worker processes on the same host and pinning the GPU at interpreter level. This is extremely inefficient as it incurs in IPC and possibly memory duplication. If a user does so, the client and array-api-compat will never know.
  • dask-cuda may improve the situation (did not investigate).
SciPy
Dominant language
Python
Stars
281
Forks
52
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from data-apis/array-api

All issues in data-apis/array-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.