Inconsistent DirectSolver interface.
@yangcal がすでに取り組んでいます。
2026年2月18日 から。
評価
この issue はまだ評価されていません。
説明
Hi everyone! I've noticed a small inconsistency in the sparse solver interface, namely when it comes to using it with a 2D tensor where the last dimension is 1.
Given a 3x3 lhs sparse matrix and a 3x2 rhs dense matrix:
a = torch.sparse_coo_tensor([[0, 1, 2], [0, 1, 2]], [1.0, 1.0, 1.0], device="cuda").to_sparse_csr()
b = torch.randn([3, 2], device="cuda")
we can set up a solver for with:
nvsparse.DirectSolver(a, b.mT.contiguous().mT)
This works fine. However, for a 3x1 rhs:
b = torch.randn([3,1], device="cuda")
setting up the solver in the same way breaks with:
TypeError("The RHS tensor([[1.],\n [1.],\n [1.]], device='cuda:0') must be a matrix or vector with col-major layout, and for implicitly-batched RHS (N-D >= 3), each matrix sample must have col-major layout (the second dimension from the end must have unit stride.")
It would be great not to have to special-case this.
Best,
Ana
- 主要言語
- Cython
- スター
- 601
- フォーク
- 46
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/nvmath-python のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NVIDIA/nvmath-python#61 · リアクション 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
NVIDIA/nvmath-python#56 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NVIDIA/nvmath-python#44 · コメント 2 件 ·
-
enhancement
NVIDIA/nvmath-python#38 · コメント 2 件 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NVIDIA/nvmath-python#32 · コメント 2 件 · リアクション 2 件 ·