Skip to content
Discussion options

You must be logged in to vote

The issue is that "extracting values from sparse arrays" is fundamentally a set-join operation, and XLA has no primitives for set arithmetic. As a result, BCOO has to construct the operation using available primitives. For lack of a better option, it essentially does jnp,any(query[:, None] = indices[None, :], -1), which has very poor memory scaling as the size of the query and indices increase.

I don't really have any better suggestions (if I did, I would have put them in the BCOO implementation!) but you may be able to do better for your specific application by writing the low-level index manipulations directly. For example, it looks like you're only concerned with extracting values alon…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@adambomandel
Comment options

@adambomandel
Comment options

@jakevdp
Comment options

@adambomandel
Comment options

@jakevdp
Comment options

Answer selected by adambomandel
Comment options

You must be logged in to vote
2 replies
@jakevdp
Comment options

@DoTulip
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants