Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/cupyPublic
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

Draft
EarlMilktea wants to merge13 commits intocupy:main
base:main
Choose a base branch
Loading
fromEarlMilktea:impl-eig

Conversation

EarlMilktea
Copy link
Member

@EarlMilkteaEarlMilktea commentedDec 27, 2024
edited
Loading

Thiscloses#3255 and alsocloses#6359 .

This PR usescusolverDnXgeev to solve non-hermitian eigenvalue problems on GPU.

@EarlMilkteaEarlMilktea marked this pull request as ready for reviewJanuary 8, 2025 07:55
@EarlMilkteaEarlMilktea marked this pull request as draftJanuary 8, 2025 08:13
cupy.linalg._util._check_cusolver_dev_info_if_synchronization_allowed(
cusolver.xgeev, dev_info)

if all(w.imag == 0.0):
Copy link
Member

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?

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])
Copy link
Member

@leofangleofangJan 9, 2025
edited
Loading

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:

  1. either we create an issue to track this overhead before merging, or
  2. we just move this loop to C++ in this PR (seecusolver.pyx for batched SVD/QR examples)

asi1024 reacted with thumbs up emoji
@@ -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):
Copy link
Member

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?

@leofang
Copy link
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?

almaeder reacted with eyes emoji

@leofang

This comment was marked as resolved.

@leofang
Copy link
Member

sorry, confused myself...

/test mini

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@leofangleofangleofang left review comments

At least 1 approving review is required to merge this pull request.

Assignees

@asi1024asi1024

Labels
cat:featureNew features/APIsprio:high
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Implementation ofnumpy.linalg.eigvals equivalent Implementation ofnumpy.linalg.eig equivalent
4 participants
@EarlMilktea@leofang@kmaehashi@asi1024

[8]ページ先頭

©2009-2025 Movatter.jp