Added support for broadcasting size-1 dimensions for TOSA elementwise
operations.
Details
- Reviewers
rriddle silvas - Commits
- rGc19a4128095d: [MLIR][TOSA] Tosa elementwise broadcasting
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
There is a typo in the commit description: elemtnwise
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
154–155 | The way the error message is worded makes me think that this should be an assert. | |
160 | Cache end iterators to avoid recomputing during the loop. https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop | |
187 | nit: Spell out auto here. Type is the same number of characters as auto. | |
194 | nit: Drop trivial braces here. | |
205 | Same comment here on braces, and caching the number of results. Although in this case, seems better to do something like: indexingMaps.append(operation->getNumResults(), rewriter.getMultiDimIdentityMap(nloops)); |
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir | ||
---|---|---|
17 | add tests |
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir | ||
---|---|---|
17 | I revamped the previous failing broadcasting test. Updated to include additional broadcasting tests. |
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
155 | add assertion message. | |
163 | Tosa op verifiers should enforce this already. Can be deleted. | |
181–182 | Now it supports broadcast :) | |
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir | ||
58–68 | Capture with filecheck. Example of "non-local" capture requires "$": https://github.com/llvm/llvm-project/blob/main/mlir/test/Conversion/SCFToGPU/parallel_loop.mlir#L18 |
The way the error message is worded makes me think that this should be an assert.