- Notifications
You must be signed in to change notification settings - Fork892
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Implementcupy.linalg.eig
/cupy.linalg.eigvals
#8854
base:main
Are you sure you want to change the base?
Conversation
cupy.linalg._util._check_cusolver_dev_info_if_synchronization_allowed( | ||
cusolver.xgeev, dev_info) | ||
if all(w.imag == 0.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't like theNumPy 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 simpleReductionKernel
?
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]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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 (seecusolver.pyx for batched SVD/QR examples)
@@ -88,7 +97,56 @@ def _syevd(a, UPLO, with_eigen_vector, overwrite_a=False): | |||
return w.astype(w_dtype, copy=False), v.astype(v_dtype, copy=False) | |||
# TODO(okuta): Implement eig | |||
def _geev(a, with_eigen_vector, overwrite_a=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Q: it seems we never seeoverwrite_a
being set toTrue
?
@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.
sorry, confused myself... /test mini |
Thiscloses#3255 and alsocloses#6359 .
This PR uses
cusolverDnXgeev
to solve non-hermitian eigenvalue problems on GPU.