unitaryai / detoxify

Trained models & code to predict toxic comments on all 3 Jigsaw Toxic Comment Challenges. Built using ⚡ Pytorch Lightning and 🤗 Transformers. For access to our API, please email us at contact@unitary.ai.
https://www.unitary.ai/
Apache License 2.0
893 stars 115 forks source link

GPU not used during Training #66

Closed grecosalvatore closed 1 year ago

grecosalvatore commented 1 year ago

Hi there, Thank you for the useful repository.

I am trying to use the script for model training. By leaving the "--device" parameter with the default value (default: all) should use the GPU if available, right?

However, even if available, it seems to do not using it. It prints as output: GPU available: True, used: False, and the training script takes 48 hours.

Could you help me with how to make use of GPU?

Thanks in advance

laurahanu commented 1 year ago

Hi!

The default for --device is actually None as seen here (even though the help text says the default is all - a mistake on our end that we should fix). So it should work if you pass one or multple gpu(s) e.g. --device 1.

Hope this helps!

grecosalvatore commented 1 year ago

Hi!

Thanks for your very helpful answer. If only one GPU is available, the script works with --device 0.