-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Reuse the cache created for latest main
on PRs/branches if setup.py
is not modified
#25445
Conversation
The documentation is not available anymore as the PR was closed or merged. |
631f5b2
to
98772c4
Compare
@@ -884,6 +884,8 @@ class BertModel(BertPreTrainedModel): | |||
`add_cross_attention` set to `True`; an `encoder_hidden_states` is then expected as an input to the forward pass. | |||
""" | |||
|
|||
a = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove this before merge
main
on PRs/branches if setup.py
not modified
main
on PRs/branches if setup.py
not modifiedmain
on PRs/branches if setup.py
not modified
main
on PRs/branches if setup.py
not modifiedmain
on PRs/branches if setup.py
is not modified
There was a problem hiding this 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 this! Let's try it for a bit and see if it impacts any workflow negatively.
47334f8
to
c56762e
Compare
- store_artifacts: | ||
path: ~/transformers/tests_fetched_summary.txt | ||
path: test_preparation/tests_fetched_summary.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need this in create_circleci_config.py
to check if tests
is in the list
summary_file = os.path.join(folder, "tests_fetched_summary.txt") | ||
if os.path.exists(summary_file): | ||
with open(summary_file) as f: | ||
tests_fetched_summary = f.read() | ||
setup_file_modifiled = "### TEST TO RUN ###\n- tests\n" in tests_fetched_summary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to check the summary file instead of filtered_test_list
as it is already changed to a list in filter_tests
method
if test_files == ["tests"]:
test_files = [os.path.join("tests", f) for f in os.listdir("tests") if f not in ["__init__.py"] + filters]
@sgugger FYI: I need to change 2 more places to make it work correctly for all cases. See my last 2 review comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me!
Hi @sgugger I am afraid I have to revert this PR until we do something to enabling sharing cache (see below at the end). From this section
The cache is never shared between PRs/branches from different forks. This might explains the question I posted about why the same cache key could be found sometimes but not other times. The PR description of #24886 is partially valid as lhoestq created a branch in The way to share cache is
But we need to be careful if we have sensitive env. variables or not. |
What does this PR do?
For a PR or a branch, if
setup.py
is not modified (compare to the common ancestor with themain
), let's use cache that is created for thesetup.py
from thelatest
commit on themain
branch.latest means the latest one on
main
at the moment where a run is triggered.Motivation:
main
andpull
(for most cases), which is introduced in Separate CircleCI cache betweenmain
andpull
or other branches #24886 to avoid unexpected/undesired edge cases.setup.py
as they don't rebase on more recentmain
With this PR, we expect the storage usage for
cache
could be reduced dramatically 🤞 .The artifact in this job run shows
generated_config.txt
has explicit checksum usedv0.7-pipelines_torch-main-pip-9RXs1YQ8L2beP4cdAfRDkWX0VRTtWaQodDVKzvyJwPI=
rather than{{ checksum "setup.py" }}