This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Adding support for linalg_matmul with tensors.
ClosedPublic

Authored by nicolasvasilache on Jan 31 2020, 11:43 AM.

Details

Summary

This revision provides 2 versions of matmul with tensors to account for the differences in buffer vs value semantics:

  1. C(i, j) = sum_{r_k} A(i, r_k) * B(r_k, j)
  2. D(i, j) = C(i, j) + sum_{r_k} A(i, r_k) * B(r_k, j)

Diff Detail

Event Timeline

Unit tests: unknown.

clang-tidy: unknown.

clang-format: unknown.

Build artifacts: console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

antiagainst accepted this revision.Jan 31 2020, 12:03 PM

Neat!

mlir/test/EDSC/builder-api-test.cpp
1032

Do we want to use ShapedType::kDynamicSize for these magic numbers?

1042

I'm not sure about the conventions here but I'd typically prefer to have small and focused tests so it's easier to maintain and upate.

This revision is now accepted and ready to land.Jan 31 2020, 12:03 PM
nicolasvasilache marked 4 inline comments as done.Jan 31 2020, 12:57 PM
nicolasvasilache added inline comments.
mlir/test/EDSC/builder-api-test.cpp
1032

good point, I'll update everything in the test file in a followup CL.

1042

Right, so the tradeoff is bigger test vs boilerplate copy-pasta.
I'd prefer bigger test, up to some (undetermined) reasonable limit, at this time the test goes from 3 to 5 ops.
This falls into my reasonable category but I'll split if you have a strong preference for the copy-pasta.

This revision was automatically updated to reflect the committed changes.
nicolasvasilache marked 2 inline comments as done.