Revision 0ee1127c81bf245225cd7db50d631e8677abaefc authored by Sasha Sheng on 08 February 2021, 10:50:33 UTC, committed by Facebook GitHub Bot on 08 February 2021, 10:52:20 UTC
Summary: * pytorch lighting stub mostly involving training * Tests for lightning trainer included * built on top of the mmf grad accumulation fix: https://github.com/facebookresearch/mmf/pull/747 - [X] MVP 0. Training: Goal - Train a model from scratch and reach similar accuracy as using mmf_trainer - [X] Setup the training pipeline: done - [X] Training on the right device: done - [X] Clip gradients: done - [X] Optimizer: done - [X] FP16 Support: done - [X] LR scheduler (incl. warmup etc): done - [X] testcase: train visual_bert on vqa from scratch fo 10 iterations, compare the value: done - [x] tests included in this PR (tests are only done for pytorch lightning integration): - [X] Vanilla Training w/o grad accumulate, make sure loss for 5 iters are the same between mmf and pl - [X] Optimizer working as intended as a part of this PR. - [X] `max_updates` and `max_epochs` calculation - [x] Training with grad accumulate - [x] Training with LR schedule achieves a different value compared to without LR schedule - [x] Training with LR schedule for PL is the same as training with LR schedule for `mmf_tranier` - [x] Training with gradient clipping make sure all grads are within the `grad_clipping` threshold - [x] Training with gradient clipping is the same as training with gradient clipping for `mmf_trainer` Pull Request resolved: https://github.com/facebookresearch/mmf/pull/748 Reviewed By: apsdehal, simran2905 Differential Revision: D26192869 Pulled By: ytsheng fbshipit-source-id: 203a91e893d6b878bbed80ed84960dd059cfc90c
1 parent fc72ef0
File | Mode | Size |
---|---|---|
interfaces | ||
transformers | ||
__init__.py | -rw-r--r-- | 985 bytes |
ban.py | -rw-r--r-- | 3.2 KB |
base_model.py | -rw-r--r-- | 11.7 KB |
butd.py | -rw-r--r-- | 7.1 KB |
cnn_lstm.py | -rw-r--r-- | 3.5 KB |
fusions.py | -rw-r--r-- | 7.2 KB |
lorra.py | -rw-r--r-- | 2.2 KB |
lxmert.py | -rw-r--r-- | 27.7 KB |
m4c.py | -rw-r--r-- | 21.9 KB |
m4c_captioner.py | -rw-r--r-- | 748 bytes |
mmbt.py | -rw-r--r-- | 25.0 KB |
mmf_bert.py | -rw-r--r-- | 16.0 KB |
mmf_transformer.py | -rw-r--r-- | 11.6 KB |
movie_mcan.py | -rw-r--r-- | 9.8 KB |
pythia.py | -rw-r--r-- | 18.6 KB |
top_down_bottom_up.py | -rw-r--r-- | 2.5 KB |
unimodal.py | -rw-r--r-- | 3.3 KB |
vilbert.py | -rw-r--r-- | 57.1 KB |
visdial_multi_modal.py | -rw-r--r-- | 3.3 KB |
visual_bert.py | -rw-r--r-- | 23.5 KB |
Computing file changes ...