GPUs in one node talk through a fast switch. GPUs in different nodes talk over the network. On AWS's p5 nodes, at the peak numbers AWS publishes, the NVSwitch gives up to 900 GB/s between GPUs. Each node gets up to 3,200 Gbps of network, which is 400 GB/s, or 50 GB/s per GPU if the 8 GPUs share it evenly.
Don't read 900 over 50 as exactly 18 times. NVIDIA quotes its NVLink bandwidth with both directions added together, so roughly an order of magnitude is the safe claim.
Either way, a job split across nodes synchronizes over the slower path. The Philly study found that placing a job's GPUs close together improves training time, because the workers spend less time synchronizing parameters.
So placement prefers the fewest nodes, and then nodes under the same network switch. Topology matters inside the node too. Netflix notes that a GPU talking to a network adapter or a CPU on the wrong PCIe root of the machine pays a bandwidth penalty.
In the editor, write per_gpu_gbs(network_gbps, gpus) and best(options). Each entry in OPTIONS is one way to place a 16-GPU job, listed as the (node, switch) of every GPU.