You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lowering all operations through Linalg on tensors path #5043
The initial bring up of Linalg on tensors focused on supporting a few operations needed to get MobileBert running. There are a few remaining. The full list of CPU ops needed to reach compatibility with the buffer path are here for CPU and here for GPUs. The main ones remaining are
After these have all been verified to run on GPU and CPU, all the supported models in integrations/tensorflow need to be tested and moved over to use Linalg on tensors path. Then the Linalg on buffers path can be deprecated.
I'm surprised that we can get MobilBert running without torch_index_select. I remembered there is a torch_index_select op in the model. I was thinking to work on torch_index_select op, so we can upstream it to MHLO repo, but I was afraid to break MobileBert.
The big difference in torch_indexe_select op is the init_tensor is derived from shaped dialect, not operands. I will take a look on the op, and see if it is easy to make it work on the new path.
I have it working locally (so I think it doesnt need torch_index_select). I think the version in Mobilbert is a gather? I am about to send a PR for a few more ops, then I'll confirm again.
Ok, Ill send the PR. Here is the WIP commit (MaheshRavishankar@3916b48). Rebase seems to hit a assertion failure in Dot General conversion. Looking into it now
(as an aside, it'd be nice to move that pass to integrations/tensorflow/iree_tf_compiler/TF so we have fewer places dramatically changing HLO IR in the main pipeline - would be a good cleanup after linalg on tensors is ready and less code is actively changing)
Activity
hanhanW commentedon Mar 10, 2021
I'm surprised that we can get MobilBert running without torch_index_select. I remembered there is a torch_index_select op in the model. I was thinking to work on torch_index_select op, so we can upstream it to MHLO repo, but I was afraid to break MobileBert.
The big difference in torch_indexe_select op is the init_tensor is derived from shaped dialect, not operands. I will take a look on the op, and see if it is easy to make it work on the new path.
MaheshRavishankar commentedon Mar 10, 2021
I have it working locally (so I think it doesnt need torch_index_select). I think the version in Mobilbert is a gather? I am about to send a PR for a few more ops, then I'll confirm again.
hanhanW commentedon Mar 10, 2021
A gather op will be legalized to a torch_index_select op in HLOToHLOPreprocessing.
https://github.com/google/iree/blob/4ec98bba6b67ba492a74504dbcd249d7f0bbfd10/iree/compiler/Dialect/Flow/Transforms/HLOToHLOPreprocessing.cpp#L816
I'm happy to take a look once you send out the PR!
MaheshRavishankar commentedon Mar 10, 2021
Ok, Ill send the PR. Here is the WIP commit (MaheshRavishankar@3916b48). Rebase seems to hit a assertion failure in Dot General conversion. Looking into it now
benvanik commentedon Mar 10, 2021
(as an aside, it'd be nice to move that pass to
integrations/tensorflow/iree_tf_compiler/TFso we have fewer places dramatically changing HLO IR in the main pipeline - would be a good cleanup after linalg on tensors is ready and less code is actively changing)antiagainst commentedon Mar 10, 2021
Criteria to close:
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path.
Plumb pooling ops through Linalg on tensors path. (#5136)
Set IREE codegen to Linalg on tensors by default.
Set IREE codegen to Linalg on tensors by default.
Set IREE codegen to Linalg on tensors by default. (#5375)