Skip to content

Commit

Permalink
[Dispatch] Disable scatter fusion with producers (#19565)
Browse files Browse the repository at this point in the history
Backends don't currently support scatter fusion and will silently
compile incorrect code. This should be turned off in order to prevent
backends from generating incorrect results. I don't think any users are
running into this currently, but its best to keep it off for now.
Similar to #19535 but for both
`indices` and `updates`.

---------

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
  • Loading branch information
IanWood1 authored Dec 27, 2024
1 parent d746a57 commit a43d893
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,8 @@ isFusableWithProducer(OpOperand &operand,
}

// Don't fuse attention with it's producer
if (isa<IREE::LinalgExt::AttentionOp>(consumer)) {
// TODO: Enable scatter fusion when supported by backends.
if (isa<IREE::LinalgExt::AttentionOp, IREE::LinalgExt::ScatterOp>(consumer)) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ util.func public @linalgext_scatter_dispatch() -> tensor<8192x16x8x128xf32> {
}

// CHECK-LABEL: util.func public @linalgext_scatter_dispatch
// CHECK-DAG: %[[INDICES:.+]] = flow.dispatch.region
// CHECK-DAG: %[[UPDATE:.+]] = flow.dispatch.region
// CHECK: %[[RESULT:.+]] = flow.dispatch.region
// CHECK: %[[INDICES:.+]] = linalg.generic
// CHECK: %[[UPDATE:.+]] = linalg.generic
// CHECK: %[[SCATTER_RESULT:.+]] = iree_linalg_ext.scatter
// CHECK-SAME: ins(%[[UPDATE]], %[[INDICES]] : tensor<4x1x16x8x128xf32>, tensor<4x1xi32>)
// CHECK: flow.return %[[SCATTER_RESULT]]
Expand Down

0 comments on commit a43d893

Please sign in to comment.