GithubHelp home page GithubHelp logo

Comments (5)

lipracer avatar lipracer commented on July 27, 2024

I'm sorry I didn't participate in the meeting. I can't offer any constructive suggestions.

from mlir-hlo.

jpienaar avatar jpienaar commented on July 27, 2024

StableHLO will be a purely interchange format as positioned at the moment yes (e.g., no transformations on it). Given the goal of stable interchange, it should be easy to vendor, provides some backward and forward compatibility (at least in conjunction with MLIR bytecode format, not APIs yet, details TBD), and reduce the hard code linkage (e.g., it could enable decoupling some of the coordination of git rev bumping).

Targeting StableHLO rather than MHLO from ONNX has some advantages. And for first while, the switch could be at "sed" level. I would suggest waiting a little bit until there is a clearer signal here and then doing cost-benefit analysis. But goal is to reduce cost for frontends/interchange only interops. [I'm very excited about bytecode, I think it'll flush out some issues here too, but I'd let things bake a bit until "desired temperature" before incurring cost - while in same breath I should add that unstable interop is an ongoing cost]

from mlir-hlo.

burmako avatar burmako commented on July 27, 2024

Thank you, Jacques! I agree that it is prudent to experiment with StableHLO before making the decision either way, and I'd love to assist however I can.

In the next 2-3 weeks, we're planning to turn StableHLO into a drop-in replacement for MHLO by adding the currently missing Python bindings and Bazel build, introducing the StableHLO <=> MHLO conversion, and then landing all that in MLIR-HLO. (More details in https://github.com/openxla/stablehlo/issues).

Once that happens, experimenting with StableHLO will be as easy as changing the CMake/Bazel target you depend on (from MHLO to StableHLO) and making some textual replacements. By that time, I expect we'll also have the stability guarantees documented, so that it is clear what the users can rely upon.

As far as the current positioning goes (e.g. the "no transformations" part), this is a fairly new area for all of us, so there is still quite a bit of flexibility. E.g. if it becomes apparent that it would be beneficial for StableHLO to support transformations, then we could revisit this. I imagine that a good way of validating this would be experimental evaluation, and we'll be working hard to make it as easy as possible (as discussed above).

from mlir-hlo.

AlexandreEichenberger avatar AlexandreEichenberger commented on July 27, 2024

Thanks @jpienaar and @burmako for keeping track of this new and exciting development. Stable interface (once stable :-) sounds like a good fit for this effort, I appreciate your careful evaluation on the matter.

from mlir-hlo.

burmako avatar burmako commented on July 27, 2024

@AlexandreEichenberger It took one week longer than initially expected, but the goals that were set in my previous comment have just been achieved. Earlier today we landed a bidirectional converter between StableHLO and MHLO: b9a0847, which concludes bootstrapping StableHLO as a software product.

At the moment, StableHLO includes all MHLO ops except the following 10 ops: AddDependencyOp, AsyncDoneOp, AsyncStartOp, AsyncUpdateOp, BitcastOp, CopyOp, DomainOp, FusionOp, PartitionIdOp, XlaRngGetAndUpdateStateOp. 9 of these ops aren't used by JAX, ONNX-MLIR, TensorFlow and Torch-MLIR, so we didn't include them in StableHLO. The 10th - CopyOp - immediately folds into its operand, so we didn't include it either.

In a nutshell, StableHLO can now be used as a drop-in replacement for MHLO, with the added benefit of guaranteed backward and forward compatibIlity - see the RFC about this: openxla/stablehlo#115.

In the cases when MHLO is still needed, e.g. to run an MHLO pass or to lower to Linalg, it's just one hop away thanks to the StableHLO <=> MHLO conversions. We designed these conversions to be super robust (3.5k+ loc of exhaustive FileCheck tests + continuous integration that makes sure that these tests stay in sync with StableHLO and MHLO evolution), and we'll be maintaining them as part of MLIR-HLO moving forward.

I'll be talking about this at the OpenXLA community meeting tomorrow 9/20 at 8am PT (see invite), and I could give a presentation at one of the upcoming ONNX-MLIR meetings too. Please let us know what you think!

from mlir-hlo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.