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

GPU and TPU usage guide #826

Merged
merged 3 commits into from
Mar 1, 2022
Merged

GPU and TPU usage guide #826

merged 3 commits into from
Mar 1, 2022

Conversation

gsamaras
Copy link
Contributor

Fixes #808 .

Summary

As discussed, added a guide on how to use GPU and TPU with PyTorch Lightning. Also shows that a model uses CPU by default, based on an RNN example.

Other Information

[off-topic] The documentation has a typo in Timeseries here, which I corrected in this pull request.

Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

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

This is great, thanks a lot :)
My only suggestion would be to add a link to PyTorch Lightning accelerator documentation, as it will provide reference documentation as to how to use accelerators.

Now the model is ready to start predicting, which won't be shown here since it's included in the example linked in the start of this guide.

## Use a GPU
GPUs can dramatically improve the performance of your model in terms of processing time. We only need to instruct our model to use our machine's GPU through PyTorch Lighnting Trainer parameters, which are expressed as the `pl_trainer_kwargs` dictionary, like this:
Copy link
Contributor

Choose a reason for hiding this comment

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

You could add a reference to the Pytorch Lightning doc (e.g. this page: https://pytorch-lightning.readthedocs.io/en/stable/common/trainer.html#accelerator) here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hrzn yes, argh I knew I forgot sth, thanks! OK, so now I pushed the update in my cloned repo (gsamaras/darts). What I should do now? It seems like that change is already reflected in this pull request?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! Basically there's nothing more to do on your side for now. We'll wait for the checks to finish and then merge your branch. Thanks for the contribution :)

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2022

Codecov Report

Merging #826 (f326a1a) into master (7ca7801) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #826   +/-   ##
=======================================
  Coverage   91.33%   91.33%           
=======================================
  Files          69       69           
  Lines        6867     6867           
=======================================
  Hits         6272     6272           
  Misses        595      595           
Impacted Files Coverage Δ
darts/timeseries.py 88.05% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ca7801...f326a1a. Read the comment docs.

@hrzn hrzn merged commit 2c0453d into unit8co:master Mar 1, 2022
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.

[BUG] TypeError: __init__() got an unexpected keyword argument 'tpus'
3 participants