-
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
ENH: [CI
] Add new workflow to run slow tests of important models on push main if they are modified
#29235
ENH: [CI
] Add new workflow to run slow tests of important models on push main if they are modified
#29235
Changes from 117 commits
2a80485
18cefda
e4863ec
d7221c5
344bd60
2d9f171
40e59d9
cb5cd6a
eb82e1a
f741be3
a10859e
670f4e3
2cab682
ec44bf2
0b0f329
ab217ed
6988c63
289b7c8
2ba65e1
1df57e7
07c4a72
ee6d5a9
476767d
f484025
ef2e72b
d3ab484
807b5ca
17f47e1
a0c3a0e
c7a0f9b
d834dfe
2e9b0c8
76708a5
d8d4a5f
5fce2ba
b45cba8
fdfbcb2
adc3891
7377d95
8f0d512
7d68ba5
34101db
aa4d0cc
5d8325c
fb199dc
f22164b
d22e792
1c0f55a
940fc3b
a4975f0
a3c7788
6a7e023
7f3e786
afcb0de
510ac07
2b41e0d
c6b4fd4
c1b2c65
3897158
4df5ea2
a3293f2
802b5bc
1f77ddc
eb9c552
33298c2
d2eb50e
3e70926
5e4678e
9c4b985
21af746
1c08633
a25af70
f91b108
8e9d194
89c06ac
416a399
70a8236
08b25b8
4af835f
8e9e5ec
cd9fb3b
86d7ed5
ad85c5e
8a99e83
90467bf
cccd238
9c7a73c
3f83ca9
9daadc4
7b3643c
c99481f
5e9dd7e
2e06329
7c126f6
190db4b
b6a559f
5c4b795
d63ecbb
aa37e8d
43d9196
de2f2e0
80b6942
8221989
0331c1f
2641920
102154d
f87a68a
ec09cb0
79d6b55
85abc9d
6a6cf28
91dd140
edf4031
a4265bf
5932cf8
f4f55a4
8a3b800
62b419e
5f76b50
d465cc1
62a9db4
cafb9bd
41a0bb6
edb62dc
1f6c3c5
c63bf10
19c65d2
a817a52
f3732d4
5f057d9
1ba9de9
37e0d6a
a78e813
c8b3630
a433af4
5f337ca
6d9fe8b
8637b5c
50d394d
23011c1
ddff293
cb8e9a0
52cde0e
3e3e33b
37dc67b
36efa4e
4b7d113
4fc8cc4
db3a30e
b52fd9e
1cfa3b0
effc252
30ae3db
a965164
f450f73
a5e23b6
c7ddd3e
e9a1b2d
19a6a07
3bdd961
3f34def
17bd56b
03714d6
536cde6
bac1d05
0b37330
92fdc54
6aab455
7b9aa2c
8cba285
3761d08
be78a36
a63d084
701c98f
1998eac
e74e347
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Send message to slack | ||
|
||
description: 'Send resuls on slack' | ||
younesbelkada marked this conversation as resolved.
Show resolved
Hide resolved
|
||
author: 'Hugging Face' | ||
inputs: | ||
slack_channel: | ||
required: true | ||
type: string | ||
title: | ||
required: true | ||
type: string | ||
status: | ||
required: true | ||
type: string | ||
slack_token: | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create content to post | ||
id: create-message | ||
run: | | ||
if [ "${{ inputs.status }}" == "success" ]; then | ||
echo STATUS_MESSAGE='🟢 Tests are passing!' >> $GITHUB_ENV | ||
else | ||
echo STATUS_MESSAGE='🔴 Tests failed! Please check the GitHub action link below' >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
|
||
- name: Post Canceled results Slack channel | ||
id: post-slack | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 | ||
with: | ||
# Slack channel id, channel name, or user id to post message. | ||
# See also: https://api.slack.com/methods/chat.postMessage#channels | ||
channel-id: ${{ inputs.slack_channel }} | ||
# For posting a rich message using Block Kit | ||
payload: | | ||
{ | ||
"text": "${{ inputs.title }}", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "${{ inputs.title }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ env.STATUS_MESSAGE }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": {"type": "mrkdwn", "text": "*Click the button for more details about the commit*"}, | ||
"accessory": { | ||
"type": "button", | ||
"text": {"type": "plain_text", "text": "Check Commit results"}, | ||
"url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": {"type": "mrkdwn", "text": "*Click here for more details about the action ran*"}, | ||
"accessory": { | ||
"type": "button", | ||
"text": {"type": "plain_text", "text": "Check Action results"}, | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ inputs.slack_token }} |
younesbelkada marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Slow tests on important models (on Push - A10) | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
younesbelkada marked this conversation as resolved.
Show resolved
Hide resolved
younesbelkada marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
env: | ||
RUN_SLOW: "yes" | ||
IS_GITHUB_CI: "1" | ||
OUTPUT_SLACK_CHANNEL_ID: "C06L2SGMEEA" | ||
younesbelkada marked this conversation as resolved.
Show resolved
Hide resolved
|
||
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }} | ||
HF_HOME: /mnt/cache | ||
TRANSFORMERS_IS_CI: yes | ||
OMP_NUM_THREADS: 8 | ||
MKL_NUM_THREADS: 8 | ||
RUN_SLOW: yes # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access. # This token is created under the bot `hf-transformers-bot`. | ||
SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }} | ||
TF_FORCE_GPU_ALLOW_GROWTH: true | ||
RUN_PT_TF_CROSS_TESTS: 1 | ||
|
||
jobs: | ||
get_modified_models: | ||
name: "Get all modified files" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@3f54ebb830831fc121d3263c1857cfbdc310cdb9 #v42 | ||
with: | ||
files: src/transformers/models/** | ||
- name: Run step if only the files listed above change | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
id: set-matrix | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
model_arrays=() | ||
for file in $ALL_CHANGED_FILES; do | ||
model_path="${file#*models/}" | ||
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. I can't understand this line. What this does? 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. This line extracts a substring from the value of $file. It removes everything up to and including the string "models/" from the beginning of the value, I use it later down to extract the model name |
||
model_path="models/${model_path%%/*}" | ||
if grep -qFx "$model_path" utils/important_models.txt; then | ||
# Append the file to the matrix string | ||
model_arrays+=("$model_path") | ||
fi | ||
done | ||
matrix_string=$(printf '"%s", ' "${model_arrays[@]}" | sed 's/, $//') | ||
echo "matrix=[$matrix_string]" >> $GITHUB_OUTPUT | ||
test_modified_files: | ||
needs: get_modified_models | ||
name: Run slow tests on modified models | ||
runs-on: [single-gpu, nvidia-gpu, a10, ci] | ||
container: | ||
image: huggingface/transformers-all-latest-gpu | ||
ArthurZucker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ | ||
if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
model-name: ${{ fromJson(needs.get_modified_models.outputs.matrix) }} | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Install locally transformers & other libs | ||
run: | | ||
pip uninstall transformers && pip install -e ".[testing]" | ||
MAX_JOBS=4 pip install flash-attn --no-build-isolation | ||
pip install bitsandbytes | ||
- name: Tailscale | ||
uses: huggingface/tailscale-action@main | ||
with: | ||
authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }} | ||
debugEnabled: ${{ secrets.ACTIONS_STEP_DEBUG }} | ||
slackChannel: ${{ secrets.SLACK_CIFEEDBACK_CHANNEL }} | ||
slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} | ||
containerMode: false | ||
- name: NVIDIA-SMI | ||
run: | | ||
nvidia-smi | ||
- name: Show installed libraries and their versions | ||
run: pip freeze | ||
- name: Run FA2 tests | ||
id: run_fa2_tests | ||
run: | ||
pytest -m "flash_attn_test" --make-reports=${{ matrix.model-name }}_fa2_tests/ tests/${{ matrix.model-name }}/test_modeling_* | ||
- name: Post to Slack | ||
if: always() | ||
uses: ./.github/actions/post-slack | ||
with: | ||
slack_channel: ${{ env.OUTPUT_SLACK_CHANNEL_ID }} | ||
title: 🤗 Results of the FA2 tests - ${{ matrix.model-name }} | ||
status: ${{ steps.run_fa2_tests.conclusion}} | ||
slack_token: ${{ secrets.CI_SLACK_BOT_TOKEN }} | ||
- name: Run integration tests | ||
id: run_integration_tests | ||
if: always() | ||
run: | ||
pytest -k "IntegrationTest" tests/${{ matrix.model-name }}/test_modeling_* | ||
- name: Post to Slack | ||
if: always() | ||
uses: ./.github/actions/post-slack | ||
with: | ||
slack_channel: ${{ env.OUTPUT_SLACK_CHANNEL_ID }} | ||
title: 🤗 Results of the Integration tests - ${{ matrix.model-name }} | ||
status: ${{ steps.run_integration_tests.conclusion}} | ||
slack_token: ${{ secrets.CI_SLACK_BOT_TOKEN }} | ||
- name: Wait for SSH | ||
if: always() | ||
run : | | ||
sleep 180s | ||
while [ "$(last | grep '^root.*still logged in$')" ]; do sleep 1m; done |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,4 @@ | ||||||||
models/llama | ||||||||
younesbelkada marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
models/mistral | ||||||||
models/mixtral | ||||||||
models/gemma | ||||||||
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. Let's add whisper here too 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.
Suggested change
let's at least add this one, and cc @amyeroberts and @NielsRogge maybe Llava? 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. Yes llava is a good candidate 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. Yep - llava is good to add! |
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 had to create that as re-usable workflows cannot be used within steps..
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.
why we can't just make it a separate job in the new workflow file
push-important-models.yml
?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.
Because it lead to too many duplicated code, I preferred this approach that made that workflow file much cleaner and easier to understand