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

[Modular] skip modular checks based on diff #36130

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

gante
Copy link
Member

@gante gante commented Feb 11, 2025

What does this PR do?

✨ Faster modular checks on most PRs ✨

It takes advantage of having the modular checks being done in topological order. The loop over files in topological order was modified to:

  1. if a given model and its dependencies are not present in the diff, it's guaranteed to not have any issues -> skips checks. This check is conservative: any diff in any file related to the model disables the skip.
  2. otherwise, run the modular checks.
  3. if the model was overwritten, update the list of models in the diff to handle dependency chains
  4. (next iteration: check the next model in the topological order)

In branches with zero model changes, it shaves off ~1min [on my machine]. With one modular leaf model change, it shaves off ~55 secs. 🤗

@@ -1024,40 +1024,6 @@ def _rep(match):
return readmes_match, "\n".join((x[1] for x in sorted_index)) + "\n"


def _find_text_in_file(filename: str, start_prompt: str, end_prompt: str) -> Tuple[str, int, int, List[str]]:
Copy link
Member Author

Choose a reason for hiding this comment

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

(was checking code on this file, noticed this fn was unused)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

🐐 perfect

@gante gante merged commit d114a6f into huggingface:main Feb 13, 2025
10 checks passed
@gante gante deleted the faster_make_fixup branch February 13, 2025 12:53
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.

3 participants