This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Update tosa.avg_pool2d for bit-exact TOSA behavior
ClosedPublic

Authored by rsuderman on Jan 9 2023, 5:40 PM.

Details

Summary

The normalization component of average pool has a very specific
rounding behavior for compouting the division for floating
point values. Updated so that the bit-exact version is implemented.

Also includes a fix for computing the stride part of the average pool
operation.

Diff Detail

Event Timeline

rsuderman created this revision.Jan 9 2023, 5:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 5:40 PM
rsuderman requested review of this revision.Jan 9 2023, 5:40 PM
jpienaar accepted this revision.Jan 23 2023, 7:10 PM

Nice! Given this is very exact lowering required for numerics the test is fine, else I'd be conserned too much of change test. (when I see such lowering I keep thinking I want a couple of convenience wrappers ...)

mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
881–883

If this result is never used, consider just assigning the casted version (the suffix initially confused me)

907–941

Micro nit: Perhaps say "// Compute:" or some such, initially I thought this was left over from debugging rather than documnetation of what follows.

This revision is now accepted and ready to land.Jan 23 2023, 7:10 PM

Fixed some minor nits

rsuderman marked 2 inline comments as done.

Some more minor nits

Removed unneeded colons in comments

This revision was landed with ongoing or failed builds.Jan 25 2023, 10:52 AM
This revision was automatically updated to reflect the committed changes.