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

Add Weights & Biases (W&B) Fabric Logger #19077

Closed
wants to merge 29 commits into from

Conversation

ash0ts
Copy link
Contributor

@ash0ts ash0ts commented Nov 28, 2023

What does this PR do?

  • Port the logic of the lightning.pytorch.loggers.WandbLogger into lightning.fabric.loggers.WandbLogger.
  • Added tests to ensure both the current pytorch logger and fabric logger both pass the same test suite as when it was just the pytorch logger
  • Added stripped down version of identical tests from the pytorch logger for the fabric logger without any pytorch specific functionality

Fixes #17885

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

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--19077.org.readthedocs.build/en/19077/

Removed references to PT specific functionality like checkpoint
Removed Trainer references from tests
…pture both workflows

Add stricter type hints on fabric to ensure that only pytorch specific imports occur in pytorch specific function call
Add tests to pytorch tests to test both vanilla and fabric logger
add fabric specific tests
Fix types
Add properties from Logger interface
@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Nov 28, 2023
@github-actions github-actions bot added the docs Documentation related label Nov 28, 2023
Format to match other fabric loggers better
@ash0ts ash0ts marked this pull request as ready for review November 28, 2023 20:34
@ash0ts
Copy link
Contributor Author

ash0ts commented Nov 28, 2023

I'm having difficulty adding in the resultant docs page for the API on the logger if anyone is able to assist!

@awaelchli awaelchli self-assigned this Nov 30, 2023
@ash0ts
Copy link
Contributor Author

ash0ts commented Dec 1, 2023

@awaelchli I noticed some failing tests. Would love discuss how I can get these resolved!

@ash0ts ash0ts requested a review from tchaton as a code owner December 1, 2023 17:44
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Dec 1, 2023
@ash0ts
Copy link
Contributor Author

ash0ts commented Dec 4, 2023

Is there anything I can pointedly fix here? Would love to discuss!

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Merging #19077 (9b8e84a) into master (41503fc) will decrease coverage by 38%.
Report is 1 commits behind head on master.
The diff coverage is 80%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19077      +/-   ##
==========================================
- Coverage      84%      45%     -38%     
==========================================
  Files         445      441       -4     
  Lines       37289    37395     +106     
==========================================
- Hits        31185    16981   -14204     
- Misses       6104    20414   +14310     

@ash0ts
Copy link
Contributor Author

ash0ts commented Dec 26, 2023

Hey! @Borda sorry for the bump. Hope your holidays are/were lovely. Would love to discuss what can be fixed to merge this!

@ash0ts
Copy link
Contributor Author

ash0ts commented Jan 10, 2024

@awaelchli @Borda Would love to see what I can do to fix the failing docs test! Would also love to discuss if there are any other errors that need fixing if they exist

@ash0ts
Copy link
Contributor Author

ash0ts commented Jan 10, 2024

docstring of lightning.fabric.loggers.wandb.WandbLogger:227:py:class reference target not found: wandb.sdk.wandb_run.Run

This specific error is being raised by Sphinx however in my Fabric docstrings I do not refer to :class: wandb.sdk.wandb_run.Run outside of TypeChecks

@ash0ts ash0ts requested a review from Borda January 10, 2024 18:08
@Borda Borda marked this pull request as draft January 15, 2024 18:10
Copy link

gitguardian bot commented Jan 16, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret 78fa3af tests/tests_app/utilities/test_login.py View secret
- Base64 Basic Authentication 78fa3af tests/tests_app/utilities/test_login.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@awaelchli
Copy link
Contributor

Closing in favor of #19451
Great work adding it to wandb as an integration!

@awaelchli awaelchli closed this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file docs Documentation related fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support WandBLogger in Fabric
3 participants