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

Spectrum training support #2504

Open
ggbetz opened this issue Dec 19, 2024 · 2 comments
Open

Spectrum training support #2504

ggbetz opened this issue Dec 19, 2024 · 2 comments
Labels
✨ enhancement New feature or request 🏋 SFT Related to SFT

Comments

@ggbetz
Copy link

ggbetz commented Dec 19, 2024

Feature request

Support spectrum training in sft script / cli, e.g. by passing unfrozen_parameters via yaml obtained with spectrum snr analysis:

trl sft \
--model_name_or_path meta-llama/Llama-3.1-8B-Instruct \
--unfrozen_parameters snr_results_Llama-3.1-8B_50percent.yaml \
...

Motivation

I'd love to use the huggingface-pytorch-training docker container out of the box with spectrum for

  • training speedup
  • memory reduction

Axolotl does seem to natively support spectrum.

Your contribution

TBD

@qgallouedec qgallouedec added ✨ enhancement New feature or request 🏋 SFT Related to SFT labels Dec 20, 2024
@ggbetz
Copy link
Author

ggbetz commented Dec 20, 2024

It seems @philschmid has in implementation here: https://github.com/philschmid/deep-learning-pytorch-huggingface/blob/391f19ba06c128a2a290b3bdcb717ad6ff794fd7/training/scripts/run_sft.py#L54-L77 and the question is maybe just what's the best cleanest way to integrate this natively in trl?

@anakin87
Copy link
Contributor

anakin87 commented Dec 21, 2024

This would be great and would prevent users from making mistakes in the manual implementation of this method: for example, the code for integration with other libraries reported in the official repo has some problems. In contrast, the simple implementation in my tutorial and Philipp's code should be correct.

BTW, Spectrum is quite agnostic with respect to training method (SFT, DPO...): the models by VAGO solutions show that it works well for DPO too.

LMK what's the better way to proceed and help with this integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 🏋 SFT Related to SFT
Projects
None yet
Development

No branches or pull requests

3 participants