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

[StableHLO] Add CHLO op support #13803

Closed
kuhar opened this issue May 26, 2023 · 0 comments · Fixed by #13849
Closed

[StableHLO] Add CHLO op support #13803

kuhar opened this issue May 26, 2023 · 0 comments · Fixed by #13849
Assignees
Labels
enhancement ➕ New feature or request integrations/stablehlo StableHLO (JAX/TensorFlow/etc) import and conversion

Comments

@kuhar
Copy link
Member

kuhar commented May 26, 2023

Request description

CHLO is one of the dialects that can coexist with StableHLO, per https://github.com/openxla/stablehlo/blob/main/docs/spec.md:

At the moment, StableHLO programs in the wild sometimes contain operations that are not described in this document. In the future, we are planning to either absorb these operations into the StableHLO opset or prohibit them from appearing in StableHLO programs. In the meanwhile, here is the list of these operations:

We need to support them in the IREE StableHLO input conversion pipeline (--iree-input-type=stablehlo).

What component(s) does this issue relate to?

Frontends

Additional context

Parent issue: #12678

@kuhar kuhar added enhancement ➕ New feature or request integrations/stablehlo StableHLO (JAX/TensorFlow/etc) import and conversion labels May 26, 2023
@kuhar kuhar self-assigned this May 26, 2023
@kuhar kuhar moved this from Inbox to In Progress in (Deprecated) IREE May 26, 2023
kuhar added a commit to kuhar/iree that referenced this issue May 26, 2023
The implementation is ported from the mlir-hlo project. For more context,
see the initial import: iree-org#12957.

This also required porting over some canonicalization patterns for
`stablehlo.dynamic_broadcast_in_dim`.

Issue: iree-org#13803
kuhar added a commit that referenced this issue May 26, 2023
The implementation is ported from the mlir-hlo project. For more
context, see the initial import:
#12957.

This also required porting over some canonicalization patterns for
`stablehlo.dynamic_broadcast_in_dim`.

Issue: #13803
kuhar added a commit to kuhar/iree that referenced this issue May 29, 2023
Unlike in the MHLO pipeline, run CHLO legalization as a separate pass to
better controll required canonicalization patterns. This also decouples
the CHLO conversion from the custom type converter used during lowering
to linalg and IREE dialects.

Also add a pattern to handle non-broadcasting constants.

Issue: iree-org#13803
kuhar added a commit to kuhar/iree that referenced this issue May 29, 2023
kuhar added a commit that referenced this issue May 29, 2023
Unlike in the MHLO pipeline, run CHLO legalization as a separate pass to
better controll required canonicalization patterns. This also decouples
the CHLO conversion from the custom type converter used during lowering
to linalg and IREE dialects.

Also add a pattern to handle non-broadcasting constants.

Issue: #13803
kuhar added a commit to kuhar/iree that referenced this issue May 30, 2023
These are ported from the mlir-hlo project. For more context, see the
initial import: iree-org#12957.

The biggest difference it the removal of most FileCheck CHECK lines in
tests. MHLO hardcoded thousands lines of exact decomposition sequences
that fell apart after due to different canonicalizations and folds.
Without a script to regenerate these CHECKs, these tests were not
maintanable and I decided to drop them. Now we only check that the
dialect conversion succeeded.

Other notable differences to the MHLO implementation:
-  Ported some utility functions and tablegen defs.
-  New `chlo.tan` lowering, since StableHLO does not provide a tan op.

Issue: iree-org#13803
kuhar added a commit that referenced this issue May 30, 2023
These are ported from the mlir-hlo project. For more context, see the
initial import: #12957.

The biggest difference it the removal of most FileCheck CHECK lines in
tests. MHLO hardcoded thousands lines of exact decomposition sequences
that fell apart after due to different canonicalizations and folds.
Without a script to regenerate these CHECKs, these tests were not
maintainable and I decided to drop them. Now we only check that the
dialect conversion succeeded.

Other notable differences to the MHLO implementation:
-  Ported some utility functions and tablegen defs.
-  New `chlo.tan` lowering, since StableHLO does not provide a tan op.

Issue: #13803
kuhar added a commit to kuhar/iree that referenced this issue May 30, 2023
Only some of the lowering passes deal with CHLO ops.

Fixes: iree-org#13803
kuhar added a commit that referenced this issue May 30, 2023
Only some of the lowering passes deal with CHLO ops.

