This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Simplifying the SplitReduction logic that uses the control to get the dimension where the extra parallel dimension is inserted
AcceptedPublic

Authored by vmurali on Nov 4 2022, 9:03 PM.

Details

Summary

Currently, the innerParallel and non innerParallel strategies use two different ways to fix for where the extra loop is inserted and where the extra dimension for the intermediate result is inserted - innerParallel adds the extra (parallel) loop right after the pre-existing reduction loop, whereas non innerParallel adds the reduction loop in the successor to the index supplied by control, and the parallel loop in the index supplied by the control. The semantics of the index supplied by the control is supposed to only control where the extra tensor dimension is inserted in the intermediate tensor. Conflating this index with where the reduction (and parallel) loops are inserted leads to more complex (and confusing) logic overall. This differential removes conflating the two uses of the index, and keeps the reduction and parallel loops in the same vicinity and uses the supplied index to only determine the position of the extra tensor dimension. It also simplifies the code by merging the two strategies in a lot more places.

Diff Detail

Event Timeline

vmurali created this revision.Nov 4 2022, 9:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2022, 9:03 PM
vmurali requested review of this revision.Nov 4 2022, 9:03 PM
vmurali edited the summary of this revision. (Show Details)Nov 4 2022, 9:04 PM
vmurali retitled this revision from [mlir] Simplifying the SplitReduction logic that uses the control to get the dimension where the extra parallel dimension is inserted to [mlir][linalg] Simplifying the SplitReduction logic that uses the control to get the dimension where the extra parallel dimension is inserted.Nov 4 2022, 9:23 PM
ThomasRaoux accepted this revision.Nov 17 2022, 1:38 PM

LGTM, thanks!

This revision is now accepted and ready to land.Nov 17 2022, 1:38 PM
vmurali updated this revision to Diff 476239.Nov 17 2022, 2:19 PM