Repository navigation
Adapt Tile+Fuse to handle multi-result dispatches. - #12020
MaheshRavishankar merged 1 commit into
Conversation
The tile and fuse transformation upstream has been split into its individual steps allowing caller more control in terms of which producers to fuse and which values to yield from within the tiled loop nest. This moves IREEs tile+fuse to use these components, allowing for handling of multi-result dispatches. Currently multi-result dispatches do seem to cause bufferization issues. IREE currently doesnt form such dispatches by default, but will do so with PR iree-org#11980. The bufferization issue is tracked in Also fixes iree-org#11505.
Abbreviated Android Benchmark Summary@ commit 81df2e1a117b79e873b106cd105f88ea08ca817c (vs. base f19cc5b977e5210411068c820dab688cec5cc377) Regressed Latencies 🚩
[Top 3 out of 4 results showed] Improved Latencies 🎉
[Top 3 out of 5 results showed] Regressed Compilation Times 🚩
[Top 3 out of 88 results showed] Improved Compilation Times 🎉
[Top 3 out of 14 results showed] For more information: |
| /// Starting from `op` walk all operands backwards to find all | ||
| /// potentially fusable operations, i.e. operations that implement | ||
| /// the `TilingInterface`. | ||
| llvm::SmallDenseSet<Operation *> static collectTiledAndFusedOps(Operation *op) { | ||
| SmallVector<Operation *> worklist; | ||
| llvm::SmallDenseSet<Operation *> producers; | ||
| worklist.push_back(op); | ||
| producers.insert(op); | ||
| while (!worklist.empty()) { | ||
| Operation *current = worklist.pop_back_val(); | ||
| for (OpOperand &operand : current->getOpOperands()) { | ||
| Operation *producer = operand.get().getDefiningOp(); | ||
| if (!producer || !isa<TilingInterface>(producer) || | ||
| producers.count(producer)) | ||
| continue; | ||
| worklist.push_back(producer); | ||
| producers.insert(producer); | ||
| } | ||
| } | ||
| return producers; | ||
| } |
There was a problem hiding this comment.
Do we refactor this to scf/utils.h? I've seen a similar implementation in TestTilingInterface.cpp?
There was a problem hiding this comment.
Thats a bit hard. The constraints are a bit involved to spell out, by IREE satisfies those by construction. Basically you need to be doing tile+fuse without redundancy in the producer tiles computed within the consumer tile loop. We have that requirement anyway. This is why the test is basically capturing and testing in MLIR this requirement, and we use that directly here in IREE. I think over time we will get a better idea of how to write those constraints upstream, in which case we can then move to use the upstream methods.
There was a problem hiding this comment.
thanks for the details, SGTM!
dcaballe
left a comment
There was a problem hiding this comment.
Really excited to see this!
The tile and fuse transformation upstream has been split into its individual steps allowing caller more control in terms of which producers to fuse and which values to yield from within the tiled loop nest. This moves IREEs tile+fuse to use these components, allowing for handling of multi-result dispatches. Currently multi-result dispatches do seem to cause bufferization issues. IREE currently doesnt form such dispatches by default, but will do so with PR iree-org#11980. The bufferization issue is tracked in iree-org#12019 Also fixes iree-org#11505.
The tile and fuse transformation upstream has been split into its individual steps allowing caller more control in terms of which producers to fuse and which values to yield from within the tiled loop nest. This moves IREEs tile+fuse to use these components, allowing for handling of multi-result dispatches. Currently multi-result dispatches do seem to cause bufferization issues. IREE currently doesnt form such dispatches by default, but will do so with PR iree-org#11980. The bufferization issue is tracked in iree-org#12019 Also fixes iree-org#11505.
The tile and fuse transformation upstream has been split into its individual steps allowing caller more control in terms of which producers to fuse and which values to yield from within the tiled loop nest. This moves IREEs tile+fuse to use these components, allowing for handling of multi-result dispatches. Currently multi-result dispatches do seem to cause bufferization issues. IREE currently doesnt form such dispatches by default, but will do so with PR #11980. The bufferization issue is tracked in #12019 Also fixes #11505.
The tile and fuse transformation upstream has been split into its individual steps allowing caller more control in terms of which producers to fuse and which values to yield from within the tiled loop nest. This moves IREEs tile+fuse to use these components, allowing for handling of multi-result dispatches. Currently multi-result dispatches do seem to cause bufferization issues. IREE currently doesnt form such dispatches by default, but will do so with PR iree-org#11980. The bufferization issue is tracked in iree-org#12019 Also fixes iree-org#11505.
The tile and fuse transformation upstream has been split into its individual steps allowing caller more control in terms of which producers to fuse and which values to yield from within the tiled loop nest. This moves IREEs tile+fuse to use these components, allowing for handling of multi-result dispatches.
Currently multi-result dispatches do seem to cause bufferization issues. IREE currently doesnt form such dispatches by default, but will do so with PR #11980. The bufferization issue is tracked in #12019
Also fixes #11505.