Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a public C++ API for StableHLO #30

Open
joker-eph opened this issue Aug 22, 2022 · 5 comments
Open

Create a public C++ API for StableHLO #30

joker-eph opened this issue Aug 22, 2022 · 5 comments

Comments

@joker-eph
Copy link
Contributor

At the moment, other than the ODS auto-generated builder, there is no API to create a StableHLO graph from C++. This means that a change in MLIR can change the C++ API.

Also there is no "graph" container defined yet.

@burmako burmako changed the title We need a public C++ API for StableHLO Create a public C++ API for StableHLO Aug 22, 2022
@GleasonK
Copy link
Member

GleasonK commented Sep 6, 2022

Eugene and I are currently looking into compatibility guarantees in (#4). This includes API guarantees which should unblock this ticket along with its related tickets (#31, #32).

@GleasonK
Copy link
Member

No progress on this issue in the past week. Same rationale as last week, stable APIs are lower priority than a stable serialization format. Will work with Eugene on prioritizing this issue and coming up with a rough timeline.

@jpienaar
Copy link
Member

This and the Python API issue both came up this week in > 3 different venues.

@lsy323
Copy link

lsy323 commented Apr 27, 2023

Looks like there isn't C++ API that is similar to HLO builder API in xla_builder(https://github.com/openxla/xla/blob/main/xla/client/xla_builder.h). Having a similar C++ builder API should make the migration from HLO to StableHLO easier for frameworks currently emits HLO.

It seems StableHLO Python API similar to xla_builder is already there. StableHLO Python API seems like to be code-gen'ed, so I cannot find them in the source code. But here is an example usage in in JAX (https://github.com/google/jax/blob/34d5a6259f150064103fce241ff7d5b54e5ed8b0/jax/_src/prng.py#L1125)

cc @JackCaoG @miladm

@janpfeifer
Copy link

Also, this would be a nice path for an upgrade for those still using xla_builder.h. Notice that building a graph using xla_builder.h, there is a path to convert that to StableHLO (it used to work a few months back) -- so in a way xla_builder.h is already a StableHLO C++ API of sorts, but it's convoluted, and I'm not sure which ops and functionality are missing in xla_builder.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

7 participants