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).
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).