This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Align tensor rank specifications with current spec
ClosedPublic

Authored by sjarus on May 21 2021, 4:55 PM.

Details

Summary

Deconstrains several TOSA operators to align with the current TOSA spec, including all the elementwise ops.
Note: some more ops are under consideration for further cleanup; they will follow once the spec has been updated.

Diff Detail

Event Timeline

sjarus created this revision.May 21 2021, 4:55 PM
sjarus requested review of this revision.May 21 2021, 4:55 PM
stellaraccident accepted this revision.May 23 2021, 6:48 PM

Nice improvement - thanks. Do you need me to land this for you?

This revision is now accepted and ready to land.May 23 2021, 6:48 PM

Can you upload patches with full context please? Right now I can't see which ops are modified here.

Can you upload patches with full context please? Right now I can't see which ops are modified here.

I had a similar question but was able to infer based on eliminating the entire classes of restrictions that had been lifted from the spec.

I don't know phab well enough to know why it can't show context (or how to recommend uploading differently) -- Mehdi, do you know?

Can you upload patches with full context please? Right now I can't see which ops are modified here.

I had a similar question but was able to infer based on eliminating the entire classes of restrictions that had been lifted from the spec.

I don't know phab well enough to know why it can't show context (or how to recommend uploading differently) -- Mehdi, do you know?

I have the same question. Scrolling down the phab content it does look strange that I can't expand to see the full code. As background, I just did git format-patch -1 HEAD and then uploaded the patch on the phab web interface.

sjarus updated this revision to Diff 347307.May 23 2021, 9:25 PM
sjarus edited the summary of this revision. (Show Details)

Trying using arc diff --update from commandline.

Ok now it seems to look a lot better ? If this is alright, please land it on my behalf - it doesn't seem I can do so myself.

Ah, you were using the web interface. The docs have extra flags that must be included for full context: https://llvm.org/docs/Phabricator.html#id5

I always use arc diff.

sjarus added a comment.EditedMay 23 2021, 9:32 PM

Ah, you were using the web interface. The docs have extra flags that must be included for full context: https://llvm.org/docs/Phabricator.html#id5

I always use arc diff.

Thanks for the information! I'll probably stick to using arc too, from now on. I've updated our internal documentation to recommend its use as well.

Thanks for updating the patch. I re-reviewed this and cross referenced with the spec, and lgtm. Left one comment for the future. Landing as-is.

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
504

Some feedback (not for this change): Reviewing this prompted me to look the operator up in the spec and hunt around for a corresponding floating point division. The verbiage in the spec "Only used for integer operation. Floating point divide should use RECIPROCAL and MUL." is pretty salient and (imo) would be valuable to include here, given that keeping this integer only was an explicit design choice (and naming/convention-wise is not obvious).