Skip to content

Revert "Move tensor->flow passes to Dialect/Flow/Conversion/TensorToFlow." - #6648

Merged
ScottTodd merged 1 commit into
mainfrom
revert-6586-tensor-to-flow
Aug 4, 2021
Merged

ScottTodd merged 1 commit into
mainfrom
revert-6586-tensor-to-flow

Conversation

@ScottTodd

Copy link
Copy Markdown
Member

Reverts #6586

This defeated linalg fusion, caused a ~24% performance regression. Needs some extra work to refactor without the regression.

@google-cla google-cla Bot added the cla: yes label Aug 4, 2021
@benvanik
benvanik self-requested a review August 4, 2021 21:26
@ScottTodd
ScottTodd enabled auto-merge (squash) August 4, 2021 21:27
@ScottTodd
ScottTodd merged commit 5a86c95 into main Aug 4, 2021
@ScottTodd
ScottTodd deleted the revert-6586-tensor-to-flow branch August 4, 2021 22:11
ScottTodd added a commit that referenced this pull request Aug 4, 2021
ScottTodd added a commit that referenced this pull request Aug 5, 2021
Reverts #6648, rolling-forward #6586.

First commit is the pure revert, second is a set of proposed fixes for the performance regression. The single pass (with a true/false option) is now split further:
* `createConvertTensorOpsPass`
* `createConvertLinalgTensorOpsPass(true)`
* `createConvertLinalgTensorOpsPass(false)`

---

This gets the original change closer to an NFC (but it is still not an NFC).

Before this change:

| stage | patterns |
| --- | --- |
| `buildCommonInputConversionPassPipeline` | `tensor::CastOp`, `tensor::FromElementsOp` |
| Flow, before DispatchRegionFormation | `tensor::InsertSliceOp`, `tensor::ExtractSliceOp`, <br> `linalg::TensorCollapseShapeOp`, `linalg::TensorExpandShapeOp` |
| Flow, after DispatchRegionFormation | `linalg::FillOp` |

After this change:

| stage | patterns |
| --- | --- |
| `buildCommonInputConversionPassPipeline` | (deleted) |
| Flow, before DispatchRegionFormation | `tensor::CastOp`, `tensor::FromElementsOp`, <br>`tensor::InsertSliceOp`,  `tensor::ExtractSliceOp`, <br>`linalg::TensorCollapseShapeOp`, `linalg::TensorExpandShapeOp` |
| Flow, after DispatchRegionFormation | `linalg::FillOp` |

Passes on `linalg` ops are the same, but two `tensor` ops are now converted after linalg fusion, rather than at input conversion time. The first version of this change had those `linalg` ops converted during the "common input conversion pipeline".
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.

2 participants