Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix optimizer reset for relora sft #1414

Merged
merged 5 commits into from
Dec 3, 2024
Merged

Conversation

winglian
Copy link
Collaborator

@winglian winglian commented Mar 16, 2024

the relora optimizer reset wasn't pruning anything, this fixes that.

what seemed to be wrong with the original implementation is that iterating over the optimizer states isn't sufficient to determine the optimizer keys.

@winglian winglian force-pushed the relora-fix-optimizer-reset branch from 571cdd4 to c318c76 Compare April 3, 2024 04:39
@winglian winglian force-pushed the relora-fix-optimizer-reset branch from c318c76 to 490ecba Compare November 19, 2024 13:20
@winglian
Copy link
Collaborator Author

hmm, still doesn't seem to be correct,

[2024-11-21 21:17:08,843] [INFO] [axolotl.relora.reset_optimizer:72] [PID:2840] [RANK:0] Percent of optimizer states zeroed: 0.00                                                                                                                         
[2024-11-21 21:17:08,843] [INFO] [axolotl.relora.reset_optimizer:73] [PID:2840] [RANK:0] absolute n of optimizer states zeroed: 0                                                                                                                         
[2024-11-21 21:17:09,011] [INFO] [axolotl.relora.reset_optimizer:72] [PID:2841] [RANK:1] Percent of optimizer states zeroed: 0.00                                                                                                                         
[2024-11-21 21:17:09,011] [INFO] [axolotl.relora.reset_optimizer:73] [PID:2841] [RANK:1] absolute n of optimizer states zeroed: 0   

also, ooms after the first relora restart

@winglian winglian added the help wanted Extra attention is needed label Nov 21, 2024
@winglian
Copy link
Collaborator Author

winglian commented Dec 3, 2024

@winglian winglian force-pushed the relora-fix-optimizer-reset branch from 490ecba to e0b26f0 Compare December 3, 2024 02:15
@winglian winglian changed the title fix optimizer reset fix optimizer reset for relora sft Dec 3, 2024
@winglian winglian removed the help wanted Extra attention is needed label Dec 3, 2024
@winglian winglian requested a review from NanoCode012 December 3, 2024 03:39
@winglian winglian force-pushed the relora-fix-optimizer-reset branch from 04121f5 to cc438c4 Compare December 3, 2024 05:04
@winglian winglian force-pushed the relora-fix-optimizer-reset branch from cc438c4 to 13b5865 Compare December 3, 2024 12:48
@winglian winglian merged commit 1ef7031 into main Dec 3, 2024
12 of 13 checks passed
@winglian winglian deleted the relora-fix-optimizer-reset branch December 3, 2024 13:58
bursteratom pushed a commit that referenced this pull request Dec 4, 2024
* fix optimizer reset

* set states to reset for 8bit optimizers and handle quantile runtime error for embeddings

* fix relora test to check grad_norm

* use flash attn for relora and tweak hyperparams for test

* fix messages field for test dataset
bursteratom pushed a commit that referenced this pull request Dec 4, 2024
* fix optimizer reset

* set states to reset for 8bit optimizers and handle quantile runtime error for embeddings

* fix relora test to check grad_norm

* use flash attn for relora and tweak hyperparams for test

* fix messages field for test dataset
djsaunde pushed a commit that referenced this pull request Dec 16, 2024
* fix optimizer reset

* set states to reset for 8bit optimizers and handle quantile runtime error for embeddings

* fix relora test to check grad_norm

* use flash attn for relora and tweak hyperparams for test

* fix messages field for test dataset
djsaunde pushed a commit that referenced this pull request Dec 17, 2024
* fix optimizer reset

* set states to reset for 8bit optimizers and handle quantile runtime error for embeddings

* fix relora test to check grad_norm

* use flash attn for relora and tweak hyperparams for test

* fix messages field for test dataset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant