Skip to content

Lowering all operations through Linalg on tensors path #5043

Closed

Description

@MaheshRavishankar

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

  1. Convolution (That is being addressed in PR [CodeGen] Plumb conv vectorization through flow.dispatch.workgroups #4999)
  2. Pooling (or reduce_window)
  3. Torch Index Select

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.

Activity

  1. added
    codegen
    on Mar 10, 2021
  2. hanhanW commented on Mar 10, 2021

    @hanhanW
    Contributor

    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.

  3. MaheshRavishankar commented on Mar 10, 2021

    @MaheshRavishankar
    CollaboratorAuthor

    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.

  4. hanhanW commented on Mar 10, 2021

    @hanhanW
    Contributor
  5. MaheshRavishankar commented on Mar 10, 2021

    @MaheshRavishankar
    CollaboratorAuthor

    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

  6. benvanik commented on Mar 10, 2021

    @benvanik
    Collaborator

    (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)

  7. antiagainst commented on Mar 10, 2021

    @antiagainst
    Member

    Criteria to close:

    • Remove the command line options for enabling the linalg on tensors path and make it the default.
    • Make tests pass when linalg on tensors become the default.
  8. added a commit that references this issue on Apr 14, 2021
    20f61b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

codegen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions