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

[Doc] Update LightningTrainer MNIST example. #34867

Merged

Conversation

woshiyyya
Copy link
Member

@woshiyyya woshiyyya commented Apr 28, 2023

Why are these changes needed?

Some users reported that there are some updates in lightning 2.0 and torchmetrics that our example are not compatible with. Update our example accordingly.

Changes:

  • Update Accuracy() to Accuracy(task=, num_classes=), the former one is deprecated in torchmetrics>0.9
  • Update evaluation_epoch_end() to on_evaluation_epoch_end(), since the former is deprecated in ptl 2.0

The two changes above are backward compatible, so it won't affect the users using lightning/torchmetrics with an older version.

Related issue number

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]>
@@ -232,7 +225,7 @@
" # )\n",
" config_builder.trainer(\n",
" max_epochs=10,\n",
" accelerator=\"cpu\",\n",
" accelerator=\"gpu\" if use_gpu else \"cpu\",\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the user even need to set this? Can this be inferred and set from the ScalingConfig, and if not can we just raise a warning?

@richardliaw richardliaw merged commit a92adcc into ray-project:master May 1, 2023
architkulkarni pushed a commit to architkulkarni/ray that referenced this pull request May 16, 2023
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.

3 participants