Poor numerical consistency with numpy for reductions with dtype=`float16` specified
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
COO.sum と COO.mean のリダクションエントリポイントから開始し、提示された float16 の例を NumPy に対して再現します。複数の軸に対するリダクションで dtype 引数がどのように処理されるかを追跡し、示されたケースについて sparse の結果が対応する NumPy の結果と一致することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Reductions like COO.sum and COO.mean fail to match numpy in all cases when dtype=numpy.float16 is specified. For example:
import sparse
import numpy as np
x = np.array([[[ 0, 0, 4526, 0],
[ 0, 0, -37, 0],
[ 8372, 0, 7915, 0]],
[[ 0, 0, 0, 0],
[ 0, 0, -7917, 0],
[-9719, 0, 0, 0]]], dtype='i4')
s = sparse.COO.from_numpy(x)
res = s.sum(axis=(0, 2), dtype='f2')
sol = x.sum(axis=(0, 2), dtype='f2')
print(res.todense())
print(sol)
outputs:
[ 4530. -7950. 6564.]
[ 4530. -7950. 6570.]
It's not clear if each of these will need to be fixed per-method, or if there's a general fix in the reduce code. For sum, numpy interprets x.sum(dtype='f2') the same as x.astype('f2').sum(), but this is not true for x.mean(dtype='f2').
- 主要言語
- Python
- スター
- 670
- フォーク
- 167
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pydata/sparse のほかの issue
-
Bug: full einsum contractions upcast the dtype and count booleans対応中かも @RaphaelFakhri が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
BUG: ufunc outer rejects Python scalar and sequence operands対応中かも @nawaaaaaAaar が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
Bug: slices with a negative step and a negative stop return wrong elements対応中かも @JoeyTan21 が 19 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
pydata/sparse#1019 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
BUG: matmul fails with zero-length broadcast batch dimensions対応中かも @nawaaaaaAaar が 29 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 40/100
メンテナーはふだん 2 日以内に返信
-
BUG: zero-length tensor contractions ignore requested output types対応中かも @nawaaaaaAaar が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
flashinfer-ai/flashinfer#9803 ·
メンテナーはふだん 1 日以内に返信
-
bug frontend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
oscarbol09/thesisforge#61 ·
-
api bug performance
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
oscarbol09/audiobard#159 ·
-
area:web p2 product:business triage:active type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
cuadrao-ai/argus#2328 ·
メンテナーはふだん 1 日以内に返信
-
bug frontend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nikhilb2/simple_invoicing#907 ·