TensorFlow 扩展 Kubeflow 多工作线程

问题描述

我在 Kubeflow DAG Runner 上遇到了 TFX 问题。问题是我每次运行只能启动一个 pod。除了 Apache Beam 参数外,我没有看到“workers”的任何配置,这无济于事。

一个 Pod 上运行 CSV 加载会导致 OOMKilled 错误,因为文件超过 5GB。我尝试将文件分成 100MB 的部分,但这也无济于事。

所以我的问题是:如何在 Kubeflow 上的多个“worker”pod 上运行 TFX 作业/阶段,或者这是否可能?

这是我一直在使用的代码

examples = external_input(data_root)
example_gen = CsvexampleGen(input=examples)
statistics_gen = StatisticsGen(examples=example_gen.outputs['examples'])

dsl_pipeline = pipeline.Pipeline(
  pipeline_name=pipeline_name,pipeline_root=pipeline_root,components=[
      example_gen,statistics_gen
  ],enable_cache=True,beam_pipeline_args=['--num_workers=%d' % 5]
)


if __name__ == '__main__':
    tfx_image = 'custom-aws-imgage:tfx-0.26.0'
    config = kubeflow_dag_runner.KubeflowDagRunnerConfig(
        kubeflow_Metadata_config=kubeflow_dag_runner.get_default_kubeflow_Metadata_config(),tfx_image=tfx_image)
    kfp_runner = kubeflow_dag_runner.KubeflowDagRunner(config=config)
    # KubeflowDagRunner compiles the DSL pipeline object into KFP pipeline package.
    # By default it is named <pipeline_name>.tar.gz
    kfp_runner.run(dsl_pipeline)

环境:

  • Docker 镜像:tensorflow/tfx:0.26.0,安装了 boto3(aws 相关问题)
  • Kubernetes:AWS EKS 最新版
  • Kubeflow:1.0.4

解决方法

这在当时看来是不可能的。 看: https://github.com/kubeflow/kubeflow/issues/1583