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

Skip to content

Fix cupyx.scipy.special.logsumexp for NumPy 2.0#8836

Merged
asi1024 merged 2 commits into
cupy:mainfrom
asi1024:fix-scp-logsumexp
Jan 15, 2025
Merged

Fix cupyx.scipy.special.logsumexp for NumPy 2.0#8836
asi1024 merged 2 commits into
cupy:mainfrom
asi1024:fix-scp-logsumexp

Conversation

@asi1024

@asi1024 asi1024 commented Dec 17, 2024

Copy link
Copy Markdown
Member

Part of #8306.
Blocked by #8835.

@nopperl nopperl added to-be-backported Pull-requests to be backported to stable branch cat:numpy-compat Follow the NumPy/SciPy spec changes prio:high labels Dec 18, 2024
@asi1024

asi1024 commented Dec 20, 2024

Copy link
Copy Markdown
Member Author

/test mini

Comment on lines 63 to +68
if return_sign:
sgn = cp.sign(s)
s *= sgn
if s.dtype.char == 'c':
sgn = s / cp.where(s == 0, 1, cp.abs(s))
else:
sgn = cp.sign(s)
s = cp.abs(s)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have fixed the following changes to the SciPy 1.14 code. However, it seems that there have been further changes in SciPy 1.15.
https://github.com/scipy/scipy/blob/92d2a8592782ee19a1161d0bf3fc2241ba78bb63/scipy/special/_logsumexp.py#L122-L128

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

See #8869.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The cupyx.scipy.special CIs fail in SciPy 1.15, but I want to ensure that they work in NumPy 2.x. So, I plan to fix them for SciPy 1.15 in another PR. PTAL.

@asi1024

asi1024 commented Jan 9, 2025

Copy link
Copy Markdown
Member Author

/test mini

@asi1024 asi1024 marked this pull request as draft January 10, 2025 03:15
@asi1024 asi1024 marked this pull request as ready for review January 10, 2025 03:15
@asi1024

asi1024 commented Jan 10, 2025

Copy link
Copy Markdown
Member Author

@kmaehashi Ready to review.

kmaehashi
kmaehashi previously approved these changes Jan 15, 2025
@asi1024 asi1024 dismissed kmaehashi’s stale review January 15, 2025 06:30

The merge-base changed after approval.

@asi1024 asi1024 removed the to-be-backported Pull-requests to be backported to stable branch label Jan 15, 2025
@asi1024 asi1024 merged commit 82a835b into cupy:main Jan 15, 2025
@asi1024 asi1024 added this to the v14.0.0a1 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:numpy-compat Follow the NumPy/SciPy spec changes prio:high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants