FYI/Clarification for `*_like(arr)` functions using `arr.device`
まだ誰も着手していません。
評価
調査の方向性
まず、*_like(arr) の device 処理に関する Array API の要件と、issue で報告されている CuPy、JAX、torch の挙動を確認します。完了条件は、標準に明確化または挙動の変更が必要かどうかをメンテナーが判断し、互換性への予想される影響が文書化されていることです。
索引モデルが issue の本文から書いたものです。
説明
This may be more of a CuPy question about how comfortable CuPy is with changing behavior and pushing through the change in v15. But it does come from the Array API so just bringing it up here once for awareness.
The standard states that empty_like(arr) should allocate as if empty_like(arr, device=arr.device) was passed. And that is actually what JAX and torch do:
import cupy as cp
arr = cp.arange(1000) # arr.device == Device(0)
with cp.cuda.Device(1)
print(cp.empty_like(arr).device) # Device(1) for cupy, 0 for JAX/torch
CuPy does currently not do this (I half suspect this was missed at the time), CuPy completely relies on context managers right now (to the point that even a NumPy array works there).
CC @leofang
- 主要言語
- Python
- スター
- 281
- フォーク
- 52
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
data-apis/array-api のほかの issue
-
bug Maintenance Narrative Content
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Maintenance
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
data-apis/array-api の issue をすべて見る
似ている issue
-
adr
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
kristofdegrave/homeassistant-smart-charging#1607 ·
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
EclipseFdn/open-vsx.org#13665 ·
メンテナーはふだん 1 日以内に返信
-
doc good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
collective/icalendar#1865 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
canonical/opentelemetry-collector-operator#409 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
mozilla/addons-release-tests#1243 ·
メンテナーはふだん 1 日以内に返信