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

Update no_trainer scripts with new Accelerate functionalities #16617

Merged
merged 8 commits into from
Apr 6, 2022

Conversation

muellerzr
Copy link
Contributor

@muellerzr muellerzr commented Apr 5, 2022

Update the no_trainer scripts to keep aligned with Accelerate capabilities

What does this add?

Updates all no_trainer scripts to use the latest capabilities.

Why is it needed?

Accelerate had a number of new capabilities added, including better saving/loading, experiment tracking, and support for LR Schedulers. As a result, much of the current scripts can either be simplified from their hard-coded behaviors, or have these features added

Modified scripts with potential major changes:

  • language-modeling
  • multiple-choice
  • question-answering
  • summarization
  • text-classification
  • token-classification
  • translation

The speech fine-tuning will be updated in a later PR

Basic usage examples:

  • Saving checkpoints each epoch or number of steps:
accelerate launch language-modeling/run_clm_no_trainer --checkpointing_steps "epoch"
accelerate launch language-modeling/run_clm_no_trainer --checkpointing_steps 100
  • Resuming training from a saved checkpoint:
accelerate launch language-modeling/run_clm_no_trainer --resume_from_checkpoint "epoch_1"
  • Use any available trackers that Accelerate can automatically pick up including Weights and Biases, TensorBoard, and CometML
accelerate launch language_modeling/run_clm_no_trainer --with_tracking

Anticipated maintence burden? (What will happen in say, 3 months if something changes)

As it gets more widly used, these scripts might need small updates if we find the end-users prefer a different experience when it comes to logging, or other small bugfixes we find as time goes on.

@muellerzr muellerzr requested a review from sgugger April 5, 2022 20:59
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 5, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on those examples! Left a couple of comments, but looks pretty good already!

examples/pytorch/language-modeling/run_clm_no_trainer.py Outdated Show resolved Hide resolved
examples/pytorch/language-modeling/run_clm_no_trainer.py Outdated Show resolved Hide resolved
examples/pytorch/language-modeling/run_clm_no_trainer.py Outdated Show resolved Hide resolved
@muellerzr muellerzr added Examples Which is related to examples in general External Using the library with external tools (onnx, tflite, ...) labels Apr 6, 2022
@muellerzr muellerzr changed the title Update no_trainer scripts with new Accelerate functionalities [DRAFT] Update no_trainer scripts with new Accelerate functionalities Apr 6, 2022
@muellerzr muellerzr added the PyTorch Anything PyTorch label Apr 6, 2022
@muellerzr muellerzr marked this pull request as ready for review April 6, 2022 16:04
@muellerzr muellerzr requested a review from sgugger April 6, 2022 16:05
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for duplicating the effort across all the examples!

@muellerzr muellerzr merged commit febe42b into main Apr 6, 2022
@muellerzr muellerzr deleted the muellerzr-update-no-trainer branch April 6, 2022 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Examples Which is related to examples in general External Using the library with external tools (onnx, tflite, ...) PyTorch Anything PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants