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

Speedup main CI #419

Merged
merged 4 commits into from
Jun 1, 2022
Merged

Speedup main CI #419

merged 4 commits into from
Jun 1, 2022

Conversation

muellerzr
Copy link
Collaborator

@muellerzr muellerzr commented Jun 1, 2022

Speed up main GitHub CI

What does this add?

This PR speeds up the time for the github CI tests to pass by ~2.5x through a few basic optimizations:

Adjustments to the Makefile

Four new test conditionals were added to the Makefile based on groupings of how each example test needs to be ran, and how their topics relate to each other:

  • test_example_differences: The quick method that checks if the .py files are missing any parts in the examples/ dir
  • test_checkpoint_step: tests relating to checkpoint by step and load checkpoint by step
  • test_checkpoint_epoch: tests relating to checkpoint by epoch and loading checkpoint by epoch
  • test_rest: Everything that did not fall under the previous three

Use setup-python@v3 and cache@v3

By using these two specific actions, we can speed up the time it takes to setup the python environment, cache the pip installation, and also cache the model downloads.

Total Speedup

  • Main tests: 2m42s -> 1m16s (~2x speedup)
  • Example tests: 9m5s -> ~(3m47s, 4m20s) (~2.1-2.4x speedup)
    (This also counts as the overall time taken)

Without the cache, it's ~8.5 minutes on that first commit/run.

@muellerzr muellerzr added the enhancement New feature or request label Jun 1, 2022
@muellerzr muellerzr requested a review from sgugger June 1, 2022 14:27
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 1, 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.

Very nice speed-up, thanks a lot!

@muellerzr muellerzr merged commit 938b8f3 into main Jun 1, 2022
@muellerzr muellerzr deleted the speedup-ci branch June 1, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants