"...pipelines/test_pipelines_automatic_speech_recognition.py" did not exist on "7fb2a8b3d93104fbe45667fffc6716cb26b9515e"
Unverified Commit bb6a664e authored by Yoshinari Fujinuma's avatar Yoshinari Fujinuma Committed by GitHub
Browse files

Fix multi-gpu training error for LayoutLMv2 (#21675)


Co-authored-by: default avatarYoshinari Fujinuma <fujinuy@amazon.com>
parent a8eb4f79
......@@ -604,7 +604,7 @@ class LayoutLMv2VisualBackbone(nn.Module):
self_rank = torch.distributed.get_rank()
node_size = torch.cuda.device_count()
world_size = torch.distributed.get_world_size()
if not (world_size & node_size == 0):
if not (world_size % node_size == 0):
raise RuntimeError("Make sure the number of processes can be divided by the number of nodes")
node_global_ranks = [list(range(i * node_size, (i + 1) * node_size)) for i in range(world_size // node_size)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment