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

[AIR][Doc] New Example: LightningTrainer with experiment tracking tools #34812

Merged

Conversation

woshiyyya
Copy link
Member

@woshiyyya woshiyyya commented Apr 27, 2023

Why are these changes needed?

Some users have trouble using wandb/cometML for experiment tracking while onboarding LightningTrainer. They are struggling between PTL native logger and our Ray integration.

This example aims to show the best practices of how to use PTL native logger in LightningTrainer.

Rendered doc: https://anyscale-ray--34812.com.readthedocs.build/en/34812/train/examples/lightning/lightning_exp_tracking.html

Related issue number

Close #34869

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: woshiyyya <[email protected]>
@woshiyyya woshiyyya changed the title [AIR][Doc] Add an example: Using experiment tracking tools with LightningTrainer [AIR][Doc] Add LightningTrainer with experiment tracking tools example Apr 28, 2023
@woshiyyya woshiyyya marked this pull request as ready for review April 28, 2023 02:25
@woshiyyya woshiyyya changed the title [AIR][Doc] Add LightningTrainer with experiment tracking tools example [AIR][Doc] New Example: LightningTrainer with experiment tracking tools May 1, 2023
Copy link
Contributor

@justinvyu justinvyu left a comment

Choose a reason for hiding this comment

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

Nice! Can we also add this example to the table of contents under the other lightning examples.

Nit: Also, I think all lightning examples are tested on GPU right now, but this example only needs CPU? Maybe we can split the folder into examples/lightning/cpu and examples/lightning/gpu.

@woshiyyya
Copy link
Member Author

woshiyyya commented May 16, 2023

Maybe we can split the folder into examples/lightning/cpu and examples/lightning/gpu.

@justinvyu ✅ Created a separate build object that test this example with CPU only.

@woshiyyya woshiyyya requested a review from justinvyu May 16, 2023 19:57
Signed-off-by: woshiyyya <[email protected]>
Signed-off-by: woshiyyya <[email protected]>
Copy link
Contributor

@justinvyu justinvyu left a comment

Choose a reason for hiding this comment

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

LGTM!

@woshiyyya woshiyyya added air tests-ok The tagger certifies test failures are unrelated and assumes personal liability. docs An issue or change related to documentation labels May 17, 2023
Copy link
Contributor

@matthewdeng matthewdeng left a comment

Choose a reason for hiding this comment

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

Looks great! Few minor nits

"\n",
"\n",
":::{note}\n",
"This guide shows how to use the native [Logger](https://lightning.ai/docs/pytorch/stable/extensions/logging.html) integrations in PyTorch Lightning. Ray AIR also provides {ref}`experiment tracking integrations <tune-exp-tracking-ref>` for all the tools mentioned in this example. We recommend sticking with the PyTorch Lightning loggers.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any scenario the user would want to use the AIR integrations instead?

Copy link
Member Author

@woshiyyya woshiyyya May 17, 2023

Choose a reason for hiding this comment

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

Yes. One case I can think of is when a user wants more flexible logging, our integration allows users to directly interact with (e.g. wandb) client objects. However, the Lightning's logger has another layer of abstraction, so some APIs may not be supported by Lightning's logger.

Co-authored-by: matthewdeng <[email protected]>
Signed-off-by: Yunxuan Xiao <[email protected]>
@matthewdeng matthewdeng merged commit 43a20c1 into ray-project:master May 19, 2023
woshiyyya added a commit to woshiyyya/ray that referenced this pull request May 19, 2023
scv119 pushed a commit to scv119/ray that referenced this pull request Jun 16, 2023
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs An issue or change related to documentation tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Doc][Train] Add Experiment Tracking Tools with LightningTrainer Example
4 participants