CSC/ CSR classes
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- numpy, python
- 領域
- data, performance
調査の方向性
この issue では実装ファイルやテストが指定されていません。まず既存の疎配列型の階層と scipy.sparse の CSR および CSC の対応実装を調査し、その後、何も実装する前に公開 API、継承、パフォーマンスの要件を明確にしてください。ndarray のように動作し、scipy の対応実装と同等のパフォーマンスを持つ、明示的な CSR クラスと CSC クラスが実装されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
Could explicit CSR and CSC classes be added to this library?
I would love to stop using scipy.sparse.spmatrix classes. Their matrix API is a source of constant frustration. Lack of CSC and CSR arrays with an np.ndarray API has been a barrier to adoption not only of this library, but of xarray and dask for the scanpy/ anndata projects
Describe the solution you'd like
I would like there to be explicit CSR and CSC classes in this package. These should perform at least as well as scipy.sparse.spmatrix counterparts.
While higher dimensional algorithms are developed, performant implementations for these cases can be taken from scipy.sparse or developed from reference implementations. I think this is a low effort/ high pay-off path towards performant implementations for common formats. They wouldn't be n-dimensional, but there's a lot of value in being able to start consolidating efforts to this library before an n-dimensional generalization has the features and performance of the common 2d cases.
Describe alternatives you've considered
No explicit CSC/ CSR classes. These are subsets of more generic structures so why special case them?
I think this is the wrong approach due to how common these structures are. Even a flexible framework like taco exports these formats (pytaco.csc and pytaco.csr).
We could also consider what code looks like if these classes are not defined. All dispatch here could change from isinstance(x, sparse.csr_matrix) to something like isinstance(x, sparse.GXCS) and x.compressed_axes == (0,) and x.ndims == 2), but something closer to the first case is probably an easier sell.
CSC/ CSR classes as thin wrappers of an n-dimensional format
I think this is a great goal. However, it requires an implementation of that format which is at least as performant in most (probably all) cases as the scipy equivalents for broad adoption. As mentioned above, performant implementations can be (1) sourced from a current dependency (scipy.sparse) or (2) easily adapted from existing reference implementations.
Code specialized for these cases could gradually be replaced with more generic versions as they are implemented. However, performant implementation for these common cases would not be blocked by implementation of n-dimensional algorithms.
Additional context
I could expand on why I think this is the right way to go
I could go on about how important I think it is for there to be CSR and CSC classes in this library, and why it's important to implement these separately from higher dimensional generalizations. I find that makes this post too long. I'd be happy to add these arguments if asked.
Type hierarchy
I don't know what the appropriate type hierarchy is here. Should issubclass(CSR, GXCS) work? Or should there be an abstract CompressedDimSparseArray parent class for all of these? What is the result type of np.stack(: list[CSR]).
These are things that could be decided on later, once the n-dimensional compressed representation is public API.
- 主要言語
- 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 ·