[Model Averaging] Revert #63895 (#64903)
authorYi Wang <wayi@fb.com>
Tue, 14 Sep 2021 16:41:13 +0000 (09:41 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 14 Sep 2021 16:45:42 +0000 (09:45 -0700)
commit00e6e0c59395ba2cb6f90fae077108e69e6a7ea9
tree3da1ced332f264d26799fb8ca17d0ce120f3c445
parent882b67dff4f8dcf5c7886fc6a5d9f8ac2ae6cd0b
[Model Averaging] Revert #63895 (#64903)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64903

Fix the accuracy regression caused by https://github.com/pytorch/pytorch/pull/63895.

Test Plan:
buck test mode/dev-nosan //caffe2/test/distributed:distributed_nccl_spawn -- test_periodic_model_averager
buck test mode/dev-nosan //caffe2/test/distributed:distributed_nccl_spawn -- test_post_localSGD_optimizer_parity

Reviewed By: rohan-varma

Differential Revision: D30894688

fbshipit-source-id: fe00b8b23b860d9f806f87c1b6caba1d0b807485
torch/distributed/algorithms/model_averaging/utils.py