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

[sparse] test out-of-bound csr/coo indices on GPU #14536

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

jakevdp
Copy link
Collaborator

@jakevdp jakevdp commented Feb 16, 2023

I found that the coo lowering rules don't offer any good avenue for working with padded sparse representations because (1) if out-of-bound indices are present it leads to out-of-bound memory access, and (2) if duplicate indices are present, cusparse is inconsistent on whether it treats those duplicated indices as summed, or as overwriting each other.

For this reason, I don't think there's any way to devise any efficient padded representation that will work correctly with all lowering rules.

The solution is to add another static flag that tracks whether the matrix is padded, and only lower to GPU when that is known to be false.

@jakevdp jakevdp added the pull ready Ready for copybara import and testing label Feb 16, 2023
@jakevdp jakevdp self-assigned this Feb 16, 2023
@jakevdp jakevdp marked this pull request as draft February 16, 2023 21:00
@jakevdp jakevdp force-pushed the coo-oob branch 3 times, most recently from 5bd03fa to c6694b5 Compare February 17, 2023 00:02
@jakevdp jakevdp marked this pull request as ready for review February 17, 2023 00:49
@copybara-service copybara-service bot merged commit c467d84 into jax-ml:main Feb 17, 2023
@jakevdp jakevdp deleted the coo-oob branch February 17, 2023 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant