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

[Enhancement] Handle the case for Multi-Instance GPUs when using cuda_visible_devices #1164

Merged
merged 8 commits into from
May 28, 2023
5 changes: 4 additions & 1 deletion mmengine/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,10 @@ def _get_device_id():
cuda_visible_devices = list(range(num_device))
else:
cuda_visible_devices = cuda_visible_devices.split(',')
return int(cuda_visible_devices[local_rank])
try:
return int(cuda_visible_devices[local_rank])
except ValueError:
return cuda_visible_devices[local_rank]
zhouzaida marked this conversation as resolved.
Show resolved Hide resolved


def _get_host_info() -> str:
Expand Down