如何在 kubeflow 管道中使用训练运算符(例如 TFJob)定义组件/步骤

发布于 2025-01-16 07:12:53 字数 1007 浏览 2 评论 0原文

我知道有一种方法可以通过 kubectl 使用 tfjob 运算符,就像这里的示例 ( https://www.kubeflow.org/docs/components/training/tftraining/):

kubectl create -f https://raw.githubusercontent.com/kubeflow/training-operator/master/examples/tensorflow/simple.yaml

但我不知道如何合并到 kubeflow 管道中。普通的组件/作业是通过 @component 装饰定义的,或者 ContainerOp 是一种在 Pod 中运行的 Kubernetes Job 类型,但我不知道如何定义组件特殊的训练运算符,例如 TFJob,以便我的代码

apiVersion: "kubeflow.org/v1"
kind: TFJob

运行为而不是:

apiVersion: "kubeflow.org/v1"
kind: Job

在 kubernetes 中

。 PS:这里有一个示例: https:// github.com/kubeflow/pipelines/blob/master/components/kubeflow/launcher/sample.py 但没有看到任何地方指定TFJob

I know there is a way to use tfjob operator via kubectl, like the example at here (https://www.kubeflow.org/docs/components/training/tftraining/):

kubectl create -f https://raw.githubusercontent.com/kubeflow/training-operator/master/examples/tensorflow/simple.yaml

But I don't know how to incorporate in kubeflow pipeline. A normal component/job is defined via @component decoration or ContainerOp is a Kubernetes Job kind which runs in a Pod, but I don't know how to define a component with special training operator such as TFJob, so that my code runs as

apiVersion: "kubeflow.org/v1"
kind: TFJob

rather than:

apiVersion: "kubeflow.org/v1"
kind: Job

in kubernetes.

P.S.: there is a example here: https://github.com/kubeflow/pipelines/blob/master/components/kubeflow/launcher/sample.py
but don't see anywhere specify TFJob

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自由如风 2025-01-23 07:12:53

您引用的示例利用了一些实际创建 TFJob 的代码(look在您的示例的文件夹):

您提出的一般问题仍然受当前讨论。使用 tfjob_launcher_op 似乎是当前推荐的方式。相反,有些人还本机使用 ResourceOps 来模拟您的 kubectl create 调用。

The example you reference leverages some code that actually creates a TFJob (look at the folder of your example):

The general question you raised is still subject to current discussions. Using tfjob_launcher_op appears to be the currently recommended way. Instead, some people also natively use ResourceOps to simulate your kubectl create call.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文