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

[lightning] GPU support #961

Merged
merged 4 commits into from
Nov 22, 2022
Merged

[lightning] GPU support #961

merged 4 commits into from
Nov 22, 2022

Conversation

karl-richter
Copy link
Collaborator

@karl-richter karl-richter commented Nov 15, 2022

Adds functionality to train the TimeNet model using an accelerator.
Supports GPU, MPS (M1) automatically and all other available Pytorch Lightning accelerators via manual declaration (eg. TPU etc.). Updated after Lightning merge.

Closes #420
Closes #938

@karl-richter karl-richter self-assigned this Nov 15, 2022
@karl-richter karl-richter changed the title added gpu support [lightning] GPU support Nov 15, 2022
@github-actions
Copy link

github-actions bot commented Nov 15, 2022

1efc395

Model Benchmark

Show benchmark results
Benchmark Metric main current diff
AirPassengers MAE_val 15.2698 15.2698 0.0%
AirPassengers RMSE_val 19.4209 19.4209 0.0%
AirPassengers Loss_val 0.00195 0.00195 0.0%
AirPassengers RegLoss_val 0 0 0.0%
AirPassengers epoch 89 89 0.0%
AirPassengers MAE 9.82902 9.82902 0.0%
AirPassengers RMSE 11.7005 11.7005 0.0%
AirPassengers Loss 0.00056 0.00056 0.0%
AirPassengers RegLoss 0 0 0.0%
PeytonManning MAE_val 0.64636 0.64636 -0.0%
PeytonManning RMSE_val 0.79276 0.79276 -0.0%
PeytonManning Loss_val 0.01494 0.01494 -0.0%
PeytonManning RegLoss_val 0 0 0.0%
PeytonManning epoch 37 37 0.0%
PeytonManning MAE 0.42701 0.42701 0.0%
PeytonManning RMSE 0.57032 0.57032 -0.0%
PeytonManning Loss 0.00635 0.00635 0.0%
PeytonManning RegLoss 0 0 0.0%
YosemiteTemps MAE_val 1.72949 1.72948 -0.0%
YosemiteTemps RMSE_val 2.27386 2.27386 -0.0%
YosemiteTemps Loss_val 0.00096 0.00096 -0.0%
YosemiteTemps RegLoss_val 0 0 0.0%
YosemiteTemps epoch 84 84 0.0%
YosemiteTemps MAE 1.45189 1.45189 -0.0%
YosemiteTemps RMSE 2.16631 2.16631 -0.0%
YosemiteTemps Loss 0.00066 0.00066 0.0%
YosemiteTemps RegLoss 0 0 0.0%

Model Training

PeytonManning

YosemiteTemps

AirPassengers

@karl-richter karl-richter added the status: needs review PR needs to be reviewed by Reviewer(s) label Nov 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Merging #961 (b8be966) into main (135e8b1) will decrease coverage by 0.25%.
The diff coverage is 13.33%.

@@            Coverage Diff             @@
##             main     #961      +/-   ##
==========================================
- Coverage   87.68%   87.43%   -0.26%     
==========================================
  Files          17       17              
  Lines        4433     4448      +15     
==========================================
+ Hits         3887     3889       +2     
- Misses        546      559      +13     
Impacted Files Coverage Δ
neuralprophet/utils.py 80.06% <7.14%> (-3.28%) ⬇️
neuralprophet/forecaster.py 87.99% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Kevin-Chen0 Kevin-Chen0 added this to the Release 0.5.0 milestone Nov 15, 2022
@Kevin-Chen0
Copy link
Collaborator

Can you make test case(s) for this to improve the codecov?

@Kevin-Chen0 Kevin-Chen0 added enhancement status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved and removed status: needs review PR needs to be reviewed by Reviewer(s) labels Nov 16, 2022
@karl-richter
Copy link
Collaborator Author

Can you make test case(s) for this to improve the codecov?

@Kevin-Chen0 Note sure if that makes sense in this case, bc the machine would need to have a GPU / accelerator aside from CPU to test the feature. As far as I know thats not available / reasonable in gh actions.

@karl-richter karl-richter added status: needs review PR needs to be reviewed by Reviewer(s) and removed status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved labels Nov 16, 2022
@Kevin-Chen0
Copy link
Collaborator

Can you resolve the merge conflict first?

@Kevin-Chen0 Kevin-Chen0 added status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved and removed status: needs review PR needs to be reviewed by Reviewer(s) labels Nov 17, 2022
@karl-richter karl-richter added status: needs review PR needs to be reviewed by Reviewer(s) and removed status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved labels Nov 18, 2022
@Kevin-Chen0
Copy link
Collaborator

Kevin-Chen0 commented Nov 19, 2022

Karl, can you address the two questions I have before I approve? In the meantime, I'm changing the status back to needs fix. Thx.

@Kevin-Chen0 Kevin-Chen0 added status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved and removed status: needs review PR needs to be reviewed by Reviewer(s) labels Nov 19, 2022
@noxan noxan self-requested a review November 22, 2022 06:11
Copy link
Collaborator

@noxan noxan left a comment

Choose a reason for hiding this comment

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

Code looks good to me and no merge conflicts.

I agree with @Kevin-Chen0 that it would be great to have test cases, yet as @karl-richter pointed out there is no option with github actions I'd be aware of - if someone knows any good way lets create test cases with a follow up issue 👍

@noxan noxan merged commit 1efc395 into main Nov 22, 2022
@noxan noxan deleted the feature/gpu_support branch November 22, 2022 06:29
@geneman
Copy link

geneman commented Nov 29, 2022

running with CUDA does not work: RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs update PR has outstanding comment(s) or PR test(s) that need to be resolved
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants