[dist_optim] add distributed functional sgd optimizer (#50618)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/50618
Test Plan: Imported from OSS
Reviewed By: rohan-varma
Differential Revision: D25932778
Pulled By: wanchaol
fbshipit-source-id: 8df3567b477bc5ba3556b8c5294cd3da5db963ad