Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialects (tosa): initialize dialect and add Clamp and Rescale operation #3158

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

jorendumoulin
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.01%. Comparing base (80e2129) to head (10aa2b7).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3158   +/-   ##
=======================================
  Coverage   90.00%   90.01%           
=======================================
  Files         427      428    +1     
  Lines       53860    53890   +30     
  Branches     8344     8346    +2     
=======================================
+ Hits        48477    48507   +30     
  Misses       4036     4036           
  Partials     1347     1347           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jorendumoulin jorendumoulin marked this pull request as ready for review September 10, 2024 16:41
assembly_format = "$input attr-dict `:` `(` type($input) `)` `->` type($output)"


TOSA = Dialect("tosa", [ClampOp, RescaleOp], [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I assume there will be more ops

Suggested change
TOSA = Dialect("tosa", [ClampOp, RescaleOp], [])
TOSA = Dialect("tosa", [
ClampOp,
RescaleOp,
],
[]
)

Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the plan for TOSA? Are you using it in a project?

@jorendumoulin
Copy link
Collaborator Author

We're currently running some MLPerf Tiny benchmarks on SNAX, which are provided in tflite flatbuffers, and tensorflow has a conversion to TOSA. Most of mlir's builtin tosa-to-linalg lowerings are perfectly fine, but the layer-to-layer quantization rescaling comes out looking really ugly. As we have dedicated hardware for this rescaling, I'd like to lower this straight from these tosa ops.

@jorendumoulin jorendumoulin merged commit 16d8ea5 into main Sep 11, 2024
14 checks passed
@jorendumoulin jorendumoulin deleted the joren/tosa-clamp-rescale branch September 11, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants