Implement cupy.linalg.eig / cupy.linalg.eigvals#8854
Merged
13 commits merged intocupy:mainfrom May 29, 2025
Merged
Conversation
leofang
reviewed
Jan 9, 2025
| cupy.linalg._util._check_cusolver_dev_info_if_synchronization_allowed( | ||
| cusolver.xgeev, dev_info) | ||
|
|
||
| if all(w.imag == 0.0): |
Member
There was a problem hiding this comment.
I don't like the NumPy behavior but it looks like we have to follow... 🙁
Q: can we find a way to not create an intermediate array of bools for later reduction? Perhaps this can be replaced by a simple ReductionKernel?
leofang
reviewed
Jan 9, 2025
Comment on lines
+245
to
+247
| work = [_geev(a[ind, :, :], True) for ind in numpy.ndindex(a.shape[:-2])] | ||
| w = cupy.stack([x[0] for x in work]) | ||
| v = cupy.stack([x[1] for x in work]) |
Member
There was a problem hiding this comment.
This uses a Python loop to call geev. I suggest:
- either we create an issue to track this overhead before merging, or
- we just move this loop to C++ in this PR (see cusolver.pyx for batched SVD/QR examples)
leofang
reviewed
Jan 9, 2025
|
|
||
|
|
||
| # TODO(okuta): Implement eig | ||
| def _geev(a, with_eigen_vector, overwrite_a=False): |
Member
There was a problem hiding this comment.
Q: it seems we never see overwrite_a being set to True?
Member
|
@EarlMilktea any chance we can push this across the finish line? Do you need any help? Or should I find someone to take over? |
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
sorry, confused myself... /test mini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes #3255 and also closes #6359 .
This PR uses
cusolverDnXgeevto solve non-hermitian eigenvalue problems on GPU.