Skip to content

Conversation

@IanWood1
Copy link
Contributor

There are cases where two ops can't be fused as it would result in use-def violation (see the diagram below). Currently, they are still placed in the same fusion group. This means that the consumer gets marked by the analysis as being in a fusion group causing it to potentially miss out on fusion opportunities. This change moves this check so that it occurs during the analysis and modifies the old check to error out.

    A (in fusion group)
    |  \
    |   \
    |    v
    |    B (unfusable consumer of A)
    |   /
    |  /
    v v
    C (trying to fuse with A)

// CHECK: %[[DISPATCH1:.+]] = flow.dispatch.region
// CHECK: %[[GENERIC2:.+]] = linalg.generic
// CHECK-SAME: ins(%[[EXPAND_SHAPE]], %[[DISPATCH]]#0 :
// CHECK: util.return %[[GENERIC2]]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewers: this checks that hasTransitiveDependencyOnFusionGroup prevents the fusion since the old check will now error out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant