gpt4 book ai didi

kubeflow - 使用管道参数为 Kubeflow 管道分配资源

转载 作者:行者123 更新时间:2023-12-05 06:10:24 25 4
gpt4 key购买 nike

我希望能够创建一个 Kubeflow 管道,允许用户为运行设置分配的资源。最终结果将是这样的:

Example of Kubeflow "Create Run" UI with ability to set resource allocation .

管道参数的定义是可能的;但是,管道参数的语法与 Kubeflow 用于预处理其 YAML 定义的验证正则表达式不匹配。


例如,使用屏幕截图中的值参数,我可以通过将其添加到管道的 YAML 定义中来硬编码分配给管道的资源:

resources:
limits: {nvidia.com/gpu: 1}
requests: {cpu: 16, memory: 32G}

但是,我想做的是使用管道的参数为每次运行定义这些分配。像这样的东西:

resources:
limits: {nvidia.com/gpu: '{{inputs.parameters.gpu_limit}}'}
requests: {cpu: '{{inputs.parameters.cpu_request}}', memory: '{{inputs.parameters.memory_request}}'}

当我使用管道资源的第二个定义时,管道创建失败,因为 Kubeflow 无法像输入参数语法 '{{input.parameters.parameter}}' 那样解析这些资源参数不匹配正则表达式 ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$.

{
"error_message":"Error creating pipeline: Create pipeline failed: Failed to get parameters from the workflow: InvalidInputError: Failed to parse the parameter.: error unmarshaling JSON: while decoding JSON: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'",
"error_details":"Error creating pipeline: Create pipeline failed: Failed to get parameters from the workflow: InvalidInputError: Failed to parse the parameter.: error unmarshaling JSON: while decoding JSON: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'"
}

有没有人找到解决这个问题的方法,或者我是否试图强制 Kubeflow 做一些它不是为它构建的?像我在第二个示例中那样定义和使用管道参数适用于管道定义的其他部分(例如要在 Docker 容器中运行的参数或命令)。

最佳答案

这只能在当前版本的 kubeflow 管道中完成。这是一个限制,但您不能从管道本身更改资源。

关于kubeflow - 使用管道参数为 Kubeflow 管道分配资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64427396/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com