catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Can we remove assertion that indices are unique and sorted for scatter ops?

Open joeycarter opened this issue 4 months ago • 3 comments

Context: PR for testing purposes. Can we remove the assertion that indices are unique and sorted for scatter ops? I've added tests that qjit compile jnp.bincount, which, when lowered, call stablehlo.scatter with indices_are_sorted = false and unique_indices = false.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

joeycarter avatar Jul 04 '25 19:07 joeycarter

Is there any action item here?

paul0403 avatar Jul 17 '25 15:07 paul0403

Is there any action item here?

Not right now, I don't think these asserts are blocking anyone at the moment. But I'm happy to keep this PR open in case it becomes useful in the future and we're confident it's safe.

joeycarter avatar Jul 17 '25 17:07 joeycarter

Just for some context, I asked here https://github.com/orgs/openxla/discussions/129 but there is still no answer. I again think that our lowering since it is sequential and unoptimized is probably the safest approach, but yes, we do need time to reason about this operation's semantics.

erick-xanadu avatar Jul 17 '25 18:07 erick-xanadu