You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow DPO reference model to be loaded from LoadCheckpoint callback (#80)
This is not the cleanest solution of all time, but does unblock this
niche use case without significant rearchitecting of the code. The issue
is that we sometimes use a callback to load the checkpoint in Composer
(https://github.com/mosaicml/composer/blob/main/composer/callbacks/load_checkpoint.py).
This is useful when the base model is saved in a composer checkpoint,
and you want to only save lora checkpoints during training for
autoresume. The callback will load a checkpoint on `BEFORE_LOAD` event,
so that any autoresume checkpoint would overwrite it. None of that
really applies to the reference model loading here, and we just want to
grab the base checkpoint from the callback and load it as an additional
step.
Testing:
Before (fails with nan loss because weights are not properly loaded):
`daniel-matt-failure-1-tRAWIE`
After with load checkpoint callback (init device meta, pretrained
false): `daniel-matt-callback-1-VevoUT`
After without load checkpoint callback (init device mixed, pretrained
true): `daniel-matt-no-callback-1-G6P1po`
<img width="1648" alt="Screenshot 2025-06-02 at 3 59 28 PM"
src="https://github.com/user-attachments/assets/898089ed-71cd-4874-8ae4-7d36c19addc2"
/>
0 commit comments