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

Consider adding support for running TFX w/Beam in the components #2958

Closed
holdenk opened this issue Feb 1, 2020 · 20 comments · Fixed by #3684
Closed

Consider adding support for running TFX w/Beam in the components #2958

holdenk opened this issue Feb 1, 2020 · 20 comments · Fixed by #3684
Assignees
Labels
area/components kind/feature status/triaged Whether the issue has been explicitly triaged

Comments

@holdenk
Copy link

holdenk commented Feb 1, 2020

Looking at the current TFX components, it seems like they only run in local mode. I think it would be useful to consider adding support for running on top of Beam w/Dataflow (and later Flink & Spark).

@numerology
Copy link

Actually you have the option to author the pipeline in TFX and run on KubeflowDagRunner, see
https://github.com/tensorflow/tfx/blob/master/tfx/orchestration/kubeflow/kubeflow_dag_runner.py

You can specify Dataflow runner by specifying beam args, see example here https://github.com/tensorflow/tfx/blob/848063c2c84e60f368994edf9ace01d017120dbc/tfx/examples/chicago_taxi_pipeline/taxi_pipeline_kubeflow_gcp.py#L100

@numerology
Copy link

/assign @numerology

@holdenk
Copy link
Author

holdenk commented Feb 2, 2020

So that’s only if I make a TFX pipeline, if I make a kubeflow pipeline w/TFX components it doesn’t let me specify the runner as far as I can see.

@rmgogogo rmgogogo added status/triaged Whether the issue has been explicitly triaged kind/feature labels Feb 6, 2020
@rmgogogo
Copy link
Contributor

rmgogogo commented Feb 6, 2020

Jiaxiao, this match the email we discussed before.
Add Ajay to get more input.

@numerology
Copy link

Actually in KubeflowDagRunner all TFX components are converted to KFP containerOp under the hood.

I'm hesitating in supporting a codepath like KFP-TFX-KFP-Argo. This looks unnecessarily redundant.

@holdenk
Copy link
Author

holdenk commented Feb 6, 2020

So let’s say I have a mixed pipeline, like needing to do some non-TFX data munging first, how do I do my TFX work on beam as part of that? Or is that just not something in scope?

(Also if we don’t want folks to use the KFP TFX components should we delete them? I know KF has a lot of dead ends it might be good to clean up some of them if this is one of those cases).

@Ark-kun
Copy link
Contributor

Ark-kun commented Feb 11, 2020

it would be useful to consider adding support for running on top of Beam w/Dataflow

Well, we had Dataflow components, but someone cleaned them up

So let’s say I have a mixed pipeline, like needing to do some non-TFX data munging first, how do I do my TFX work on beam as part of that? Or is that just not something in scope?

KFP uses Argo and runs on Kubernetes. Beam is a different orchestrator. Can you please tell us about scenarios that require using Beam on Kubernetes?

When using TFX framework (not components), you can choose a runner - either Beam or Kubeflow+Argo+Kubernetes.
There is a choice - to use Beam orchestrator or not.

Of course, KFP allows you to launch code on Dataflow. But that would be opaque task - a single block that executes some beam pipeline. Same with any other pair of orchestrators.

@holdenk
Copy link
Author

holdenk commented Feb 11, 2020

So my scenario is I fetch data from the world outside of TFX and store it on GCS as part 1 of my pipeline. Then in part 2 I want to train a tensorflow model, ideally with TFT for data transformations.

Like if you don’t imagine TFX being used inside of KF pipelines that’s fine; I’m just a little confused.

@holdenk
Copy link
Author

holdenk commented Feb 28, 2020

Just following up: do we not expect folks to use TFX as part of a Kubeflow pipeline? I want to make sure I capture this correctly in the book I'm working on.

@jlewi
Copy link
Contributor

jlewi commented Apr 12, 2020

See also kubeflow/kubeflow#1583

