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

Adds lightning fabric integration #749

Merged
merged 17 commits into from
Dec 21, 2023
Merged

Adds lightning fabric integration #749

merged 17 commits into from
Dec 21, 2023

Conversation

dberenbaum
Copy link
Collaborator

@dberenbaum dberenbaum commented Dec 7, 2023

Closes #742. Fabric is Pytorch Lightning's attempt to abstract out the lightweight parts of their codebase so users can benefit from those without having to entirely adapt Lightning.

The existing Lightning logger was updated to inherit from this one. To make everything work with the existing Lightning logger, I added a sync method that decouples next_step from saving all the info to Studio, dvc.yaml, etc. I made it public, but no strong opinion on whether it should be public or documented.

See the Tensorboard logger in lightning for an example of another logger:

@codecov-commenter
Copy link

Codecov Report

Attention: 130 lines in your changes are missing coverage. Please review.

Comparison is base (8406920) 88.79% compared to head (2f81b3f) 86.81%.

Files Patch % Lines
src/dvclive/fabric.py 6.75% 69 Missing ⚠️
tests/frameworks/test_fabric.py 25.00% 27 Missing ⚠️
tests/frameworks/test_lightning.py 0.00% 17 Missing ⚠️
src/dvclive/lightning.py 0.00% 16 Missing ⚠️
src/dvclive/utils.py 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #749      +/-   ##
==========================================
- Coverage   88.79%   86.81%   -1.99%     
==========================================
  Files          53       55       +2     
  Lines        3357     3450      +93     
  Branches      294      304      +10     
==========================================
+ Hits         2981     2995      +14     
- Misses        337      416      +79     
  Partials       39       39              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

},
"outputs": [],
"source": [
"import argparse\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be unused?

shcheklein added a commit that referenced this pull request Dec 9, 2023
"\n",
"from dvclive.fabric import DVCLiveLogger\n",
"\n",
"DATASETS_PATH = (\"Datasets\")"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review: ipywidgets was required for me by tqdm to run this cell

@shcheklein
Copy link
Member

shcheklein commented Dec 9, 2023

Great work! Thanks, @dberenbaum for pushing forward integrations. Some comments as I'm reviewing / running it:

  • While running and after an experiment I can't see plots in VS Code (while it's visible in Jupyter just fine)
  • Review mypy CI errors

@shcheklein
Copy link
Member

@dberenbaum looks good to me overall (I didn't review really deep the Fabric existing loggers to actually deeply review the implementation, but overall it looks fine). I've enabled mypy back + left a comment about VS Code to review, probably also Studio needs to be reviewed / tried out.

@dberenbaum
Copy link
Collaborator Author

@shcheklein
Copy link
Member

I would ask @skshetry and the team on what the current state of the art for this :)

@dberenbaum
Copy link
Collaborator Author

@skshetry How should mypy checks be handled?

@dberenbaum
Copy link
Collaborator Author

ping @skshetry

@dberenbaum
Copy link
Collaborator Author

I'm able to see it in VS Code and Studio:

Screen.Recording.2023-12-14.at.1.23.08.PM.mov
Screen.Recording.2023-12-14.at.1.22.36.PM.mov

@skshetry
Copy link
Member

I would ask @skshetry and the team on what the current state of the art for this :)

We use nox for environment management on py-template based projects. So, you can pip install nox and then nox -s lint will take care of everything related to linting.

Since dvclive seems to have removed nox, you can try adding mypy to pre-commit but up to you.
Look into dvc's pre-commit config.

@dberenbaum dberenbaum mentioned this pull request Dec 15, 2023
@dberenbaum
Copy link
Collaborator Author

Depends on #757 now. The remaining test failure is unrelated.

@dberenbaum dberenbaum merged commit b8a8ecf into main Dec 21, 2023
10 of 11 checks passed
@dberenbaum dberenbaum deleted the fabric branch December 21, 2023 18:45
@dberenbaum dberenbaum mentioned this pull request Dec 22, 2023
@dberenbaum dberenbaum mentioned this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integrations: lightning fabric
4 participants