AzureBatchStep 类
创建用于将作业提交到 Azure Batch 的 Azure ML 管道步骤。
注意:此步骤不支持上传/下载目录及其内容。
有关使用 AzureBatchStep 的示例,请参阅笔记本 https://aka.ms/pl-azbatch。
- 继承
-
azureml.pipeline.core._azurebatch_step_base._AzureBatchStepBaseAzureBatchStep
构造函数
AzureBatchStep(name, create_pool=False, pool_id=None, delete_batch_job_after_finish=True, delete_batch_pool_after_finish=False, is_positive_exit_code_failure=True, vm_image_urn='urn:MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter', run_task_as_admin=False, target_compute_nodes=1, vm_size='standard_d1_v2', source_directory=None, executable=None, arguments=None, inputs=None, outputs=None, allow_reuse=True, compute_target=None, version=None)
参数
- vm_image_urn
- str
如果 create_pool 为 True,并且 VM 使用 VirtualMachineConfiguration。
值格式:urn:publisher:offer:sku。
示例:urn:MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter。
- inputs
- list[Union[<xref:azureml.pipeline.core.graph.InputPortBinding,azureml.data.data_reference.DataReference,azureml.pipeline.core.PortDataReference,azureml.pipeline.core.builder.PipelineData>]]
输入端口绑定的列表。 在作业运行之前,会为每个输入创建一个文件夹。 每个输入的文件都将从存储复制到计算节点上的相应文件夹。 例如,如果输入名称为 input1,并且存储上的相对路径为 some/relative/path/that/can/be/really/long/inputfile.txt,则计算上的文件路径将为:./input1/inputfile.txt。 当输入名称超过 32 个字符时,它将被截断并追加一个唯一后缀,以便可以在计算目标上成功创建文件夹名称。
- outputs
- list[Union[<xref:azureml.pipeline.core.builder.PipelineData,azureml.pipeline.core.pipeline_output_dataset.PipelineOutputAbstractDataset,azureml.pipeline.core.graph.OutputPortBinding>]]
输出端口绑定的列表。 与输入类似,在作业运行之前,会为每个输出创建一个文件夹。 文件夹名称将与输出名称相同。 假设作业会将输出放入该文件夹中。
- allow_reuse
- bool
指示当使用相同的设置重新运行时,该步骤是否应重用以前的结果。 默认情况下启用重用。 如果步骤内容(脚本/依赖项)以及输入和参数保持不变,则重用此步骤以前运行的输出。 重用该步骤时,不是将作业提交到计算,而是使前一运行的结果立即可供后续步骤使用。 如果使用 Azure 机器学习数据集作为输入,则重用取决于数据集的定义是否已更改,而不是基础数据是否已更改。
注解
以下示例演示如何在 Azure 机器学习管道中使用 AzureBatchStep。
step = AzureBatchStep(
name="Azure Batch Job",
pool_id="MyPoolName", # Replace this with the pool name of your choice
inputs=[testdata],
outputs=[outputdata],
executable="azurebatch.cmd",
arguments=[testdata, outputdata],
compute_target=batch_compute,
source_directory=binaries_folder,
)
方法
| create_node |
从 AzureBatch 步骤创建一个节点,并将其添加到指定的图形中。 此方法不能直接使用。 通过此步骤实例化管道时,Azure ML 会自动通过此方法传递所需的参数,以便可以将步骤添加到表示工作流的管道图形中。 |
create_node
从 AzureBatch 步骤创建一个节点,并将其添加到指定的图形中。
此方法不能直接使用。 通过此步骤实例化管道时,Azure ML 会自动通过此方法传递所需的参数,以便可以将步骤添加到表示工作流的管道图形中。
create_node(graph, default_datastore, context)
参数
- default_datastore
- Union[<xref:azureml.data.azure_storage_datastore.AbstractAzureStorageDatastore,azureml.data.azure_data_lake_datastore.AzureDataLakeDatastore>]
默认数据存储。
- context
- <xref:azureml.pipeline.core._GraphContext>
图上下文。
返回
创建的节点。
返回类型
反馈
提交和查看相关反馈