Inconsistent DirectSolver interface.
@yangcal ya está trabajando en esto.
Desde el 18/2/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
- Lenguaje dominante
- Cython
- Estrellas
- 601
- Forks
- 46
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/nvmath-python
-
NVMath.Net for C# first revision Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
NVIDIA/nvmath-python#61 · 2 reacciones ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
NVIDIA/nvmath-python#56 · 3 comentarios ·
-
Reconsider this approuch Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
NVIDIA/nvmath-python#44 · 2 comentarios ·
-
enhancement
NVIDIA/nvmath-python#38 · 2 comentarios · 1 asignado ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
NVIDIA/nvmath-python#32 · 2 comentarios · 2 reacciones ·