Skip to content

Fix resuming training from checkpoint#70

Open
marcandrelarochelle wants to merge 1 commit into
jiaweizzhao:masterfrom
marcandrelarochelle:fix/resume-training
Open

Fix resuming training from checkpoint#70
marcandrelarochelle wants to merge 1 commit into
jiaweizzhao:masterfrom
marcandrelarochelle:fix/resume-training

Conversation

@marcandrelarochelle

Copy link
Copy Markdown

Description

When saving checkpoints using Hugging-Face trl / Unsloth, the optimizer is saved, upon being loaded back, the self.ortho_matrix isn't necessarily loaded on the right device (if you train on GPU, it will be loaded on CPU when unpickled).

Bug

self.ortho_matrix is unpickled on the 'CPU' device, but there is no check to verify on the first pass if it should be on the 'CPU' after being unpickled

Solution

Introduce a variable self.resume set to True when unpickling the class and check if the self.ortho_matrix when resuming training, if not send it to the same device as the weights (similar to the function get_orthogonal_matrix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant