ENH: config manager to record all device transfers

Open
#168 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
data

Research direction

Start by reviewing the existing device handling in to_device and the array creation functions, then read the related discussion in gh-70 and the linked comment. Done means the configuration behavior for device transfers is defined and implemented consistently, with tests showing that a consuming library can enforce a single device throughout a test.

Written by the indexing model from the issue text.

Description

enhancement

EDIT: see https://github.com/data-apis/array-api-strict/issues/168#issuecomment-3372145888

Related to gh-70 but separate from the main discussion there.

This issue follows up on a discussion I had with @ogrisel over dinner the other day, where Olivier suggested that it might be useful for array-api-strict to have a mode which disallows changing the device of an array.

Right now, by default, mixing devices in a single function call is disallowed. However, changing the device of an array, in to_device and array creation functions, is allowed, as far as I can tell from skimming the code.

This may be a sensible default (e.g. otherwise to_device is a bit useless), however it may make sense to be able to override this behaviour, if a consuming library wants to ensure a single device is maintained throughout a test. I believe this is of interest to scikit-learn.

cc @betatim from previous device-related involvement

Dominant language
Python
Stars
34
Forks
14
Avg merge
3m
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

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-strict

All issues in data-apis/array-api-strict

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.