4 -H node1:2,node2:2 \ python train.py horovodrun -np 4 -H node1:2,node2:2 \ python train.py import torch import horovod.torch as hvd … hvd.init() def train(epochs=5 … sampler = torch.utils.data.distributed.DistributedSampler(dataset, num_replicas=hvd.size(), rank=hvd.rank()) hvd.broadcast_parameters(model.state_dict(), root_rank=0 optimizer = optim.SGD(model.parameters(), lr=0.01 * hvd.size()) optimizer = hvd.DistributedOptimizer(optimizer, named_parameters=model.named_parameters()) … for epoch in range(epochs): …