Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement cupy.linalg.cond#9140

Merged
kmaehashi merged 10 commits into
cupy:mainfrom
gronerl:feature/cond
May 31, 2025
Merged

Implement cupy.linalg.cond#9140
kmaehashi merged 10 commits into
cupy:mainfrom
gronerl:feature/cond

Conversation

@gronerl

@gronerl gronerl commented May 25, 2025

Copy link
Copy Markdown

Hi, I'm Linus, making a maiden PR to cupy!

This PR adds the numpy.linalg.cond function to cupy. The implementation follows closely what numpy does and I did my best to add tests for all the relevant test cases in numpy.

Some points to consider by the reviewer:

  • the implementation follows the numpy one very closely. I left a comment after the docstring of cupy.linalg.cond. I hope this is in line with licensing and the ask to "add some remarks that this document is just copied or altered from the original one" in the contribution guide.
  • numpy has a test_nan that is marked as xfail due to inconsistent behavior across BLAS implementations. They track this issue here: TestCond.test_nan test failure for latest OpenBLAS numpy/numpy#18914 There the conclusion is, that in the future this should be left as undefined behavior. In fact this implementation of cupy.linalg.cond would fail said test.

@kmaehashi kmaehashi self-assigned this May 26, 2025
@kmaehashi kmaehashi added cat:feature New features/APIs prio:medium labels May 26, 2025
@mergify

mergify Bot commented May 29, 2025

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @gronerl? 🙏

@kmaehashi kmaehashi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gronerl! LGTM except for the minor comment below:

Comment thread tests/cupy_tests/linalg_tests/test_norms.py Outdated
@kmaehashi

Copy link
Copy Markdown
Member

/test mini

@gronerl

gronerl commented May 31, 2025

Copy link
Copy Markdown
Author

Thanks for reviewing @kmaehashi , PR is updated as suggested.

@gronerl gronerl closed this May 31, 2025
@gronerl gronerl reopened this May 31, 2025
@gronerl

gronerl commented May 31, 2025

Copy link
Copy Markdown
Author

(Sorry, closing was a slip of the finger.)

@kmaehashi

Copy link
Copy Markdown
Member

Thanks, LGTM!

@kmaehashi

Copy link
Copy Markdown
Member

/test skip

@kmaehashi kmaehashi enabled auto-merge May 31, 2025 08:24
@kmaehashi kmaehashi merged commit 73dbad7 into cupy:main May 31, 2025
67 checks passed
@kmaehashi kmaehashi added this to the v14.0.0a2 milestone May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants