Support LARC for SGD optimizer only in classy vision by prigoyal · Pull Request #408 · facebookresearch/ClassyVision

@prigoyal @facebook-github-bot

…h#408)

Summary:
Pull Request resolved: facebookresearch#408

Pull Request resolved: fairinternal/ClassyVision#64

In an attempt to implement SimpleCLR for contrastive losses, I needed LARC to enable large batch training. mannatsingh had already done work on this during classy vision open source release. https://our.intern.facebook.com/intern/diff/D18542126/

I initially tried using that diff to have a separate standalone LARC to work for any optimizer but it turned out to be tricky to setup correctly as we need to wrap a given optimizer in LARC (the `getattr` and `setattr` functions were not working). I talked to vreis about it and we decided that for now, we can support it for SGD only, file a task to support other optimizers too later after discussions with mannatsingh once he's back.

Differential Revision: D20139718

fbshipit-source-id: c8cf4d545e6ce94cca8e646f68d519197856f675