ParlAI
ParlAI copied to clipboard
Early stopping and finetuned optimizer state
Patch description Adds some additional flags that allow some more flexible uses of ParlAI for running experiments when finetuning models and starting/stopping runs to change between similar datasets or different training parameters with the same model.
--preserve-optimizer-for-finetuning
- during a finetuning run, preserve the optimizer state from the prior run. This can be important for ADAM to not take erroneous steps when starting training again from the model from a prior run.
--early-stop-at-n-steps
- Stop training early at n steps. This can be convenient for launching a run in several parts, swapping out the dataset or parameters in the middle of a run after n steps, etc, while still obeying the learning rate schedule and/or any other settings that would be used in a longer run.
Testing steps
Added a short integration test for --early-stop-at-n-steps to test_lr_schedulers.py.
For --preserve-optimizer-for-finetuning
I'm a little bit at a loss as to how to test it in a more automated way. I used essentially this change for my own project, but someone has any suggestions how one would more standardly test within the test framework for this library, or even what dataset/model/command would be a good baseline, please feel free to comment.
@c-flaherty
@lightvector Note for later: Turning these flags on may break requeue-ability (because lr scheduler state is destroyed on job initialization). We need to look into that before merging this
This PR has not had activity in 30 days. Closing due to staleness.
@c-flaherty @lightvector is there any update on this?
This PR has not had activity in 30 days. Closing due to staleness.