This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Do not fuse shape-only producers.
ClosedPublic

Authored by gysit on Mar 4 2022, 2:15 AM.

Details

Summary

This revision introduces a heuristic to stop fusion for shape-only tensors. A shape-only tensor only defines the shape of the consumer computation while the data is not used. Pure producer consumer fusion thus shall not fuse the producer of a shape-only tensor. In particular, since the shape-only tensor will have other uses that actually consume the data.

The revision enables fusion for consumers that have two uses of the same tensor. One as input operand and one as shape-only output operand. In these cases, we want to fuse only the input operand and avoid output fusion via iteration argument.

Diff Detail

Event Timeline

gysit created this revision.Mar 4 2022, 2:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 2:15 AM
gysit requested review of this revision.Mar 4 2022, 2:15 AM
hanchung accepted this revision.Mar 23 2022, 8:02 PM
hanchung added inline comments.
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
352

s/ ̀̀/` ?

This revision is now accepted and ready to land.Mar 23 2022, 8:02 PM
gysit updated this revision to Diff 417865.Mar 24 2022, 3:14 AM
gysit marked an inline comment as done.

Address comment.

This revision was landed with ongoing or failed builds.Mar 24 2022, 3:27 AM
This revision was automatically updated to reflect the committed changes.