Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when logging to MLFlow deleted experiment #20556

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

millskyle
Copy link

@millskyle millskyle commented Jan 21, 2025

What does this PR do?

Addresses issue #20555.

When logging to an MLFlow experiment name that has been deleted (e.g. deleted from the MLFlow UI), the MLFlow experiment still exists in the backend, so expt = self._mlflow_client.get_experiment_by_name(self._experiment_name) retrieves it and Lightning proceeds as if the experiment already exists. When Lightning actually tries to log to the experiment, it stalls as MLFlow returns many 500 errors. Eventually it times out and the program crashes.

This PR simply modifies the check to ensure that the run exists and also is not deleted. This will cause the experiment creation to fail, but with an error message that explicitly states that it cannot be created because there is a deleted experiment with the same name.

This could be handled differently to not crash the run (e.g. increment the experiment name by post-pending _1, _2, etc.) but I think the explicit failure with a clear message is my preferred behaviour.

Fixes #20555>


📚 Documentation preview 📚: https://pytorch-lightning--20556.org.readthedocs.build/en/20556/

@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Jan 21, 2025
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79%. Comparing base (a944e77) to head (4b654c5).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (a944e77) and HEAD (4b654c5). Click for more details.

HEAD has 5427 uploads less than BASE
Flag BASE (a944e77) HEAD (4b654c5)
cpu 1228 24
lightning 922 18
pytest 601 0
python3.9 308 6
lightning_fabric 151 0
python3.10 153 3
python3.11 309 6
python3.12.7 458 9
gpu 2 0
pytorch2.1 236 9
pytest-full 629 24
pytorch_lightning 157 6
pytorch2.2.2 79 3
pytorch2.3 80 3
pytorch2.4.1 78 3
pytorch2.5.1 156 6
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #20556     +/-   ##
=========================================
- Coverage      88%      79%     -9%     
=========================================
  Files         267      264      -3     
  Lines       23380    23325     -55     
=========================================
- Hits        20481    18366   -2115     
- Misses       2899     4959   +2060     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pl Generic label for PyTorch Lightning package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MLFlow ResponseError('too many 500 error responses') if try to log to deleted experiment
1 participant