Skip to content

More llvm-external-projects/iree-compiler-api into the main part of the project #8597

Closed

Description

@stellaraccident

The sub-tree llvm-external-projects/iree-compiler-api is funny because it exposes C and Python APIs consistent with the rest of the LLVM derived projects and is fairly tightly coupled to the LLVM build system in a way that the "internal" parts of IREE are not. While this makes it "somewhat weird", I think that we can integrate it better into the main project vs it being this completely separate side thing.

I would like to move it into iree/compiler/api. It would still be special from a CMake and Bazel perspective, but I could make it a lot better integrated and uniform if put there and always included as part of IREE vs the state it is in now where it can either be top-level or a sub-project (recent fixes have made IREE itself a lot more well behaved to depend on, so the benefits of having a separate way in are obsolete). It would also open us up to be able to use the APIs from the main part of the project (i.e. for samples, tools, etc), which would be a layering improvement.

Activity

  1. stellaraccident commented on Mar 19, 2022

    @stellaraccident
    CollaboratorAuthor

    @benvanik @ScottTodd objections/thoughts?

  2. ScottTodd commented on Mar 21, 2022

    @ScottTodd
    Member

    recent fixes have made IREE itself a lot more well behaved to depend on, so the benefits of having a separate way in are obsolete

    that's good to hear!

    I haven't been following the details too closely with respect to how each repo/project interacts, so a primer on the current state of things and the ideal end state would help me there, especially seeing the ml_program proposal, PRs like #8581 and #8575, and continued work on "linalg.ext".

    Some questions I have:

    • What code would remain in llvm-external-projects/?
    • Would all frontends live upstream and target IREE public dialects, or do we expect to still have IREE-specific importers? It looks like the TMTensor stuff is heading a similar direction to the TOSA/MHLO importers in iree/compiler/InputConversion/, while iree-jax is mostly upstream / in other repos with just MHLO/JAX bits in the IREE repo.
  3. stellaraccident commented on Mar 21, 2022

    @stellaraccident
    CollaboratorAuthor

    recent fixes have made IREE itself a lot more well behaved to depend on, so the benefits of having a separate way in are obsolete

    that's good to hear!

    I haven't been following the details too closely with respect to how each repo/project interacts, so a primer on the current state of things and the ideal end state would help me there, especially seeing the ml_program proposal, PRs like #8581 and #8575, and continued work on "linalg.ext".

    There are a number of moving targets, but in general, and apart from iree-compiler-api, everything falls into either a) on an upstream (or internalize) in the 6-9 months timeframe, or b) may exist indefinitely in some form but benefit from being dependency isolated and usable standalone.

    • LinalgExt: Needs to go upstream, likely in the form of an accepted tiling interface and specific ops in the tensor dialect. Probably 3-6 months out.
    • iree_input: Will likely always exist for the special parts but we are trying to standardize the common bits upstream. Should be separate and able to depend on for the duration of it being useful.
    • iree_transform: There is an active RFC to upstream, but the full vision is quite involved and could easily take 6 months to resolve.
    • tm_tensor: This is developed "iree-dialects" style in torch-mlir for ops not representable otherwise. It currently contains scan/scatter, which may be obsoleted by linalg_ext going upstream. However, it will likely grow over time as it is torch-mlir's "overflow area" in the same way as iree-input is IREE's "overflow area" (but going the other way).

    iree-compiler-api is weird because it is wholly owned by IREE, not designed to be used externally but is closely tied to the LLVM build system. That last part is non-optional and why we sorted it with the other things that also share that characteristic. But it would make more sense being an isolated part of the iree/compiler tree that just happens to be "weird" from a build integration perspective.

    Some questions I have:

    • What code would remain in llvm-external-projects/?
    • Would all frontends live upstream and target IREE public dialects, or do we expect to still have IREE-specific importers? It looks like the TMTensor stuff is heading a similar direction to the TOSA/MHLO importers in iree/compiler/InputConversion/, while iree-jax is mostly upstream / in other repos with just MHLO/JAX bits in the IREE repo.

    Hard to say. In the far future, I would like this inverted and for frontends to provide their own APIs and importers. We are quite far from that future in detail.

  4. added a commit that references this issue on Apr 18, 2022
    4b0f28c
  5. added a commit that references this issue on Apr 18, 2022
    6012859
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions