Published pipeline with dataset (name) as PipelineParameter using a ParallelRunStep
I would like to publish a pipeline which takes as parameter the name of an input dataset. Something along the lines of:
dataset_name = PipelineParameter(name="dataset_name", default_value="input_dataset")
dataset = Dataset.get_by_name(workspace, dataset_name)
parallel_run_step = ParallelRunStep(
name='parallel_batch_inference',
models=[model],
parallel_run_config=parallel_run_config,
inputs=[dataset.as_named_input('input_dataset')],
output=output_dir,
arguments=arguments,
)
A compromise would be to apply the suggestion from #328 where a DataPath is used in conjunction with PipelineParameter as follows:
datapath = DataPath(datastore=def_blob_store, path_on_datastore='input_data/')
datapath_param = PipelineParameter(name="input_data", default_value=datapath)
data_parameter = (datapath_param, DataPathComputeBinding(mode='mount'))
step_ = PythonScriptStep(
script_name="infer.py",
arguments=["--input", data_parameter],
inputs=[data_parameter],
outputs=[processed_data],
compute_target=gpucluster,
)
However, the ParallelRunStep class does not seem to accept the (PipelineParameter, DataPathCompute) tuple input structure.
How would i go about parametrising the input dataset when using a ParallelRunStep?
Hi @JanusAsmussen, unfortunately, we currently don't support Dataset with PipelineParameter but it is something we are working on adding in the next two months. I will update here once the feature has been shipped.
is there an update on this issue?
I have a scenario where I need to vary the path of the input dataset to ParallelRunStep when calling a published pipeline. I can pass in the subfolder path to the published pipeline using the REST end point, but there does not seem to be a way to affect a change on the input dataset to the step.
failing to achieve this means that the run() method in the entry script is always passed the full minibatch, which leaves it to the entry_script logic to filter through and only process those files under the subfolder.
@rongduan-zhu do you have any update for this ask?
We have added support for using dataset with pipeline parameter. Please see the example here. We currently only support parameterizing based on the Dataset ID but not from a datastore + path on datastore. We are adding support this month.
@rongduan-zhu does this work for DatabricksStep? I can't seem to make it work and all examples I see use PythonScriptStep.
We have added support for using dataset with pipeline parameter. Please see the example here. We currently only support parameterizing based on the Dataset ID but not from a datastore + path on datastore. We are adding support this month.
@rongduan-zhu I wonder if there is an update on this?
I want to use something like in the documentation here, but using ParallelRunStep instead of PythonScriptStep. For example:
datapath = DataPath(datastore=datastore, path_on_datastore='input_data')
data_path_pipeline_param = (PipelineParameter(name="input_data", default_value=datapath),
DataPathComputeBinding(mode='mount'))
train_step = ParallelRunStep(script_name="train.py",
arguments=["--input", data_path_pipeline_param],
inputs=[data_path_pipeline_param],
target=compute_target,
source_directory=project_folder)
is there any update on this?
@JanusAsmussen @shbijlan @parimalak Have you tried this approach? https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/parallel-run/file-dataset-image-inference-mnist.ipynb
@JanusAsmussen i was able resolve by using
from azureml.core.dataset import Dataset from azureml.data.dataset_consumption_config import DatasetConsumptionConfig from azureml.pipeline.core import PipelineParameter dataset = Dataset.get_by_name(workspace, name='resnet-test') pipeline_param = PipelineParameter(name="input_data", default_value=dataset) input_data_config = DatasetConsumptionConfig("input_data_config", pipeline_param).as_mount()
from azureml.pipeline.steps import ParallelRunStep, ParallelRunConfig parallel_run_step = ParallelRunStep( name="prs-test", parallel_run_config = parallel_run_config, inputs=[ input_data_config ], output=output_dir, allow_reuse=False, )
Hi @ALPA-Industry-and-Technology and @parimalak,
We stopped using AML due to a number of limitations but thanks for the updates.
@JanusAsmussen Out of genuine interest: Could you name and explain some limitations of AML, please? I am asking for me personally to know about limitations of AML.
@ALPA-Industry-and-Technology
It has been more than 2 years since we did the AML PoC, so the limitations I found back then may very well be resolved by now (This thread is an example of this).