-
Notifications
You must be signed in to change notification settings - Fork 25.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
General PR slow CI #30540
Merged
Merged
General PR slow CI #30540
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,11 @@ on: | |
pull_request: | ||
paths: | ||
- "src/transformers/models/*/modeling_*.py" | ||
- "tests/models/*/test_*.py" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To cancel the CI runs trigger by previous commits of the same PR |
||
|
||
env: | ||
HF_HOME: /mnt/cache | ||
|
@@ -20,31 +25,46 @@ env: | |
CUDA_VISIBLE_DEVICES: 0,1 | ||
|
||
jobs: | ||
check_for_new_model: | ||
find_models_to_run: | ||
runs-on: ubuntu-22.04 | ||
name: Check if a PR is a new model PR | ||
name: Find models to run slow tests | ||
# Triggered only if the required label `run-slow` is added | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'run-slow') }} | ||
outputs: | ||
new_model: ${{ steps.check_new_model.outputs.new_model }} | ||
models: ${{ steps.models_to_run.outputs.models }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: "0" | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Get commit message | ||
run: | | ||
echo "commit_message=$(git show -s --format=%s)" >> $GITHUB_ENV | ||
|
||
- name: Check if there is a new model | ||
id: check_new_model | ||
- name: Get models to run slow tests | ||
run: | | ||
echo "${{ env.commit_message }}" | ||
python -m pip install GitPython | ||
echo "new_model=$(python utils/check_if_new_model_added.py | tail -n 1)" >> $GITHUB_OUTPUT | ||
python utils/pr_slow_ci_models.py --commit_message "${{ env.commit_message }}" | tee output.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now that (renamed) script will give the models to run (either new model or from the commit message) |
||
echo "models=$(tail -n 1 output.txt)" >> $GITHUB_ENV | ||
|
||
- name: Models to run slow tests | ||
id: models_to_run | ||
run: | | ||
echo "${{ env.models }}" | ||
echo "models=${{ env.models }}" >> $GITHUB_OUTPUT | ||
|
||
run_models_gpu: | ||
name: Run all tests for the new model | ||
# Triggered if it is a new model PR and the required label is added | ||
if: ${{ needs.check_for_new_model.outputs.new_model != '' && contains(github.event.pull_request.labels.*.name, 'single-model-run-slow') }} | ||
needs: check_for_new_model | ||
name: Run all tests for the model | ||
# Triggered only `find_models_to_run` is triggered (label `run-slow` is added) which gives the models to run | ||
# (either a new model PR or via a commit message) | ||
if: ${{ needs.find_models_to_run.outputs.models != '[]' }} | ||
needs: find_models_to_run | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
folders: ["${{ needs.check_for_new_model.outputs.new_model }}"] | ||
folders: ${{ fromJson(needs.find_models_to_run.outputs.models) }} | ||
machine_type: [single-gpu, multi-gpu] | ||
runs-on: ['${{ matrix.machine_type }}', nvidia-gpu, t4, ci] | ||
container: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If nothing changed in those paths, the CI won't be triggered at all
(even if the commit message specifies some models)
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.
Let's keep for now - I'm not sure whether we want this. It's good for the auto model selection, but I can see as being annoying for the
run-slow
case: I might update e.g.modeling_attn_mask_utils.py
and want to be able to easily run the slow tests on a subset of important modelsThere 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.
Yes, we will see 🚀 !