Fixes: #13803
@github-project-automation github-project-automation bot moved this from In Progress to Done in (Deprecated) IREE May 30, 2023
jvstokes pushed a commit to jvstokes/iree that referenced this issue Jun 4, 2023
jvstokes pushed a commit to jvstokes/iree that referenced this issue Jun 4, 2023
Unlike in the MHLO pipeline, run CHLO legalization as a separate pass to
better controll required canonicalization patterns. This also decouples
the CHLO conversion from the custom type converter used during lowering
to linalg and IREE dialects.

Also add a pattern to handle non-broadcasting constants.

Issue: iree-org#13803
jvstokes pushed a commit to jvstokes/iree that referenced this issue Jun 4, 2023
These are ported from the mlir-hlo project. For more context, see the
initial import: iree-org#12957.

The biggest difference it the removal of most FileCheck CHECK lines in
tests. MHLO hardcoded thousands lines of exact decomposition sequences
that fell apart after due to different canonicalizations and folds.
Without a script to regenerate these CHECKs, these tests were not
maintainable and I decided to drop them. Now we only check that the
dialect conversion succeeded.

Other notable differences to the MHLO implementation:
-  Ported some utility functions and tablegen defs.
-  New `chlo.tan` lowering, since StableHLO does not provide a tan op.

Issue: iree-org#13803
jvstokes pushed a commit to jvstokes/iree that referenced this issue Jun 4, 2023
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this issue Jul 6, 2023
The implementation is ported from the mlir-hlo project. For more
context, see the initial import:
iree-org#12957.

This also required porting over some canonicalization patterns for
`stablehlo.dynamic_broadcast_in_dim`.

Issue: iree-org#13803
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this issue Jul 6, 2023
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this issue Jul 6, 2023
Unlike in the MHLO pipeline, run CHLO legalization as a separate pass to
better controll required canonicalization patterns. This also decouples
the CHLO conversion from the custom type converter used during lowering
to linalg and IREE dialects.

Also add a pattern to handle non-broadcasting constants.

Issue: iree-org#13803
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this issue Jul 6, 2023
These are ported from the mlir-hlo project. For more context, see the
initial import: iree-org#12957.

The biggest difference it the removal of most FileCheck CHECK lines in
tests. MHLO hardcoded thousands lines of exact decomposition sequences
that fell apart after due to different canonicalizations and folds.
Without a script to regenerate these CHECKs, these tests were not
maintainable and I decided to drop them. Now we only check that the
dialect conversion succeeded.

Other notable differences to the MHLO implementation:
-  Ported some utility functions and tablegen defs.
-  New `chlo.tan` lowering, since StableHLO does not provide a tan op.

Issue: iree-org#13803
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this issue Jul 6, 2023
nhasabni pushed a commit to plaidml/iree that referenced this issue Aug 24, 2023
The implementation is ported from the mlir-hlo project. For more
context, see the initial import:
iree-org#12957.

This also required porting over some canonicalization patterns for
`stablehlo.dynamic_broadcast_in_dim`.

Issue: iree-org#13803
nhasabni pushed a commit to plaidml/iree that referenced this issue Aug 24, 2023
nhasabni pushed a commit to plaidml/iree that referenced this issue Aug 24, 2023
Unlike in the MHLO pipeline, run CHLO legalization as a separate pass to
better controll required canonicalization patterns. This also decouples
the CHLO conversion from the custom type converter used during lowering
to linalg and IREE dialects.

Also add a pattern to handle non-broadcasting constants.

Issue: iree-org#13803
nhasabni pushed a commit to plaidml/iree that referenced this issue Aug 24, 2023
These are ported from the mlir-hlo project. For more context, see the
initial import: iree-org#12957.

The biggest difference it the removal of most FileCheck CHECK lines in
tests. MHLO hardcoded thousands lines of exact decomposition sequences
that fell apart after due to different canonicalizations and folds.
Without a script to regenerate these CHECKs, these tests were not
maintainable and I decided to drop them. Now we only check that the
dialect conversion succeeded.

Other notable differences to the MHLO implementation:
-  Ported some utility functions and tablegen defs.
-  New `chlo.tan` lowering, since StableHLO does not provide a tan op.

Issue: iree-org#13803
nhasabni pushed a commit to plaidml/iree that referenced this issue Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ➕ New feature or request integrations/stablehlo StableHLO (JAX/TensorFlow/etc) import and conversion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant