Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable wrapping unconditionally for NumPy #170

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

asmeurer
Copy link
Member

NumPy 2.0 and 2.1 both have some incompatibilities with the array API (see
#167 and #164).

Closes #168.

asmeurer added 2 commits July 30, 2024 12:44
NumPy 2.0 and 2.1 both have some incompatibilities with the array API (see data-apis#167 and data-apis#164).

Closes data-apis#168.
@asmeurer
Copy link
Member Author

For now I'm going to just use the full wrappers for all versions of NumPy. This is actually what the CI has been testing all along. However, we might consider using a much reduced wrapper for NumPy 2.0+, especially if it can make a difference for performance.

Copy link
Contributor

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

thanks Aaron, LGTM!

Copy link
Contributor

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

I think you need to adjust

wrapped_libraries = ["cupy", "torch", "dask.array"]
all_libraries = wrapped_libraries + ["numpy", "jax.numpy", "sparse"]
import numpy as np
if np.__version__[0] == '1':
wrapped_libraries.append("numpy")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add array_namespace option to return wrapped if possible, else native
2 participants