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

Fix the file extension of model checkpoints uploaded by NeptuneLogger #20581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

senarvi
Copy link
Contributor

@senarvi senarvi commented Feb 10, 2025

What does this PR do?

NeptuneLogger.after_save_checkpoint() will upload the last and the best model checkpoint using

self.run[...].upload(<filepath>)

instead of

with open(<filepath>) as fp:
    self.run[...] = File.from_stream(fp)

In addition to reducing a couple of lines of code, this will cause the file extension of the checkpoint to appear correctly as .ckpt instead of .bin.

The current code already uploads the best k models this way.

To me this seems like a pretty trivial fix, but I can start a discussion if needed. Maybe some of the previous authors of NeptuneLogger can comment if it was written as it is on purpose? @shnela @Raalsky @williamFalcon @kshitij12345

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

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

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

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79%. Comparing base (ea59e40) to head (096db84).
Report is 2 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (ea59e40) and HEAD (096db84). Click for more details.

HEAD has 2247 uploads less than BASE
Flag BASE (ea59e40) HEAD (096db84)
cpu 525 24
lightning_fabric 67 0
pytest 266 0
python3.9 132 6
lightning 394 18
python3.10 66 3
python3.11 132 6
python3.12.7 195 9
gpu 2 0
pytorch2.1 99 9
pytest-full 261 24
pytorch2.2.2 33 3
pytorch_lightning 66 6
pytorch2.3 33 3
pytorch2.4.1 31 3
pytorch2.5.1 65 6
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #20581     +/-   ##
=========================================
- Coverage      88%      79%     -9%     
=========================================
  Files         267      264      -3     
  Lines       23380    23322     -58     
=========================================
- Hits        20481    18363   -2118     
- Misses       2899     4959   +2060     

@Borda Borda added logger Related to the Loggers 3rd party Related to a 3rd-party community This PR is from the community labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Related to a 3rd-party community This PR is from the community logger Related to the Loggers pl Generic label for PyTorch Lightning package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants