nerdexam
Microsoft

DP-100 · Question #136

You write five Python scripts that must be processed in the order specified in Exhibit A - which allows the same modules to run in parallel, but will wait for modules with dependencies. You must…

The correct answer is A. p = Pipeline(ws, steps=[[[step_1_a, step_1_b], step_2_a], step_2_b], step_3]). The Azure ML Pipeline SDK supports nested lists to express dependencies: items in the same inner list run in parallel, and outer nesting implies sequential execution. Option A uses steps=[[[step_1_a, step_1_b], step_2_a], step_2_b], step_3] to express that step_1_a and step_1_b…

Design and prepare a machine learning solution

Question

You write five Python scripts that must be processed in the order specified in Exhibit A - which allows the same modules to run in parallel, but will wait for modules with dependencies. You must create an Azure Machine Learning pipeline using the Python SDK, because you want to script to create the pipeline to be tracked in your version control system. You have created five PythonScriptSteps and have named the variables to match the module names. You need to create the pipeline shown. Assume all relevant imports have been done. Which Python code segment should you use? A. B. C. D.

Exhibits

DP-100 question #136 exhibit 1
DP-100 question #136 exhibit 2
DP-100 question #136 exhibit 3

Options

  • Ap = Pipeline(ws, steps=[[[step_1_a, step_1_b], step_2_a], step_2_b], step_3])
  • BPipeline_steps = { "pipeline": { "run": "step_3", "run_after": [{ "run": "step_2_a", "run_after": [ {"run": "step_1_a"}, {"run": "step_1_b"} ] }], {"run": "step_2_b"}] } }
  • Cp = Pipeline(ws, steps=pipeline_steps) step_2_a.run_after(step_1_a) step_2_a.run_after(step_1_b) step_2_run_after(step_2_b) step_3.run_after(step_2_a) p = Pipeline(ws, steps=[step_3])
  • Dp = Pipeline(ws, steps=[step_1_a, step_1_b, step_2_a, step_2_b, step_3])

How the community answered

(62 responses)
  • A
    79% (49)
  • B
    13% (8)
  • C
    2% (1)
  • D
    6% (4)

Explanation

The Azure ML Pipeline SDK supports nested lists to express dependencies: items in the same inner list run in parallel, and outer nesting implies sequential execution. Option A uses steps=[[[step_1_a, step_1_b], step_2_a], step_2_b], step_3] to express that step_1_a and step_1_b run in parallel, step_2_a follows them, step_2_b follows after, and step_3 runs last. Option B uses JSON-like syntax that is not valid Python SDK code. Option C uses run_after() correctly in concept but contains a syntax error (step_2_run_after missing a dot). Option D passes all steps as a flat list with no dependency information.

Topics

#Azure Machine Learning Pipelines#Python SDK#Pipeline Dependencies#Parallel Execution

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice