Page MenuHomePhabricator

[MLIR][Linalg] Generate the right type of load/store when lowering max/min pooling ops
ClosedPublic

Authored by bondhugula on Jul 2 2020, 1:05 PM.

Details

Summary

While lowering min/max pooling ops to loops, generate the right kind of
load/stores (std or affine) instead of always generating std
load/stores.

Diff Detail

Event Timeline

bondhugula created this revision.Jul 2 2020, 1:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2020, 1:05 PM
bondhugula marked an inline comment as done.Jul 2 2020, 1:07 PM
bondhugula added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
33

Open to suggestions on the best place to move these to.

bondhugula marked an inline comment as not done.Jul 2 2020, 2:02 PM
bondhugula updated this revision to Diff 275222.Jul 2 2020, 2:03 PM

Minor: drop extra space

ftynse added inline comments.Jul 3 2020, 1:29 AM
mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
33

Hmm, I would think that IndexedTy would somehow have the correct included. Would something like

IndexedValueTy output(op.output());
IndexedValueTy input(op.input());
Value lhs = output(indices.outputs);
Value rhs = input(indices.inputs);
//...
output(indices.outputs) = maxValue;

inside the function just work?

bondhugula marked 2 inline comments as done.Jul 3 2020, 9:29 AM

That works as well, thanks.

bondhugula updated this revision to Diff 275413.Jul 3 2020, 9:30 AM

Update per IndexValueType ctor.

ftynse accepted this revision.Jul 3 2020, 9:31 AM
This revision is now accepted and ready to land.Jul 3 2020, 9:31 AM
ftynse added a comment.Jul 3 2020, 9:31 AM

Thanks for the fix!

This revision was automatically updated to reflect the committed changes.