My understanding is that KFP will be the recommended way to run TFX pipelines especially on K8s. To achieve that my understanding is that at some point the TFX implementation on KFP will support scaling out the processing(e.g. TF.Transform) using Beam. I believe using Dataflow is already supported and we have at least one issue (kubeflow/kubeflow#1583) related to supporting other runners like Flink.

@rmgogogo @jessiezcc @Bobgy Can anyone from pipelines provide some guidance on terms of the roadmap for TFX and KFP? Could we get the relevant information added to
https://github.com/kubeflow/pipelines/blob/master/ROADMAP.md

@jlewi
Copy link
Contributor

jlewi commented Apr 12, 2020

/cc @katsiapis

@Ark-kun Ark-kun assigned Ark-kun and unassigned neuromage and numerology Apr 28, 2020
@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 28, 2020

Looking at the current TFX components, it seems like they only run in local mode. I think it would be useful to consider adding support for running on top of Beam w/Dataflow

Good idea.
Currently we utilize the executor code and the component code of the TFX components, but we do not use the launchers. Using the InProcessComponentLauncher would allows some of the TFX components to use Beam and Dataflow.
I think I can make this work.

@numerology
Copy link

@Ark-kun
Actually, if by all means the aforementioned TFX components is the way to go, shall we consider implementing them based on this entrypoint? That way, we can get Dataflow without needing to play with TFX launcher/driver.

@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 28, 2020

@Ark-kun
Actually, if by all means the aforementioned TFX components is the way to go, shall we consider implementing them based on this entrypoint? That way, we can get Dataflow without needing to play with TFX launcher/driver.

Thanks for the pointer. It looks like it is very easy to add support for beam_pipeline_args. I did an experiment, and the component starts using Dataflow. Unfortunately, I'm then hit by this bug: tensorflow/tfx#649 Waiting for some fix or workaround for it.

@neuromage
Copy link
Contributor

Hi @holdenk,

I recommend using the official TFX components on KFP instead [1] [2]. Those components are updated, maintained and have been tested with Dataflow. This is the supported path, we'll be happy to help you with any issues here. Thanks!

[1] https://www.tensorflow.org/tfx/tutorials/tfx/cloud-ai-platform-pipelines
[2] https://github.com/kubeflow/pipelines/tree/master/samples/core/parameterized_tfx_oss

@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 29, 2020

Hi @holdenk,

I recommend using the official TFX components on KFP instead [1] [2]. Those components are updated, maintained and have been tested with Dataflow. This is the supported path, we'll be happy to help you with any issues here. Thanks!

[1] https://www.tensorflow.org/tfx/tutorials/tfx/cloud-ai-platform-pipelines
[2] https://github.com/kubeflow/pipelines/tree/master/samples/core/parameterized_tfx_oss

+1.
For pipelines that mostly use TFX components we suggest using the official TFX components available through the TFX SDK.

@holdenk
Copy link
Author

holdenk commented Apr 29, 2020

Ok but if I have non TFX tasks that doesn’t work

@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 29, 2020

Ok but if I have non TFX tasks that doesn’t work

That's true.
Short-term solution for mixed-component pipelines: The KFP-style TFX components will soon support Beam/Dataflow (after the the official TFX version >0.21.4 is released). There was an issue in new versions of Beam that has affected the ability of core TFX components to run on Dataflow. tensorflow/tfx#649 This bug is already fixed in TFX and the fix will be released as part of the next TFX release. tensorflow/tfx#1699 After that I will update the KFP-style TFX components and support for the beam_pipeline_args which can be used to specify the DataflowRunner.

Longer-term solution:
I'm also working on making it possible to use KFP components with TFX SDK. When the work is finished, you'll also be able to create mixed-component pipelines in TFX SDK as well.

@holdenk
Copy link
Author

holdenk commented Apr 29, 2020

That’s great news! Thank you for working on these :)

@Ark-kun
Copy link
Contributor

Ark-kun commented May 6, 2020

That’s great news! Thank you for working on these :)

@holdenk
The URI-IO-based KFP-style TFX components now support Dataflow. You just pass beam_pipeline_args that specifies DataflowRunner and they start using Dataflow. Check this sample pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components kind/feature status/triaged Whether the issue has been explicitly triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants