4

On 2021-08-18 Microsoft (for our convenience ?) made the following changes to their Azure ML SDK:

Azure Machine Learning Experimentation User Interface. Run Display Name.

  • The Run Display Name is a new, editable and optional display name that can be assigned to a run.
  • This name can help with more effectively tracking, organizing and discovering the runs.
  • The Run Display Name is defaulted to an adjective_noun_guid format (Example: awesome_watch_2i3uns).
  • This default name can be edited to a more customizable name. This can be edited from the Run details page in the Azure Machine Learning studio user interface.

Before this change to the SDK, Run Display Name = experiment name + hash. I was assigning the experiment name from the SDK:

from azureml.core import Experiment
experiment_name = 'yus_runExperiment'
experiment=Experiment(ws,experiment_name)
run = experiment.submit(src)

After the change the Run Display Names are auto-generated.

enter image description here

I do not want to manually edit/change the Run Display Name as I may sometimes run 100-s experiments a day.

I tried to find an answer in the Microsoft documentation, but my attempts have failed.

Is there an Azure SDK function to assign the Run Display Name ?

yus
  • 155
  • 1
  • 10
  • Your headline suggests you want to know how to change the experiment name, but your last line asks for how to change the `run display name`. You might want to so that the question in the body text and headline matches. – Olsgaard Mar 14 '22 at 10:29

3 Answers3

3

Just tested in sdk v1.38.0.

You could do like this:

from azureml.core import Experiment
experiment_name = 'yus_runExperiment'
experiment=Experiment(ws,experiment_name)
run = experiment.submit(src)
run.display_name = "Training"

Screenshot

  • I don't know why this was downvoted. It works. I do find it odd that you have to update the name after the run is started, instead of adding a display name to the config, before submitting, but that is hardly the fault of the answer! – Olsgaard Mar 14 '22 at 10:35
  • This works! Thank you. – Ross Aug 23 '23 at 15:28
2

It's undocumented (so try at your own risk I guess) but I successfully changed the display name using the following python code.

from azureml.core import Experiment, Run, Workspace

ws = Workspace.from_config()
exp = Experiment(workspace=ws, name=<name>)
run = Run(exp, <run id>)
run.display_name = <new display name>
Jesse Anderson
  • 4,507
  • 26
  • 36
  • changing run.display_name does not change Display name that in shown in Home>Experiments>experiment_name – yus Dec 22 '21 at 15:54
  • The Run display name and the experiment name are two different things. The experiment name is set in this line Experiment(workspace=ws, name=. – Nikki Mar 04 '22 at 14:38
1

Tested inside notebook on AML compute instance and with azureml-sdk version 1.37.0:

from azureml.core import Workspace, Run
run = Run.get_context()
if "OfflineRun" not in run.id:
    # works for an offline run on azureml compute instance
    workspace = run.experiment.workspace
else:
    # For an AML run, do your auth for AML here like:
    # workspace = Workspace(subscription_id, resource_group, workspace_name, auth)
    pass # remove that pass for sure when you're running inside AML cluster
run.display_name = "CustomDisplayName"
run.description = "CustomDescription"
print(f"workspace has the run {run.display_name} with the description {run.description}")

Output:

workspace has the run CustomDisplayName with the description CustomDescription

Sysanin
  • 1,501
  • 20
  • 27