I don’t think the difference is created by the world_size, but in the batchnorm layer, which doesn’t track any stats in your example and would make SyncBatchNorm useless. If you enable it, your code snippet works on my machine.
However, thanks for the code snippet, as the error message should be improved at least.