SparseCsrCUDA: cuDSS backend for linalg.solve (#129856)

This PR switches to cuDSS library and has the same purpose of #127692, which is to add Sparse CSR tensor support to linalg.solve.
Fixes #69538

Minimum example of usage:
```
import torch

if __name__ == '__main__':
    spd = torch.rand(4, 3)
    A = spd.T @ spd
    b = torch.rand(3).to(torch.float64).cuda()
    A = A.to_sparse_csr().to(torch.float64).cuda()

    x = torch.linalg.solve(A, b)
    print((A @ x - b).norm())

```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/129856
Approved by: https://github.com/amjames, https://github.com/lezcano, https://github.com/huydhn

Co-authored-by: Zihang Fang <zhfang1108@gmail.com>
Co-authored-by: Huy Do <huydhn@gmail.com>
This commit is contained in:
Zitong Zhan
2024-08-22 07:57:30 +00:00
committed by PyTorch MergeBot
parent 64cfcbd8a3
commit 90c821814e
22 changed files with 396 additions and 2 deletions

View File

@ -38,6 +38,9 @@
# USE_CUSPARSELT=0
# disables the cuSPARSELt build
#
# USE_CUDSS=0
# disables the cuDSS build
#
# USE_CUFILE=0
# disables the cuFile build
#