Closed gsamaras closed 2 years ago
Hi @gsamaras, maybe to clarify: what you pass to pl_trainer_kwargs
is directly used to instantiate a PyTorch Lightning (PL) Trainer. These arguments/parameters are neither changed nor controlled/maintained by Darts.
So you have to find out how what Trainer parameters to use for TPU by looking into PyTorch Lightning.
See the PyTorch Lighnting Trainer parameters here
That being said and from the error: PL's Trainer doesn't have a tpus
kwarg. I saw a tpu_cores
kwarg, maybe it works with that?
Also this might help: https://pytorch-lightning.readthedocs.io/en/stable/advanced/tpu.html#tpu-core-training
We haven't tested if the models run on TPU, so we don't know yet for sure.
Please let us know if/how you get it running :)
Hi @dennisbader, thanks!
So I was able to get it working after reading the PL docs, but I eventually got this:
MisconfigurationException: `Trainer(accelerator='tpu', precision=64)` is not implemented. Please, open an issue in `https://github.com/PyTorchLightning/pytorch-lightning/issues` requesting this feature.
As a result I used float-32 precision to actually make it run, that was fun!
If you think it makes sense, then I could probably write a laconic and compact tutorial about this (+the GPU usage), or maybe extend https://unit8co.github.io/darts/examples/07-NBEATS-examples.html? That way I can contribute in the project and give-back!
Hey @gsamaras, glad to hear that it worked out! Yes, sure, thanks! We are always happy about contribution.
I think this would be a great new user guide (a new .md file for /docs/userguide/). We could also add how to run models on GPU and that by default models run on CPU :)
You can take the following user guide as reference: https://unit8co.github.io/darts/userguide/torch_forecasting_models.html).
Let us know if you need help
Describe the bug Cannot fit N-Beats model to my data with a TPU in Google Colab.
To Reproduce
and then after restarting the runtime:
I get the following error:
Expected behavior I thought I could use TPU based on this comment.
System:
Additional context