question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

if possible please provide an equivalent of numpy.linalg.eigvals for CuPy as cupy.linalg.eigvals

See original GitHub issue

Description

NumPy has a numpy.linalg.eigvals function, which is often used in real-life programs. Please provide an equivalent of it for CuPy and name it cupy.linalg.eigvals.

Additional Information

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
IvanYashchukcommented, Jan 24, 2022

I’m sorry to disappoint but MAGMA’s eigenvalue solver for non-symmetric matrices is really bad. There’s no specialized GPU-only path, it uses a mix of LAPACK calls with a tiny bit of CUDA kernels. Eigenvalues are computed using LAPACK. See lots of lapack77 calls in https://bitbucket.org/icl/magma/src/656d51d82375e791f3f6b20f47271cdbc41d5a8a/src/dgeev.cpp

Up to about 3k x 3k matrices, it’s faster to compute on CPU.

1reaction
emcastillocommented, Jan 25, 2022

Thanks @IvanYashchuk!!

I was looking into MAGMA code and saw the very same as you, ~I am just thinking of naively throwing this into a QR solver despite being slow just to avoid CPU sync.~ (note: this is not going to converge)

Read more comments on GitHub >

github_iconTop Results From Across the Web

cupy.linalg.eigh — CuPy 11.4.0 documentation
Returns two objects, a 1-D array containing the eigenvalues of a , and a 2-D square array or matrix (depending on the input...
Read more >
numpy.linalg.eigvals — NumPy v1.24 Manual
numpy.linalg.eigvals# ... Compute the eigenvalues of a general matrix. Main difference between eigvals and eig : the eigenvectors aren't returned. ... a(…, M,...
Read more >
NumPy: difference between linalg.eig() and linalg.eigh()
In a Python 3 application I'm using NumPy to calculate eigenvalues and eigenvectors of a symmetric real matrix.
Read more >
CuPy Documentation - Read the Docs
Note: If CuPy is installed via conda, please do conda uninstall cupy ... NumPy has numpy.linalg.norm() function that calculates it on CPU. > ......
Read more >
cupy 11.3.0 - PythonFix.com
CuPy : NumPy & SciPy for GPU. ... You can install cupy using pip ... if possible please provide an equivalent of numpy.linalg.eigvals...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found