Description
🚀 Feature
cuSolverSP (part of cuSOLVER) provides linear solver, least-square solver routines for matrices in CSR format. We can use it as a backend for torch.linalg.solve
and torch.linalg.lstsq
.
We are working on improving coverage of Sparse CSR matrices in PyTorch. Solving systems of linear equations is one of the 7282 fundamental operations in computational linear algebra.
From cuSOLVER docs:
The high-level API is designed for ease-of-use, so it allocates any required memory under the hood automatically. If the host or GPU system memory is not enough, an error is returned.
Unfortunately, it means these functions do not allow passing externally allocated buffers, and paths with inputs on GPU are not implemented (there remarks for relevant functions "only CPU (Host) path is provided").
-
torch.linalg.solve
UsecusolverSp<t>csrlsvlu
. -
torch.linalg.lstsq
UsecusolverSp<t>csrlsqvqr
cc @nikitaved @pearu @cpuhrsch @IvanYashchuk @ngimel @jianyuh @mruberry @walterddr @xwang233 @lezcano