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

Lazily import dependencies for MLFlowLogger #18528

Merged
merged 14 commits into from
Sep 12, 2023

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Sep 12, 2023

What does this PR do?

Refactors the mlflow logger module to lazily import its dependencies only when the MLFlowLogger instance is requested.
Part of #12786

The other logger modules will get the same treatment.

cc @justusschock @awaelchli @Borda

@awaelchli awaelchli added refactor logger: mlflow performance fun Staff contributions outside working hours - to differentiate from the "community" label labels Sep 12, 2023
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Sep 12, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 12, 2023

⚡ Required checks status: All passing 🟢

Groups summary

🟢 pytorch_lightning: Tests workflow
Check ID Status
pl-cpu (macOS-11, lightning, 3.8, 1.11) success
pl-cpu (macOS-11, lightning, 3.9, 1.12) success
pl-cpu (macOS-11, lightning, 3.10, 1.13) success
pl-cpu (macOS-11, lightning, 3.10, 2.0) success
pl-cpu (macOS-11, lightning, 3.8, 1.11, oldest) success
pl-cpu (ubuntu-20.04, lightning, 3.8, 1.11) success
pl-cpu (ubuntu-20.04, lightning, 3.9, 1.12) success
pl-cpu (ubuntu-20.04, lightning, 3.10, 1.13) success
pl-cpu (ubuntu-20.04, lightning, 3.10, 2.0) success
pl-cpu (ubuntu-20.04, lightning, 3.8, 1.11, oldest) success
pl-cpu (windows-2022, lightning, 3.8, 1.11) success
pl-cpu (windows-2022, lightning, 3.9, 1.12) success
pl-cpu (windows-2022, lightning, 3.10, 1.13) success
pl-cpu (windows-2022, lightning, 3.10, 2.0) success
pl-cpu (windows-2022, lightning, 3.8, 1.11, oldest) success
pl-cpu (macOS-11, pytorch, 3.8, 1.13) success
pl-cpu (ubuntu-20.04, pytorch, 3.8, 1.13) success
pl-cpu (windows-2022, pytorch, 3.8, 1.13) success
pl-cpu (macOS-12, pytorch, 3.11, 2.0) success
pl-cpu (ubuntu-22.04, pytorch, 3.11, 2.0) success
pl-cpu (windows-2022, pytorch, 3.11, 2.0) success

These checks are required after the changes to src/lightning/pytorch/loggers/__init__.py, src/lightning/pytorch/loggers/mlflow.py, tests/tests_pytorch/loggers/conftest.py, tests/tests_pytorch/loggers/test_all.py, tests/tests_pytorch/loggers/test_mlflow.py.

🟢 pytorch_lightning: Azure GPU
Check ID Status
[pytorch-lightning (GPUs) (testing Lightning latest)](https://dev.azure.com/Lightning-AI/72ab7ed8-b00f-4b6e-b131-3388f7ffafa7/_build/results?buildId=174180&view=logs&jobId=47e66f3c-897a-5428-da11-bf5c7745762e) success
[pytorch-lightning (GPUs) (testing PyTorch latest)](https://dev.azure.com/Lightning-AI/72ab7ed8-b00f-4b6e-b131-3388f7ffafa7/_build/results?buildId=174180&view=logs&jobId=fe777007-6e77-5e50-6e71-fc5977ab193a) success

These checks are required after the changes to src/lightning/pytorch/loggers/__init__.py, src/lightning/pytorch/loggers/mlflow.py, tests/tests_pytorch/loggers/conftest.py, tests/tests_pytorch/loggers/test_all.py, tests/tests_pytorch/loggers/test_mlflow.py.

🟢 pytorch_lightning: Benchmarks
Check ID Status
lightning.Benchmarks success

These checks are required after the changes to src/lightning/pytorch/loggers/__init__.py, src/lightning/pytorch/loggers/mlflow.py.

🟢 pytorch_lightning: Docs
Check ID Status
docs-make (pytorch, doctest) success
docs-make (pytorch, html) success

These checks are required after the changes to src/lightning/pytorch/loggers/__init__.py, src/lightning/pytorch/loggers/mlflow.py.

🟢 mypy
Check ID Status
mypy success

These checks are required after the changes to src/lightning/pytorch/loggers/__init__.py, src/lightning/pytorch/loggers/mlflow.py.

🟢 install
Check ID Status
install-pkg (ubuntu-22.04, app, 3.8) success
install-pkg (ubuntu-22.04, app, 3.11) success
install-pkg (ubuntu-22.04, fabric, 3.8) success
install-pkg (ubuntu-22.04, fabric, 3.11) success
install-pkg (ubuntu-22.04, pytorch, 3.8) success
install-pkg (ubuntu-22.04, pytorch, 3.11) success
install-pkg (ubuntu-22.04, lightning, 3.8) success
install-pkg (ubuntu-22.04, lightning, 3.11) success
install-pkg (ubuntu-22.04, notset, 3.8) success
install-pkg (ubuntu-22.04, notset, 3.11) success
install-pkg (macOS-12, app, 3.8) success
install-pkg (macOS-12, app, 3.11) success
install-pkg (macOS-12, fabric, 3.8) success
install-pkg (macOS-12, fabric, 3.11) success
install-pkg (macOS-12, pytorch, 3.8) success
install-pkg (macOS-12, pytorch, 3.11) success
install-pkg (macOS-12, lightning, 3.8) success
install-pkg (macOS-12, lightning, 3.11) success
install-pkg (macOS-12, notset, 3.8) success
install-pkg (macOS-12, notset, 3.11) success
install-pkg (windows-2022, app, 3.8) success
install-pkg (windows-2022, app, 3.11) success
install-pkg (windows-2022, fabric, 3.8) success
install-pkg (windows-2022, fabric, 3.11) success
install-pkg (windows-2022, pytorch, 3.8) success
install-pkg (windows-2022, pytorch, 3.11) success
install-pkg (windows-2022, lightning, 3.8) success
install-pkg (windows-2022, lightning, 3.11) success
install-pkg (windows-2022, notset, 3.8) success
install-pkg (windows-2022, notset, 3.11) success

These checks are required after the changes to src/lightning/pytorch/loggers/__init__.py, src/lightning/pytorch/loggers/mlflow.py.


Thank you for your contribution! 💜

Note
This comment is automatically generated and updates for 60 minutes every 180 seconds. If you have any other questions, contact carmocca for help.

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #18528 (d0e225d) into master (4dfc09c) will decrease coverage by 35%.
Report is 11 commits behind head on master.
The diff coverage is 56%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18528      +/-   ##
==========================================
- Coverage      85%      50%     -35%     
==========================================
  Files         427      419       -8     
  Lines       33372    33237     -135     
==========================================
- Hits        28373    16691   -11682     
- Misses       4999    16546   +11547     

@mergify mergify bot added the ready PRs ready to be merged label Sep 12, 2023
@awaelchli awaelchli merged commit 6ab443f into master Sep 12, 2023
@awaelchli awaelchli deleted the refactor/mlflow-import-overhead branch September 12, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fun Staff contributions outside working hours - to differentiate from the "community" label logger: mlflow performance pl Generic label for PyTorch Lightning package ready PRs ready to be merged refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants