-
Notifications
You must be signed in to change notification settings - Fork 125
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
StableHLO CAPI requires building upstream dialects #2593
Comments
Hey @GleasonK, I'm having a go at this and am nearly ready to submit a draft PR. 1. API Export vs Re-exportBasically, either:
2. Common deps between new
|
I don't have any major preferences as long as it works.. These CAPIs get a little strange with linking in MLIR but I think this should all be OK, since that linking is handled at a higher level in other projects. In general I like the layering approach you've mentioned, is seems like:
(2) In that regard I like 2.2 if that layering works "stablehlo_unified_capi depend on stablehlo_dialect_capi". That said if this proves more difficult then having multiple header deps is probably fine. The way we export for other projects today is this file group, so 1 header vs 2 tends to be opaque to users:
(3) Backward compatibility will likely be important. I'm not clear what this alias means, if this is just an easy build target, then probably ok to break compat and I can update internally, if this will change what submodules APIs are in and would require modifying lots of Py source code that uses StableHLO bindings..then alias is preferred. |
Request description
Currently CAPI builds linalg and arith, etc -- but most users of CAPI (frameworks) only want StableHLO+CHLO+Serialization. Would be great to offer a
stablehlo_dialect_capi
which only has core APIs.One possible separation direction:
stablehlo_dialect_capi
: Just StableHLO+CHLO+Serialization APIs, these are the things useful for PJRT frameworks.stablehlo_unified_capi
: A separate target which builds the dialect CAPI along with the transformation passes / reference interpreter / other useful APIs, likely will be the target used for StableHLO python bindingsThis will probably require splitting the serialization APIs into a separate file
StablehloDialectApi.h
andStablehloUnifiedApi.h
. The following functions should go into the dialect API: https://github.com/openxla/stablehlo/blob/main/stablehlo/integrations/c/StablehloApi.h#L23-L117The reference API and pass registration should go into the unified API target:
https://source.corp.google.com/piper///depot/google3/third_party/stablehlo/stablehlo/integrations/c/StablehloPasses.h
Looking at the CAPI deps today, I'm surprised that this requires upstream dialects, so definitely something to look into.
(Noted by @steeve at recent OpenXLA community meeting)
The text was updated successfully, but these errors were encountered: