0

Trying to run and debug a pipeline locally. Pipeline is imeplemented with azure.ml.component.dsl.pipeline. When I try to set default_compute_target='local', the compute target cannot be found:

local not found in workspace, assume this is an AmlCompute
...
File "/home/amirabdi/miniconda3/envs/stm/lib/python3.8/site-packages/azure/ml/component/run_settings.py", line 596, in _get_compute_type
    raise InvalidTargetSpecifiedError(message="Cannot find compute '{}' in workspace.".format(compute_name))
azure.ml.component._util._exceptions.InvalidTargetSpecifiedError: InvalidTargetSpecifiedError:
        Message: Cannot find compute 'local' in workspace.
        InnerException None
        ErrorResponse
{
    "error": {
        "code": "UserError",
        "message": "Cannot find compute 'local' in workspace."
    }
}

The local run, for example, can be achieved with azureml.core.ScriptRunConfig.

src = ScriptRunConfig(script="train.py", compute_target="local", environment=myenv)
run = exp.submit(src)
Amir
  • 2,259
  • 1
  • 19
  • 29

1 Answers1

0

We have different types of compute targets and one of those is local computer.

  1. Create an experiment

    from azureml.core import Experiment

    experiment_name = 'my_experiment'

    experiment = Experiment(workspace=ws, name=experiment_name)

  2. Select the compute target where we need to run

    compute_target='local'

  3. If the compute_target is not mentioned or ScriptRunConfig is not mentioned, then AzureML will run the script locally

    from azureml.core import Environment

    myenv = Environment("user-managed-env")

    myenv.python.user_managed_dependencies = True

  4. Create the script job, based on the procedure mentioned in link

  5. Submit the experiment

run = experiment.submit(config=src)

run.wait_for_completion(show_output=True)

  1. To check for the troubleshooting the procedure, check with link
Sairam Tadepalli
  • 1,563
  • 1
  • 3
  • 11
  • I'm particularly asking about `dsl.pipeline`. I can run jobs locally with `experiment.submit()` as shown in the question. But, can't do the same with `dsl.pipelines`. – Amir Aug 18 '22 at 22:07
  • you are using an internal preview version of SDK. pipeline local run is not a public preview feature yet. please raise a support ticket to discuss internally. – Ram Sep 06 '22 at 16:12