This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add a greedy transform to map copies to threads efficiently.
ClosedPublic

Authored by nicolasvasilache on Jul 10 2023, 5:13 AM.

Details

Summary

This revision adds a new transformation to map a copy operation to a gpu grid of threads.
It implements a first heuristic that allows trading off coalesced accesses vs predication and occupancy.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Jul 10 2023, 5:13 AM
Herald added a project: Restricted Project. · View Herald Transcript
springerm accepted this revision.Jul 10 2023, 5:23 AM
springerm added inline comments.
mlir/include/mlir/Dialect/Linalg/TransformOps/GPUHeuristics.h
42

typo

mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
2312

::mlir::linalg::CopyOp for automatic op type checking

This revision is now accepted and ready to land.Jul 10 2023, 5:23 AM
rengolin added inline comments.
mlir/lib/Dialect/Linalg/TransformOps/GPUHeuristics.cpp
53

Nit: I'd predicate this on favorPredicate to avoid computing it twice if favorPredicate == 1.

nicolasvasilache marked 3 inline comments as done.

Address.

mlir/lib/Dialect/Linalg/TransformOps/GPUHeuristics.cpp
53

ah thanks!

Add another test case and fix non-predicated behavior.

Refactor in order to reuse implementations.

Simplify naming of methods.

This revision was landed with ongoing or failed builds.Jul 10 2023, 9:16 AM
This revision was automatically updated to reflect the committed changes.