是否可以在Azure ML中在运行时动态创建计算/集群



我希望在运行时为Azure ML管道动态创建计算集群。

管道的一个简单版本如下:

# create the compute
compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2', max_nodes=1)
cpu_cluster = ComputeTarget.create(ws, 'test-cluster', compute_config)
cpu_cluster.wait_for_completion(show_output=True)
# construct the step
step_1 = PythonScriptStep(script_name='test_script.py', name='test_step', compute_target=cpu_cluster
)
# validate the pipeline and publish
pipeline = Pipeline(ws, steps=[step_1])
pipeline.validate()
# run the experiment
experiment = Experiment(workspace=ws, name=experiment_name)
pipeline_run = experiment.submit(config=pipeline)
pipeline_run.wait_for_completion()

当我在本地运行驱动程序脚本时,这非常好,但是,当我发布管道并从ADF执行时,不会创建计算集群。

UserError: Response status code does not indicate success: 400 (Unknown compute target 'test-cluster'.). Unknown compute target 'test-cluster'.

欢迎任何指导或建议。

是的,我们可以动态创建。检查以下文档中的步骤。

文档

  1. 将项目快照从Blob下载到计算目标与工作空间相关联的存储器。

  2. 构建与管道中的每个步骤相对应的Docker映像。

  3. 从下载每个步骤的Docker映像到计算目标容器注册表。

  4. 配置对Dataset和OutputFileDatasetConfig对象的访问。对于as_mount((访问模式,FUSE用于提供虚拟访问。如果不支持装载,或者用户将访问指定为作为_upload((,数据被复制到计算目标。

  5. 在步骤中指定的计算目标中运行步骤释义

  6. 创建工件,如日志、stdout和stderr、度量,以及步骤指定的输出。然后上传这些工件保存在用户的默认数据存储中。

上述要点也可在共享的文档链接中找到。

最新更新