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

ml_program support #182

Open
silvasean opened this issue Sep 22, 2022 · 6 comments
Open

ml_program support #182

silvasean opened this issue Sep 22, 2022 · 6 comments
Labels

Comments

@silvasean
Copy link

Request description

ml_program is being used for certain JAX -> IREE flows and we are looking at using it in Torch-MLIR. Is there a plan for supporting this in StableHLO?

@joker-eph
Copy link
Contributor

What does it mean to "support it"? What would be the difference with a stablehlo.func / stablehlo.graph operation?

@silvasean
Copy link
Author

I mostly would be interested in the globals. In Torch-MLIR we still use func.func

@burmako burmako added the Spec label Sep 22, 2022
@burmako
Copy link
Contributor

burmako commented Sep 26, 2022

Hi Sean! I'd also like to ask what kind of support you have in mind.

From the looks of it, ml_program.global_load, ml_program.global_store and friends work with the builtin tensor type, which is compatible with stablehlo. Although, I see that the ODS for these ml_program ops says AnyType which makes me worried a bit that I might've missed something.

@silvasean
Copy link
Author

Yes, I think they are intended to be more general than just tensors. E.g. for storing a scalar i64 for a counter / rng seed / etc.

@burmako
Copy link
Contributor

burmako commented Sep 28, 2022

Sounds like loading scalars will be compatible with StableHLO as well, given that we can use tensor.from_elements there, and that's also on our list of ops to support in #115.

Overall, given that there are straightforward ways of using MLProgram's globals with StableHLO, and that #115 proposes upholding compatibility guarantees for "All ops, attributes and types" in the ml_program dialect, it looks like we have a solid plan for supporting this in StableHLO, so we can probably consider this ticket resolved?

@silvasean
Copy link
Author

I would expect that we would close this PR when appropriate docs and specs have been updated to include ml_program in the set of "what is included in StableHLO"

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

No branches or pull requests

3 participants