Skip to content

Conversation

ringohoffman
Copy link

@ringohoffman ringohoffman commented Mar 3, 2025

What does this PR do?

There isn't a need to create trainer/global_step if you are syncing from tensorboard with sync_tensorboard=True.

Since I use TensorboardLogger as my main logger and sync it to wandb with WandbLogger(sync_tensorboard=True), in my case, WandbLogger.log_metrics is never called, and trainer/global_step is never updated. All of my wandb are shown as a single point by default, and I have to manually update my workspace/plots to use global_step.

global_step trainer/global_step
Screenshot 2025-03-02 at 20 57 21 Screenshot 2025-03-02 at 20 57 06

It makes a lot more sense to just default to global_step as the x-axis if sync_tensorboard=True.

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

…f sync_tensorboard=True

there isn't a need to create another global_step if you are syncing from tensorboard
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Mar 3, 2025
@ringohoffman ringohoffman changed the title refactor: Set tensorboard's global_step as the default wandb x-axis if sync_tensorboard=True refactor: Set tensorboard's global_step as the default wandb x-axis if sync_tensorboard=True Mar 3, 2025
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79%. Comparing base (71793c6) to head (c0de998).
Report is 113 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (71793c6) and HEAD (c0de998). Click for more details.

HEAD has 102 uploads less than BASE
Flag BASE (71793c6) HEAD (c0de998)
cpu 48 24
lightning 37 18
pytest 26 0
python3.9 12 6
lightning_fabric 7 0
python3.11 12 6
python3.10 6 3
python3.12.7 18 9
gpu 2 0
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #20611     +/-   ##
=========================================
- Coverage      88%      79%     -9%     
=========================================
  Files         267      264      -3     
  Lines       23369    23316     -53     
=========================================
- Hits        20478    18371   -2107     
- Misses       2891     4945   +2054     

@ringohoffman
Copy link
Author

cc: @Borda

@Borda Borda changed the title refactor: Set tensorboard's global_step as the default wandb x-axis if sync_tensorboard=True wandb: Set tensorboard's global_step as the default wandb x-axis if sync_tensorboard=True Mar 5, 2025
@Borda Borda added logger Related to the Loggers 3rd party Related to a 3rd-party logger: wandb Weights & Biases labels Mar 5, 2025
@ringohoffman
Copy link
Author

Any thoughts on this?

@Borda Borda changed the title wandb: Set tensorboard's global_step as the default wandb x-axis if sync_tensorboard=True fix: Set tensorboard's global_step as the default wandb x-axis if sync_tensorboard=True Mar 10, 2025
@mergify mergify bot removed the has conflicts label Mar 10, 2025
@ringohoffman
Copy link
Author

It looks like 2 tests timed out. Can they be retried?

@Borda Borda merged commit a3314d4 into Lightning-AI:master Mar 10, 2025
77 checks passed
@ringohoffman ringohoffman deleted the set-global_step-default-wandb-x-axis-sync_tensorboard=True branch March 10, 2025 16:25
Borda pushed a commit that referenced this pull request Mar 12, 2025
…if `sync_tensorboard=True` (#20611)

(cherry picked from commit a3314d4)
lexierule pushed a commit that referenced this pull request Mar 18, 2025
…if `sync_tensorboard=True` (#20611)

(cherry picked from commit a3314d4)
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 logger: wandb Weights & Biases 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