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

[BUG] Not using GPU by default in RNNModel #801

Closed
rocket-yg opened this issue Feb 16, 2022 · 1 comment
Closed

[BUG] Not using GPU by default in RNNModel #801

rocket-yg opened this issue Feb 16, 2022 · 1 comment
Labels
bug Something isn't working triage Issue waiting for triaging

Comments

@rocket-yg
Copy link

Describe the bug
I am trying to train a RNN model for a time series problem statement. Using Google Colab GPU backed instance, when I train, it doesn't use the GPU by itself as shown in training logs:

WARNING:darts.models.forecasting.torch_forecasting_model:DeprecationWarning: kwarg `verbose` is deprecated and will be removed in a future Darts version. Instead, control verbosity with PyTorch Lightning Trainer parameters `enable_progress_bar`, `progress_bar_refresh_rate` and `enable_model_summary` in the `pl_trainer_kwargs` dict at model creation.
GPU available: True, used: False
TPU available: False, using: 0 TPU cores

When i explicitly pass the 'cuda:0' string to the torch_device_str argument, I get a value error message:

ValueError: 'cuda' is not a valid DistributedType

Expected behavior
It should be able to train on the gpu instance.

@rocket-yg rocket-yg added bug Something isn't working triage Issue waiting for triaging labels Feb 16, 2022
@gsamaras
Copy link
Contributor

gsamaras commented Feb 16, 2022

darts version 0.17.0 was released yesterday.
The TorchForecastingModel are now built on top of PyTorch Lightning.

So try changing:

torch_device_str="cuda:0"

to:

pl_trainer_kwargs={
        "accelerator": "gpu",
        "gpus": [0]
}

Read more in https://pytorch-lightning.readthedocs.io/en/stable/common/trainer.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue waiting for triaging
Projects
None yet
Development

No branches or pull requests

3 participants