管道中的第二个“ParallelRunStep”在启动时超时

2024-05-20 10:10:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在AzureML管道中运行多个ParallelRunStep的序列。为此,我使用以下帮助器创建了一个步骤:

def create_step(name, script, inp, inp_ds):
    out = pip_core.PipelineData(name=f"{name}_out", datastore=dstore, is_directory=True)
    out_ds = out.as_dataset()
    out_ds_named = out_ds.as_named_input(f"{name}_out")

    config = cont_steps.ParallelRunConfig(
        source_directory="src",
        entry_script=script,
        mini_batch_size="1",
        error_threshold=0,
        output_action="summary_only",
        compute_target=compute_target,
        environment=component_env,
        node_count=2,
        logging_level="DEBUG"
    )

    step = cont_steps.ParallelRunStep(
        name=name,
        parallel_run_config=config,
        inputs=[inp_ds],
        output=out,
        arguments=[],
        allow_reuse=False,
    )

    return step, out, out_ds_named

作为示例,我创建了如下两个步骤

step1, out1, out1_ds_named = create_step("step1", "demo_s1.py", input_ds, named_input_ds)
step2, out2, out2_ds_named = create_step("step2", "demo_s2.py", out1, out1_ds_named)

创建实验并将其提交到现有工作区,Azure ML compute cluster就可以工作了。此外,第一步step1使用input_ds运行其脚本demo_s1.py(该脚本生成其输出文件,并成功完成)

然而,第二步step2从未开始

enter image description here

还有最后一个例外

The experiment failed. Finalizing run...
Cleaning up all outstanding Run operations, waiting 300.0 seconds
2 items cleaning up...
Cleanup took 0.16968441009521484 seconds
Starting the daemon thread to refresh tokens in background for process with pid = 394
Traceback (most recent call last):
  File "driver/amlbi_main.py", line 52, in <module>
    main()
  File "driver/amlbi_main.py", line 44, in main
    JobStarter().start_job()
  File "/mnt/batch/tasks/shared/LS_root/jobs/pipeline/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/mounts/workspaceblobstore/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/driver/job_starter.py", line 48, in start_job
    job.start()
  File "/mnt/batch/tasks/shared/LS_root/jobs/pipeline/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/mounts/workspaceblobstore/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/driver/job.py", line 70, in start
    master.start()
  File "/mnt/batch/tasks/shared/LS_root/jobs/pipeline/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/mounts/workspaceblobstore/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/driver/master.py", line 174, in start
    self._start()
  File "/mnt/batch/tasks/shared/LS_root/jobs/pipeline/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/mounts/workspaceblobstore/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/driver/master.py", line 149, in _start
    self.wait_for_input_init()
  File "/mnt/batch/tasks/shared/LS_root/jobs/pipeline/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/mounts/workspaceblobstore/azureml/08a1e1e1-7c3f-4c5a-84ad-ca99b8a6cb31/driver/master.py", line 124, in wait_for_input_init
    raise exc
exception.FirstTaskCreationTimeout: Unable to create any task within 600 seconds.
Load the datasource and read the first row locally to see how long it will take.
Set the advanced argument '--first_task_creation_timeout' to a larger value in arguments in ParallelRunStep.

我的印象是,第二步正在等待一些数据。然而,第一步创建了提供的输出目录和一个文件

import argparse
import os

def init():
    pass

def run(parallel_input):
    print(f"*** Running {os.path.basename(__file__)} with input {parallel_input}")

    parser = argparse.ArgumentParser(description="Data Preparation")
    parser.add_argument('--output', type=str, required=True)
    args, unknown_args = parser.parse_known_args()

    out_path = os.path.join(args.output, "1.data")
    os.makedirs(args.output, exist_ok=True)
    open(out_path, "a").close()

    return [out_path]

我不知道如何进一步调试。有人知道吗


Tags: nameinpyinputstepdriverbatchline