jax icon indicating copy to clipboard operation
jax copied to clipboard

Lower tan to StableHLO instead of CHLO.

Open joaospinto opened this issue 1 year ago • 8 comments

Fixes #23259

joaospinto avatar Aug 27 '24 00:08 joaospinto

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Aug 27 '24 00:08 google-cla[bot]

You'll need to sign the CLA.

hawkinsp avatar Aug 27 '24 00:08 hawkinsp

I just did some moments ago.

joaospinto avatar Aug 27 '24 00:08 joaospinto

It looks like tan only became part of the VHLO dialect on v1.4.0 (source). This seems to be causing a unit test failure, due to an export failure. I might need to change some required minimum version hard-coded somewhere?

joaospinto avatar Aug 27 '24 01:08 joaospinto

It looks like this is breaking some of our tests that rely on forward compatibility (i.e., we don't emit stablehlo that's too new for some consumers, e.g., TF, to understand). I've asked @GleasonK to comment on how we should land this.

hawkinsp avatar Aug 27 '24 01:08 hawkinsp

Hello! Yes this error indicates a forward incompatibility, tan op is in a bit of a gray area because its a new "feature" but it isn't new semantics so an expander is actually possible.

@abhigunj is working on a pass that will live behind the exporter to expand TanOp which should unblock this. Hopefully have it in by EoW so this can be landed.

GleasonK avatar Aug 27 '24 20:08 GleasonK

StablehloCreateCompatibilityExpanderPass is merged ! PR https://github.com/openxla/xla/pull/16649 should unblock this work, it is in review now. we probably need to reduce tolerance to 1e-5 for few check tests. hopefully should be in first thing after the long weekend!

abhigunj avatar Aug 30 '24 20:08 abhigunj

@joaospinto — Can you squash this into one commit? I'll add the TODO for myself as part of the merge. Thanks!

dfm avatar Sep 13 '24 13:09 dfm

StablehloCreateCompatibilityExpanderPass is merged ! PR openxla/xla#16649 should unblock this work, it is in review now. we probably need to reduce tolerance to 1e-5 for few check tests. hopefully should be in first thing after the long weekend!

@joaospinto https://github.com/openxla/xla/pull/16649https://github.com/openxla/xla/pull/16649 is merged on Friday! Sorry for the delay, there were few expected primitive and harness test failures and fixing those (without adding new limitations) took more time than expected.

The PR should fix test failures related to forward compatibility. Querying the compatibility window versions is not required.

abhigunj avatar Sep 16 '24 17:09 abhigunj