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

ReactantExt: Einsum -> DotGeneral #265

Open
wsmoses opened this issue Nov 29, 2024 · 1 comment
Open

ReactantExt: Einsum -> DotGeneral #265

wsmoses opened this issue Nov 29, 2024 · 1 comment

Comments

@wsmoses
Copy link

wsmoses commented Nov 29, 2024

einsum_config = Reactant.MLIR.IR.Attribute("$(join(tia)),$(join(tib))->$(join(tic))")

So:

einsum

This operation is on its way out of StableHLO, so it is not included in the StableHLO specification: https://github.com/openxla/stablehlo/issues/3.

Informally, this operation does the same thing as TF's einsum: https://www.tensorflow.org/api_docs/python/tf/einsum

Presumably this can be rewritten as dot general and the likes?

@mofeing
Copy link
Member

mofeing commented Nov 29, 2024

yes, I'm aware of that. the problem is that einsum is more general than dot_general as it can also involve transpose, some diagonal extraction and a sum over some dimensions.

I need to build a parser for it and call the ops accordingly, but it's a burden. do you know where that string parsing is implemented in StableHLO or XLA?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants