首页 > 解决方案 > TensorFlow 扩展 Kubeflow 多个 Worker

问题描述

我在 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)

环境:

标签: tensorflowdistributed-computingtfx

解决方案


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


推荐阅读