Hi,
I like to develop and contribute a checkpoint-alike functionality, and just want to be sure it will match fastai v2’s philosophy. My apologies if this post belongs to another chat/topic/wiki like dev projects index, developer chat, or fastai-v2-callbacks-learner-optimizer.
In particular, I wonder what combinations of decorator, Pipeline, callback, monad, coroutine, etc., will fit fastai v2’s design most.
It is something I need for efficiency (esp. with volatile Google Colaboratory session). For example, when experimenting on NLP augmentation with batch-size scaling, I want intermediate models reusable:
Control Group
ctrl_period_1 ← freeze(); fit_one_cycle(2)
ctrl_period_2 ← freeze_to(-2); fit_one_cycle(3)
Experiment Group
ctrl_period_1 ← resume(prng_states, mdl_states, opt_states, fp16_states)
exp_period_2 ← augment(); increase_bs(); freeze_to(-2); fit_one_cycle(3)
So far what I had to do manually (in a stupid and verbose way) are:
- Resume every PRNG states;
- Resume
MixedPrecision
's dynamic loss_scale
.
AFAIK, MixedPrecision
of v1 uses _order
to ensure when it should be invoked, and v2 uses _after_something
explicitly. Also I’m aware that there are some more discussions about it on the forum.
I’m curious about how can I help contributing a somewhat general API. Because PRNG states are not only updated during fit_one_cycle
but also touched along with data transformation Pipeline, yet loss_scale
is only used as almost the last callback. Not to mention that the possibility to have new callbacks is supposed to be infinite.
I imagine that an extensible decorator may work like @Transform
(and @differentiable
?) such that it will pickle a state dict and pass it along like a coroutine monadic computation, ideally.
Thank you.