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
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