This commit adds tosa erf operator and its lowering
to math lib functions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Discussion on tosa spec : https://discuss.mlplatform.org/t/adding-erf-operator-to-tosa/189/9
Looks good overall.
mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td | ||
---|---|---|
471 | Mathjax is supported by Hugo (well and Github markdown, but the former is more important as that's what the mlir.llvm.org website is generated with), so lets switch to that here. Some plumbing may be needed mlir.llvm.org side, but can be done in follow up. | |
473 | Why do we need to say this as part of the op rather than this be some lowering pattern? |
Agreed that this looks good, with only changes in the description that seem to be needed. As mentioned inline, part of the blame lies on the spec, and I'm going to try to correct the spec to allow legalizations to choose the best option, listing the existing version as an option rather than appearing to be required. (Let me know if there is benefit to the spec as is)
mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td | ||
---|---|---|
473 | I think this is matching the existing descriptions for sigmoid and tanh, and matches what is described in the TOSA spec. On Friday I was working on how to update the spec. The specification takes what is probably too strong a statement on how the integer versions of tanh/sigmoid are defined. As you describe, it should be up to the legalizations to define the 'best' legalizations, probably based on the quantization limits. The TensorFlow Lite legalizations we've added do this already. |
I've changed the equation now. see if it looks good.
I'll also need help landing the patch as well :).
mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td | ||
---|---|---|
473 | Yea, Im being consistent with others for now. |
Mathjax is supported by Hugo (well and Github markdown, but the former is more important as that's what the mlir.llvm.org website is generated with), so lets switch to that here. Some plumbing may be needed mlir.llvm.org side, but can be done in follow up.