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

Move tensors to correct device #1010

Merged
merged 4 commits into from
Dec 1, 2022
Merged

Move tensors to correct device #1010

merged 4 commits into from
Dec 1, 2022

Conversation

karl-richter
Copy link
Collaborator

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

Resolves #1002

Initially we assumed that with Lightning we do not have to worry about moving tensors to devices at all, but it turns out that this assumption only holds for tensor created via the data loaders. All manually created tensors need to be moved to the correct device (which is very straight forward in Lightning due to the self.device arg, Reference).

Adds a pytest that uses an accelerator if available. On github action workers, accelerators are most likely not available, but on local machines this could help detect issues early.

@karl-richter karl-richter added the type:bug Something isn't working label Nov 30, 2022
@karl-richter karl-richter self-assigned this Nov 30, 2022
@github-actions
Copy link

github-actions bot commented Nov 30, 2022

98c867c

Model Benchmark

Benchmark Metric main current diff
YosemiteTemps MAE_val 1.72948 1.72949 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%
YosemiteTemps time 153.57 108.37 -29.43%
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%
PeytonManning time 18.97 12.85 -32.26%
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%
AirPassengers time 7.18 5.45 -24.09%
Model training plots

Model Training

PeytonManning

YosemiteTemps

AirPassengers

@codecov-commenter
Copy link

codecov-commenter commented Nov 30, 2022

Codecov Report

Merging #1010 (d0fe10d) into main (499ae1a) will increase coverage by 0.10%.
The diff coverage is 84.61%.

@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
+ Coverage   89.89%   89.99%   +0.10%     
==========================================
  Files          19       19              
  Lines        4659     4659              
==========================================
+ Hits         4188     4193       +5     
+ Misses        471      466       -5     
Impacted Files Coverage Δ
neuralprophet/time_net.py 89.85% <77.77%> (ø)
neuralprophet/custom_loss_metrics.py 100.00% <100.00%> (ø)
neuralprophet/utils.py 82.58% <100.00%> (+1.50%) ⬆️

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

@karl-richter karl-richter added the status: needs review PR needs to be reviewed by Reviewer(s) label Nov 30, 2022
@karl-richter karl-richter added this to the Release 0.5.0 milestone Nov 30, 2022
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.

LGTM - not sure if there are any other tensors for which we need to specify the device, yet anyhow better to have more of them on the right device 👍

@noxan noxan merged commit 98c867c into main Dec 1, 2022
@noxan noxan deleted the fix/tensor_to_device branch December 1, 2022 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs review PR needs to be reviewed by Reviewer(s) type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPU support tensors
3 participants