Azure / MachineLearningNotebooks

Python notebooks with ML and deep learning examples with Azure Machine Learning Python SDK | Microsoft
https://docs.microsoft.com/azure/machine-learning/service/
MIT License
4.01k stars 2.49k forks source link

Deleting experiments #196

Open davidbending opened 5 years ago

davidbending commented 5 years ago

Is it possible to delete individual experiments within a workspace. This would help keep things tidier and free up unneeded resources.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

heatherbshapiro commented 5 years ago

It is currently not possible to delete an experiment within a workspace but we are working on adding the functionality in the next several months.

mitchellspryn commented 5 years ago

Is there an ETA for this?

amsword commented 5 years ago

Any update on this issue?

skasturi commented 5 years ago

@deepak-muniappan

alexkayal commented 5 years ago

Seriously there should have been an update on this already. My workspace is cluttered with months' worth of experiments and there should be a simple way to clean it up.

richardleeaus commented 4 years ago

Hoping for this to come sooner rather than later to clear clutter. There has to be a better way other than starting a new workspace.

alieus commented 4 years ago

Are there any updates on this issue? This is definitely a must have for us. We are cluttered by months of experiment runs

nathanclemente commented 4 years ago

+1 hoping to have an update on this soon

qawnaoya commented 4 years ago

+1 hoping

Ridooo commented 4 years ago

+1 hoping

SeanMirchi commented 4 years ago

Well seems like they've added something in the latest version -> azureml-core-1.0.69 Now Experiment class has an archive function. You can use it like this:

    from azureml.core.experiment import Experiment
    ws = Workspace.from_config(auth=authenticate())
    ex = Experiment(ws, 'experiment_name')
    ex.archive()

This disables the experiment and then it is not visible in the UI anymore.

oussamachelly commented 4 years ago

+1 delete() method in the SDK

b93rn commented 3 years ago

+1 run.delete()method in the SDK as well.

jarandaf commented 3 years ago

I see this is planned for version 2.0. What is the release date estimate?

lostmygithubaccount commented 3 years ago

a limited private preview is starting this month, public preview date is not confirmed - @jpe316 @danielsc

mrevow commented 3 years ago

looks like the official documentation is ahead of the release. It already shows a delete method on the Experiment object

jarandaf commented 3 years ago

Latest package version (1.19.0) has indeed a delete method but it does not seem to allow deleting experiments with runs:

ipdb> Experiment.delete(ws, exp.id)
*** msrestazure.azure_exceptions.CloudError: Azure Error: UserError
Message: Only empty Experiments can be deleted. This experiment contains run(s)
lostmygithubaccount commented 3 years ago

preview is usable with limited support and features (but basic and distributed training works) - you can find the docs at https://aka.ms/azuremlv2 and the source repo at https://github.com/Azure/azureml-v2-preview

swinner95 commented 3 years ago

While deleting experiments is currently not supported from the AML studio UI, the functionality to delete runs from the AML Studio UI is currently under private preview and should be available for public preview ETA end of of January.

ncolossi commented 3 years ago

I have been able to see the AML studio UI delete functionality on my workspace. However my customer does not see it yet. Do we need to whitelist their workspace for them to see the Delete button? Can you confirm is public preview?

lostmygithubaccount commented 3 years ago

often, Microsoft employees will see these types of UI previews shortly before being rolled out publicly - @swinner95 to confirm ETAs/if you can onboard a customer sooner

swinner95 commented 3 years ago

the run delete is still under private preview where users can delete the run metadata and metrics. For this functionality to be enabled for your subscription, users will need to request access and we will enable it for your subscription(s). (Signup: https://forms.office.com/r/57kj1BPx1t ) We are working on improving this functionality before rolling this functionality out more broadly.

slsu0424 commented 3 years ago

Hello - I seem to be running into a similar issue as @jarandaf. Following the available syntax here - https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.experiment.experiment?view=azure-ml-py#delete-workspace--experiment-id-

# sample_code.py

# delete(workspace, experiment_id)
delete(ssuaml, mlflow-diabetes-experiment-logreg)

I ran the code in a Azure ML notebook with the following error:

azureuser@ssu1:~/cloudfiles/code/Users/sansu$ python sample_code.py 
Traceback (most recent call last):
  File "sample_code.py", line 3, in <module>
    delete(ssuaml, mlflow-diabetes-experiment-logreg)
NameError: name 'delete' is not defined
swinner95 commented 3 years ago

Can you try calling Experiment.delete(ssuaml, mlflow-diabetes-experiment-logreg) ?

slsu0424 commented 3 years ago

@swinner95 - here is the error I receive:

Welcome to Azure Machine Learning Terminal

Type "git clone [url]" to clone a repo
Type "git --help" to learn about Git CLI
Type "az ml --help" to learn about Azure ML CLI

azureuser@ssu1:/mnt/batch/tasks/shared/LS_root/mounts/clusters/ssu1/code$ cd ~/cloudfiles/code/Users/sansu

python sample_code.py azureuser@ssu1:~/cloudfiles/code/Users/sansu$ azureuser@ssu1:~/cloudfiles/code/Users/sansu$ python sample_code.py Traceback (most recent call last): File "sample_code.py", line 4, in Experiment.delete(ssuaml, mlflow-diabetes-experiment-logreg) NameError: name 'Experiment' is not defined azureuser@ssu1:~/cloudfiles/code/Users/sansu$

edwardnguyen1705 commented 3 years ago

Has thi issue been solved yet? I have encountered something like this: Here is what I have been trying to do:

# get a list of all Experiments objects contained in Workspace
experiments_lst = Experiment.list(ws)
for experiment in experiments_lst:
    print(experiment.name)
    Experiment.delete(ws, experiment.id)

And the response looks like this:

    raise CloudError(self._response)
msrestazure.azure_exceptions.CloudError: Azure Error: UserError
Message: Only empty Experiments can be deleted. This experiment contains run(s)
AnaValeriaS commented 3 years ago

Any update on this issue?

luigiw commented 3 years ago

Hello, Experiment.delete() can only delete empty experiments, i.e. experiments without any runs. So if your experiment is not empty, you'll need to delete all the runs in it first before deleting the experiment.

coleman-wma commented 2 years ago

Running into the same 'experiment can't be deleted because it's got runs in it' message. It's not apparent how to delete runs - no link that I can see in the UI, the run object doesn't have a delete option - can someone tell me how runs can be deleted?

jarandaf commented 2 years ago

AFAIK runs can be deleted from the UI in private preview. I am not sure whether this feature has been already officially released.

coleman-wma commented 2 years ago

Thanks @jarandaf - I've requested that private preview as I don't have any run delete option in the UI.

ZekunZh commented 2 years ago

Hello, I am having the same issue for deleting the experiments and the runs in one experiment.

What I have tried: 3 different ways to delete the run

  1. For each run in the experiment, I ran run.clean(). Then I ran Experiment.delete(workspace, experiment_id).

    • Result: nothing have changed in Azure blob. I can find all the outputs in the blob AzmlStorageAccount/azureml/ExperimentRun/dcid.{my_run_id}
  2. In the UI of azureml, I deleted all the runs.

    • Result: nothing have changed in Azure blob. I can find all the outputs in the blob AzmlStorageAccount/azureml/ExperimentRun/dcid.{my_run_id}
  3. In the blob storage of azureml, I deleted all the blobs that are concerned with the run, mainly those:

    1. AzmlStorageAccount/azureml/ExperimentRun/dcid.{my_run_id}
    2. AzmlStorageAccount/azureml/ArtifactZip/ExperimentRun/dcid.{my_run_id}.zip
    3. AzmlStorageAccount/azureml/ComputeRecord/dcid.{my_run_id}
    • Result: nothing have changed in UI of azureml. We still have access to Outputs+logs and Code

In summary, currently the UI interface is discorrelated with the Azure blob storage. And the Python APIs for experiments & runs have no effect neither on UI interface nor on Azure blob storage.

I will be really grateful if anyone can give some ideas. Thanks !

yokosyun commented 3 months ago

+1 run.delete()method in the SDK as well.

it does not exist run.delete() nor run.archive() with azureml-sdk=1.55.0

only experiment delete is allowed :cry: