ray-project / ray_lightning

Pytorch Lightning Distributed Accelerators using Ray
Apache License 2.0
211 stars 34 forks source link

Support string based GPU ids #239

Closed amogkam closed 1 year ago

amogkam commented 1 year ago

GPU device ids can be specified with an integer index, but may also be specified as strings.

This PR ensures that both cases are supported by root_device. The code is taken from what is being done in Ray Train: https://sourcegraph.com/github.com/ray-project/ray/-/blob/python/ray/train/torch/train_loop_utils.py?L470-498

Closes https://github.com/ray-project/ray_lightning/issues/236