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

Add MLIR side effects to tf.XlaCallModule. #60643

Merged
merged 7 commits into from May 21, 2023
Merged

Add MLIR side effects to tf.XlaCallModule. #60643

merged 7 commits into from May 21, 2023

Conversation

Abhishekagrawal1404
Copy link

This change introduces updates to the tf.XlaCallModule op in order to support jax2tf native serialization. The tf.XlaCallModule op contains the StableHLO module, which may involve calling TF host callback functions through stablehlo.custom_call. To enable proper functionality, the following modifications were made:

  1. The Pure trait in the automatically generated tf.XlaCallModule op's definition has been replaced with the MemoryEffects trait.

  2. The isStateful flag has been set in the op declaration of XlaCallModule to indicate that it has stateful behavior.

  3. The TensorFlow side effect analysis has been updated to recursively analyze the TF host callback functions invoked by tf.XlaCallModule.

These changes ensure better compatibility and alignment with the jax2tf native serialization process, allowing for improved handling of side effects and seamless integration with TensorFlow.

PiperOrigin-RevId: 533635753

With `jax2tf` native serialization, the StableHLO module embedded in `tf.XlaCallModule` may contain `stablehlo.custom_call` calling TF host callback functions. In this case, the `stablehlo.custom_call`s will be lowered to `stablehlo.send` and `stablehlo.recv`, so `tf.XlaCallModule` has `TF_SendSideEffect` and `TF_RecvSideEffect`.

This CL

1. replaces the `Pure` trait with `MemoryEffects` trait in the automatically generated `tf.XlaCallModule` op's definition.

2. sets `isStateful` in `XlaCallModule`'s op declaration.

2. updates TF side effect analysis to recursively analyze the TF host callback functions called by `tf.XlaCallModule`.

PiperOrigin-RevId: 533635753
@google-cla
Copy link

google-cla bot commented May 20, 2023

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.

tensorflower-gardener and others added 6 commits May 20, 2023 02:05
PiperOrigin-RevId: 533666635
Updates LLVM usage to match
[aa144fbeaf21](llvm/llvm-project@aa144fbeaf21)

PiperOrigin-RevId: 533717007
PiperOrigin-RevId: 533744471
Updates LLVM usage to match
[f7e2678bb706](llvm/llvm-project@f7e2678bb706)

PiperOrigin-RevId: 533763275
@tensorflow-jenkins tensorflow-jenkins merged commit f8db993 into nightly May 21, 2023
10 of 27 checks passed
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

Successfully merging this pull request may close these issues.

None yet

6 participants