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

RFC: Supporting tf.function in tf.transform #308

Merged
merged 3 commits into from
Nov 9, 2020

Conversation

varshaan
Copy link
Contributor

@varshaan varshaan commented Oct 22, 2020

This RFC will be open for comment until Friday, November 6th, 2020.

cc @jsimsa @zoyahav @katsiapis

Status Proposed
RFC # 308
Author(s) Varshaa Naganathan (varshaan@google.com)
Sponsor Konstantinos Katsiapis (katsiapis@google.com), Jiri Simsa (jsimsa@google.com), Zohar Yahav (zoy@google.com)
Updated 2020-10-12

Objective

For tf.transform users who have TF 2 features enabled, tf.transform will
internally use tf.function to trace the user defined preprocessing function.
This is expected to work for the majority of existing use cases with no user
visible impact. However, it is possible that the user defined preprocessing
function is not traceable by tf.function (i.e. not compatible with TF 2 graph
mode execution). To accommodate such cases, we will provide a
force_tf_compat_v1 escape hatch to allow users to fall back to TF 1
compatibility mode. Keeping the legacy behavior will continue to write the
output artifact as a TF 1 SavedModel and is not guaranteed to be compatible with
V2 Trainer.

To support this change, we need to allow tf.transform analyzers to be traceable
by tf.function. Additionally, for tf.transform to support tf.function usage
completely, it needs to handle nested tf.functions that could by themselves
contain tf.transform analyzers. tf.transform currently only traverses a single
graph generated from the user defined preprocessing function. To support nested
tf.functions, tf.transform will need to recursively traverse all the nested
FuncGraphs, identifying tf.transform analyzer nodes and replacing them with
their final computed value.

A side-effect of this proposal is that the output artifact created by
tf.transform when tf.function is used to trace the preprocessing function will
be a V2 SavedModel.

copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Oct 22, 2020
@theadactyl theadactyl added the RFC: Proposed RFC Design Document label Oct 22, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Oct 26, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Oct 26, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Oct 26, 2020
@ematejska ematejska added RFC: Accepted RFC Design Document: Accepted by Review and removed RFC: Proposed RFC Design Document labels Nov 9, 2020
@ematejska
Copy link
Contributor

There has been no feedback, this is now accepted.

@ematejska ematejska merged commit d8d013f into tensorflow:master Nov 9, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Nov 9, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Nov 10, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Nov 10, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Nov 11, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Nov 11, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Nov 11, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 6, 2020
Implements RFC: tensorflow/community#308

PiperOrigin-RevId: 345978930
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 6, 2020
Implements RFC: tensorflow/community#308

PiperOrigin-RevId: 345978930
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 6, 2020
Implements RFC: tensorflow/community#308

PiperOrigin-RevId: 345978930
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 6, 2020
Implements RFC: tensorflow/community#308

PiperOrigin-RevId: 345978930
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 6, 2020
Implements RFC: tensorflow/community#308

PiperOrigin-RevId: 345978930
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 7, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 7, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 7, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 11, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 12, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 12, 2020
copybara-service bot pushed a commit to tensorflow/tfx that referenced this pull request Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes RFC: Accepted RFC Design Document: Accepted by Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants