This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Add tosa.conv3d lowering to Linalg
ClosedPublic

Authored by rsuderman on Jan 3 2023, 12:42 PM.

Details

Summary

Conv3D has an existing linalg operation for floating point. Adding a quantized
variant and corresponding lowering from TOSA. Numerical correctness was validated
using the TOSA conformance tests.

Diff Detail

Event Timeline

rsuderman created this revision.Jan 3 2023, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 3 2023, 12:42 PM
rsuderman requested review of this revision.Jan 3 2023, 12:42 PM
jpienaar added inline comments.Jan 4 2023, 10:59 AM
mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
113–129

Here and below please follow https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop (also prefer to pre-increment except if you need post-increment behavior)

122

Is getResult needed? I think there is implicit conversion if single result op.

365–368

Could you add a comment for these?

mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
481

The zero points offset, is that a restriction for when lowering this op that needs to be enforced? (I don't see anything here checking for that, so I assume its in the lowering).

mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-named.mlir
658

please add new line

rsuderman updated this revision to Diff 486393.Jan 4 2023, 2:17 PM
rsuderman marked 4 inline comments as done.

jpienaar@ comments

rsuderman marked an inline comment as done.Jan 4 2023, 2:19 PM
rsuderman added inline comments.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
113–129

I am a bit confused, I thought I had already done the evaluation preference using s?

Updated for pre-increment.

mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
481

The zero-point offsets are the addition IZp and KZp arguments to the operation.

rsuderman updated this revision to Diff 486397.Jan 4 2023, 2:30 PM
rsuderman marked an inline comment as done.

Re-add missing autogenerated header

rsuderman updated this revision to Diff 486398.Jan 4 2023, 2:33 PM

Remove UInt 16 issue

jpienaar accepted this revision.Jan 6 2023, 3:51 AM
This revision is now accepted and ready to land.Jan 6 2023, 3:51 AM
This revision was automatically updated to reflect the committed changes.