Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear algebra extension tracking issue #676

Open
15 tasks
tomwhite opened this issue Jan 20, 2025 · 1 comment
Open
15 tasks

Linear algebra extension tracking issue #676

tomwhite opened this issue Jan 20, 2025 · 1 comment
Labels
array api help wanted Extra attention is needed

Comments

@tomwhite
Copy link
Member

This issue tracks the work needed to support the remaining linear algebra functions from the Python array API standard.

The current Cubed coverage status for the linalg extension can be found at https://github.com/cubed-dev/cubed/blob/main/api_status.md#linear-algebra-extension

@tomwhite tomwhite added array api help wanted Extra attention is needed labels Jan 20, 2025
@tomwhite
Copy link
Member Author

Here is a possible plan of attack. This is not in any particular order (since it would depend on what the demand is), but I've tried to tease out the dependencies between functions. Apart from some simpler array functions, most of the linalg functions depend on factorization functions like cholesky, lu, qr, or svd.

  • simple functions (cross, diagonal, trace)
    • cross can be implemented using moveaxes, multiply (following NumPy)
    • diagonal has a fairly straightforward chunked algorithm (following Dask)
    • trace uses diagonal and sum
  • factorization (cholesky, lu, qr, svd)
  • solving equations (inv, pinv, solve)
    • solve can be implemented using lu, cholesky, and solve_triangular (following Dask)
    • invcan be implemented using solve
    • pinv can be implemented usingsvd (see https://www.johndcook.com/blog/2018/05/05/svd/)
    • We might add solve_triangular and lstsq functions (not standardised, but in Dask)
  • determinants (det, slogdet)
  • eigenvalues (eigh, eigvalsh)
    • Use svd
  • norms (matrix_norm, vector_norm)
    • Use simple reductions (sum, min), orsvd for singular value-based norms
  • other (matrix_power, matrix_rank)
    • matrix_power can be implemented using repeated calls to matmul; or eye for n=0; or inv for n<0 (following NumPy)
    • matrix_rank can be implemented using svd

It would be interesting if there are more up-to-date chunked/blocked algorithms for any of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
array api help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant