exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 3 question 6 discussion

Actual exam question from Microsoft's DP-100
Question #: 6
Topic #: 3
[All DP-100 Questions]

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.

Show Suggested Answer Hide Answer
Suggested Answer: A
The steps parameter is an array of steps. To build pipelines that have multiple steps, place the steps in order in this array.
Reference:
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-use-parallel-run-step

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
david_Fdz
Highly Voted 4 years ago
it should be D
upvoted 33 times
...
chaudha4
Highly Voted 3 years, 11 months ago
Correct answer is D. The dependencies of steps is implicitly defined in the step itself (via arguments parameter that could be an output from some other step). Read https://docs.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.pipelinedata?view=azure-ml-py.
upvoted 18 times
chaudha4
3 years, 11 months ago
You could also use StepSequence but that is not an option in this question. See https://docs.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.builder.stepsequence?view=azure-ml-py
upvoted 5 times
...
jpalaci22
2 years, 2 months ago
I check that same link you posted and it doesn't show in this method. This shows as an example when there's no flow control so this works for no flow control but this example seems to critically need A as the answer to control the flow
upvoted 1 times
...
...
Antoh1978
Most Recent 7 months, 4 weeks ago
I would go for D
upvoted 1 times
...
deyoz
1 year, 1 month ago
I go for D, chaudha4 explanation below is spot-on.
upvoted 1 times
...
Plb2
1 year, 2 months ago
A would be correct if it had been p = Pipeline(ws, steps=StepSequence(steps=[initial_steps, step4])) https://learn.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.stepsequence?view=azure-ml-py#remarks
upvoted 2 times
...
vv_bb
1 year, 5 months ago
It should be C Check these links: 1) https://learn.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.builder.pipelinestep?view=azure-ml-py#azureml-pipeline-core-builder-pipelinestep-run-after 2) https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb -> section "Running a few steps in sequence"
upvoted 5 times
...
phdykd
1 year, 9 months ago
C could be
upvoted 3 times
...
iai
1 year, 11 months ago
A. is also wrong because it creates a non documented dependency of step_2_b on step_2_a
upvoted 1 times
...
ajay0011
2 years ago
I will definitely go with D
upvoted 1 times
...
esimsek
2 years, 1 month ago
it should be C
upvoted 2 times
...
STEVTRANCE
2 years, 3 months ago
I don't want to create confusion but I was unable to find documentation about this, so I used chatGCP and it provides code samples, it seems that A is not an option cause the steps parameter should be a list of steps, not a nested list of steps. Option C the pipeline definition is missing the steps that step3 depends on, so like chaudha4 explains the dependencies are implicitly and I would go for option D
upvoted 4 times
jpalaci22
2 years, 2 months ago
I agree. I checked it with ChatGPT (for fun as well) but also verified with the https://docs.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.pipelinedata?view=azure-ml-py which is funny because someone used it earlier to justify D, which it doesn't seem to be correct via the documentation and Microsoft's Jupyter notebooks
upvoted 1 times
...
...
michaelmorar
2 years, 3 months ago
A gets my vote. D has absolutely no sequence and C fails to run step 2_a.
upvoted 2 times
...
FlexingD
2 years, 5 months ago
see the graph, so it's A
upvoted 1 times
...
ning
2 years, 11 months ago
A is correct, that is the syntax I used for years!
upvoted 8 times
JTWang
2 years, 6 months ago
Agree!
upvoted 1 times
...
...
Tj87
3 years ago
D misses the StepSequence and it means it runs all the steps in parallel. Then C seems to be a better option. The only problem with C is that it doesn't run 1_a and 1_b in parallel and it runs them sequentially.
upvoted 4 times
...
JTWang
3 years ago
it should be C Running a few steps in sequence https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb
upvoted 3 times
...
synapse
3 years, 1 month ago
I think the answer is D I think the key here is this sentence: "but will wait for modules with dependencies." This means the lines indicate data dependencies between steps not just the sequence. run_after() or any such constructs are for sequencing where there are no data dependencies between the steps. Text from the notebook linked below: We will reuse step1, step2, step3, but build the pipeline in such a way that we chain step3 after step2 and step2 after step1. Note that there is no explicit data dependency between these steps, but still steps can be made dependent by using the run_after construct. https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-getting-started.ipynb
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago