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

Follow-up tensors on wrong device #1023

Merged
merged 3 commits into from
Dec 2, 2022
Merged

Follow-up tensors on wrong device #1023

merged 3 commits into from
Dec 2, 2022

Conversation

karl-richter
Copy link
Collaborator

🔬 Background

As pointed out in #1002, some tensors have remained on the CPU when training with a GPU. This has previously been adressed #1010, it seems like some tensors remained on the wrong device.

🔮 Key changes

  • Moved all tensors to the correct device (checked all usages of torch.zeros, torch.ones, torch.tensor via strg+F)
  • Added the usage of self. meta_used_in_model in the forward function

📋 Review Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, added docstrings and data types to function definitions.
  • I have added pytests to check whether my feature / fix works.

Please make sure to follow our best practices in the Contributing guidelines.

@karl-richter karl-richter self-assigned this Dec 2, 2022
@karl-richter karl-richter added the bug Something isn't working label Dec 2, 2022
@karl-richter karl-richter linked an issue Dec 2, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2022

Codecov Report

Merging #1023 (676eaa0) into main (e06945e) will increase coverage by 0.06%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main    #1023      +/-   ##
==========================================
+ Coverage   90.20%   90.26%   +0.06%     
==========================================
  Files          21       21              
  Lines        4748     4737      -11     
==========================================
- Hits         4283     4276       -7     
+ Misses        465      461       -4     
Impacted Files Coverage Δ
neuralprophet/time_net.py 90.57% <87.50%> (+0.55%) ⬆️

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

@github-actions
Copy link

github-actions bot commented Dec 2, 2022

676eaa0

Model Benchmark

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%
AirPassengers time 4.84 4.87 0.62%
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 12.49 12.84 2.8%
YosemiteTemps MAE_val 1.72949 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 101.13 103.76 2.6%
Model training plots

Model Training

PeytonManning

YosemiteTemps

AirPassengers

@alfonsogarciadecorral
Copy link
Collaborator

accelerator="cuda" working nicely on my GPU!

Copy link
Collaborator

@alfonsogarciadecorral alfonsogarciadecorral left a comment

Choose a reason for hiding this comment

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

  • I made a commit to add the meta is None condition at the beginning of the forward.

  • np working on my gpu now

@noxan noxan merged commit 0732b47 into main Dec 2, 2022
@noxan noxan deleted the fix/tensor_device branch December 2, 2022 21:46
@noxan noxan added this to the Release 0.5.0 milestone Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPU support tensors
4 participants