YOLOX
YOLOX copied to clipboard
Fix issue 1721 by always initializing process group.
This pull request fixes issue #1721, where single GPU training/inference may error if the worker uses torch.dist
. In summary, it makes sure the default process group is always initialized as long as world_size > 0
, otherwise it raises a ValueError
to indicate illegal argument(s). The existing code should not be affected, as stated in issue #1721.
Rationale: Always initializing the process group is preferred, because when launch
is called, the user most likely requests distributed semantics. This fix makes the user code consistent by allowing the users to make torch.dist
calls even if there is only one GPU.