openxla / shardy

MLIR-based partitioning system
Apache License 2.0
45 stars 7 forks source link

Change sharding rule of @PartialReduce custom call so we don't propagate sideways between the operands or results along the reduction dim. #206

Closed copybara-service[bot] closed 2 weeks ago

copybara-service[bot] commented 2 weeks ago

Change sharding rule of @PartialReduce custom call so we don't propagate sideways between the operands or results along the reduction dim.

This is because the op needs the reduction dim to be fully replicated, and therefore even if the 1st operand is sharded along that dim, it doesn't make sense to propagate the sharding to the 2nd operand (iota) as we will need to all gather both anyways.

A better solution is to do what is done for sort, and try to all-to-all the sharding to another dimension, in which case the other operand will need to be sharded in the same way (that doesn't have to happen during propagation though).