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

ENH: [CI] Add new workflow to run slow tests of important models on push main if they are modified #29235

Merged
merged 176 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
2a80485
v1
younesbelkada Feb 23, 2024
18cefda
v1
younesbelkada Feb 23, 2024
e4863ec
more changes
younesbelkada Feb 23, 2024
d7221c5
more models
younesbelkada Feb 23, 2024
344bd60
add more markers
younesbelkada Feb 23, 2024
2d9f171
swtich to A10
younesbelkada Feb 23, 2024
40e59d9
use cache
younesbelkada Feb 23, 2024
cb5cd6a
Update .github/workflows/push-important-models.yml
younesbelkada Feb 27, 2024
eb82e1a
Merge branch 'main' into add-new-push-test-workflow
younesbelkada Feb 29, 2024
f741be3
Update .github/workflows/push-important-models.yml
younesbelkada Feb 29, 2024
a10859e
Update modeling_llama.py
younesbelkada Feb 29, 2024
670f4e3
test
younesbelkada Feb 29, 2024
2cab682
test
younesbelkada Feb 29, 2024
ec44bf2
another test
younesbelkada Feb 29, 2024
0b0f329
test
younesbelkada Feb 29, 2024
ab217ed
test
younesbelkada Feb 29, 2024
6988c63
attempt to fix
younesbelkada Feb 29, 2024
289b7c8
fix
younesbelkada Feb 29, 2024
2ba65e1
try automatic tagging
younesbelkada Feb 29, 2024
1df57e7
fix
younesbelkada Feb 29, 2024
07c4a72
alternative approach for collecting
younesbelkada Feb 29, 2024
ee6d5a9
fix
younesbelkada Feb 29, 2024
476767d
fix
younesbelkada Feb 29, 2024
f484025
fix
younesbelkada Feb 29, 2024
ef2e72b
test
younesbelkada Feb 29, 2024
d3ab484
fix
younesbelkada Feb 29, 2024
807b5ca
fix
younesbelkada Feb 29, 2024
17f47e1
test
younesbelkada Feb 29, 2024
a0c3a0e
revert some changes
younesbelkada Feb 29, 2024
c7a0f9b
fix
younesbelkada Feb 29, 2024
d834dfe
fix
younesbelkada Feb 29, 2024
2e9b0c8
fix
younesbelkada Feb 29, 2024
76708a5
final push
younesbelkada Feb 29, 2024
d8d4a5f
fix
younesbelkada Feb 29, 2024
5fce2ba
revert
younesbelkada Feb 29, 2024
b45cba8
Merge remote-tracking branch 'upstream/main' into add-new-push-test-w…
younesbelkada Feb 29, 2024
fdfbcb2
Merge remote-tracking branch 'upstream/main' into add-new-push-test-w…
younesbelkada Mar 4, 2024
adc3891
test new slack message
younesbelkada Mar 4, 2024
7377d95
oops
younesbelkada Mar 4, 2024
8f0d512
Update send-slack.yml
younesbelkada Mar 4, 2024
7d68ba5
test
younesbelkada Mar 4, 2024
34101db
test re-usable workflow in steps
younesbelkada Mar 4, 2024
aa4d0cc
Update action.yml
younesbelkada Mar 4, 2024
5d8325c
test
younesbelkada Mar 4, 2024
fb199dc
Merge branch 'add-new-push-test-workflow' of https://github.com/huggi…
younesbelkada Mar 4, 2024
f22164b
another test
younesbelkada Mar 4, 2024
d22e792
test
younesbelkada Mar 4, 2024
1c0f55a
another test
younesbelkada Mar 4, 2024
940fc3b
test
younesbelkada Mar 4, 2024
a4975f0
another test
younesbelkada Mar 4, 2024
a3c7788
another test (hopefully last one)
younesbelkada Mar 4, 2024
6a7e023
attempt to fix
younesbelkada Mar 4, 2024
7f3e786
allez
younesbelkada Mar 4, 2024
afcb0de
removing comma
younesbelkada Mar 4, 2024
510ac07
test
younesbelkada Mar 4, 2024
2b41e0d
another test
younesbelkada Mar 4, 2024
c6b4fd4
attempt
younesbelkada Mar 4, 2024
c1b2c65
test
younesbelkada Mar 4, 2024
3897158
test
younesbelkada Mar 4, 2024
4df5ea2
test push
younesbelkada Mar 4, 2024
a3293f2
test
younesbelkada Mar 4, 2024
802b5bc
test
younesbelkada Mar 4, 2024
1f77ddc
another test
younesbelkada Mar 4, 2024
eb9c552
test
younesbelkada Mar 4, 2024
33298c2
make it better
younesbelkada Mar 4, 2024
d2eb50e
fix commas
younesbelkada Mar 4, 2024
3e70926
valid json
younesbelkada Mar 4, 2024
5e4678e
test
younesbelkada Mar 4, 2024
9c4b985
another test
younesbelkada Mar 4, 2024
21af746
test
younesbelkada Mar 4, 2024
1c08633
final push
younesbelkada Mar 4, 2024
a25af70
test
younesbelkada Mar 4, 2024
f91b108
final push
younesbelkada Mar 4, 2024
8e9d194
Merge remote-tracking branch 'upstream/main' into add-new-push-test-w…
younesbelkada Mar 5, 2024
89c06ac
more customizable messages
younesbelkada Mar 5, 2024
416a399
test
younesbelkada Mar 5, 2024
70a8236
push
younesbelkada Mar 5, 2024
08b25b8
oops
younesbelkada Mar 5, 2024
4af835f
another test
younesbelkada Mar 5, 2024
8e9e5ec
another test
younesbelkada Mar 5, 2024
cd9fb3b
missing indentation
younesbelkada Mar 5, 2024
86d7ed5
more tweaks
younesbelkada Mar 5, 2024
ad85c5e
more tweaks
younesbelkada Mar 5, 2024
8a99e83
another test
younesbelkada Mar 5, 2024
90467bf
another test
younesbelkada Mar 5, 2024
cccd238
tests
younesbelkada Mar 5, 2024
9c7a73c
final push
younesbelkada Mar 5, 2024
3f83ca9
use global variables instead
younesbelkada Mar 5, 2024
9daadc4
Update .github/workflows/push-important-models.yml
younesbelkada Mar 5, 2024
7b3643c
Apply suggestions from code review
younesbelkada Mar 6, 2024
c99481f
commit to test all models
younesbelkada Mar 6, 2024
5e9dd7e
issue with arrays
younesbelkada Mar 6, 2024
2e06329
another test
younesbelkada Mar 6, 2024
7c126f6
attempt to fix failing tests
younesbelkada Mar 6, 2024
190db4b
Update .github/workflows/push-important-models.yml
younesbelkada Mar 20, 2024
b6a559f
Merge remote-tracking branch 'upstream/main' into add-new-push-test-w…
younesbelkada Mar 20, 2024
5c4b795
add ssh
younesbelkada Mar 20, 2024
d63ecbb
Update .github/workflows/push-important-models.yml
younesbelkada Mar 20, 2024
aa37e8d
test
younesbelkada Mar 20, 2024
43d9196
Merge branch 'add-new-push-test-workflow' of https://github.com/huggi…
younesbelkada Mar 20, 2024
de2f2e0
test
younesbelkada Mar 20, 2024
80b6942
add install curl
younesbelkada Mar 20, 2024
8221989
attempt to fix
younesbelkada Mar 20, 2024
0331c1f
final fix
younesbelkada Mar 20, 2024
2641920
test
younesbelkada Mar 20, 2024
102154d
test
younesbelkada Mar 21, 2024
f87a68a
test
younesbelkada Mar 21, 2024
ec09cb0
fix test
younesbelkada Mar 21, 2024
79d6b55
another test
younesbelkada Mar 21, 2024
85abc9d
add inherit secrets
younesbelkada Mar 22, 2024
6a6cf28
push
younesbelkada Mar 22, 2024
91dd140
revert unneeded changes
younesbelkada Mar 22, 2024
edf4031
revert
younesbelkada Mar 22, 2024
a4265bf
add env variables
younesbelkada Mar 22, 2024
5932cf8
add pip freeze
younesbelkada Mar 22, 2024
f4f55a4
revert change in gemma
younesbelkada Mar 22, 2024
8a3b800
Update .github/workflows/push-important-models.yml
younesbelkada Mar 22, 2024
62b419e
fix mistral and mixtral
younesbelkada Mar 22, 2024
5f76b50
add pdb
younesbelkada Mar 22, 2024
d465cc1
fix mixtral tesst
younesbelkada Mar 22, 2024
62a9db4
fix
younesbelkada Mar 22, 2024
cafb9bd
fix mistral ?
younesbelkada Mar 22, 2024
41a0bb6
add fix gemma
younesbelkada Mar 22, 2024
edb62dc
fix mistral
younesbelkada Mar 22, 2024
1f6c3c5
fix
younesbelkada Mar 22, 2024
c63bf10
test
younesbelkada Mar 22, 2024
19c65d2
anoter test
younesbelkada Mar 22, 2024
a817a52
fix
younesbelkada Mar 22, 2024
f3732d4
fix
younesbelkada Mar 22, 2024
5f057d9
fix mistral tests
younesbelkada Mar 22, 2024
1ba9de9
fix them again
younesbelkada Mar 22, 2024
37e0d6a
final fixes for mistral
younesbelkada Mar 22, 2024
a78e813
fix padding right
younesbelkada Mar 22, 2024
c8b3630
fix whipser fa2
younesbelkada Mar 22, 2024
a433af4
fix
younesbelkada Mar 22, 2024
5f337ca
fix
younesbelkada Mar 22, 2024
6d9fe8b
fix gemma
younesbelkada Mar 22, 2024
8637b5c
test
younesbelkada Mar 22, 2024
50d394d
fix llama
younesbelkada Mar 22, 2024
23011c1
fix
younesbelkada Mar 22, 2024
ddff293
fix
younesbelkada Mar 22, 2024
cb8e9a0
fix llama gemma
younesbelkada Mar 22, 2024
52cde0e
add class attribute
younesbelkada Mar 22, 2024
3e3e33b
fix CI
younesbelkada Mar 22, 2024
37dc67b
clarify whisper
younesbelkada Mar 22, 2024
36efa4e
compute_capability
ydshieh Mar 27, 2024
4b7d113
rename names in some comments
ydshieh Mar 27, 2024
4fc8cc4
Add # fmt: skip
ydshieh Mar 27, 2024
db3a30e
make style
ydshieh Mar 27, 2024
b52fd9e
Update tests/models/mistral/test_modeling_mistral.py
ydshieh Mar 29, 2024
1cfa3b0
update
ydshieh Mar 29, 2024
effc252
update
ydshieh Apr 3, 2024
30ae3db
Merge remote-tracking branch 'upstream/main' into add-new-push-test-w…
younesbelkada Apr 9, 2024
a965164
change branch
younesbelkada Apr 9, 2024
f450f73
correct workflow
younesbelkada Apr 9, 2024
a5e23b6
modify file
younesbelkada Apr 9, 2024
c7ddd3e
test
younesbelkada Apr 9, 2024
e9a1b2d
works
younesbelkada Apr 9, 2024
19a6a07
Merge remote-tracking branch 'upstream/main' into fix-slow-tests-shieh
younesbelkada Apr 9, 2024
3bdd961
Merge remote-tracking branch 'upstream/main' into add-new-push-test-w…
younesbelkada Apr 9, 2024
3f34def
Merge remote-tracking branch 'upstream/fix-slow-tests-shieh' into add…
younesbelkada Apr 9, 2024
17bd56b
final test
younesbelkada Apr 9, 2024
03714d6
another fix
younesbelkada Apr 9, 2024
536cde6
install sudo
younesbelkada Apr 9, 2024
bac1d05
final fix
younesbelkada Apr 9, 2024
0b37330
add `-y`
younesbelkada Apr 9, 2024
92fdc54
set to `main`
younesbelkada Apr 9, 2024
6aab455
Update .github/actions/post-slack/action.yml
younesbelkada Apr 9, 2024
7b9aa2c
change title
younesbelkada Apr 9, 2024
8cba285
Merge branch 'add-new-push-test-workflow' of https://github.com/huggi…
younesbelkada Apr 9, 2024
3761d08
fixup
younesbelkada Apr 9, 2024
be78a36
Merge remote-tracking branch 'upstream/main' into add-new-push-test-w…
younesbelkada Apr 9, 2024
a63d084
add upload report
younesbelkada Apr 9, 2024
701c98f
fix
younesbelkada Apr 9, 2024
1998eac
revert to main
younesbelkada Apr 9, 2024
e74e347
add empty lines + add comment
younesbelkada Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/actions/post-slack/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Send message to slack

description: 'Send results to slack'
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 }}
136 changes: 136 additions & 0 deletions .github/workflows/push-important-models.yml
younesbelkada marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
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:
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/}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't understand this line. What this does?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 models/xxx if it is included in important_models.txt

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: Slow & FA2 tests
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: |
apt install sudo
sudo -H pip install --upgrade pip
sudo -H pip uninstall -y transformers
sudo -H pip install -U -e ".[testing]"
MAX_JOBS=4 pip install flash-attn --no-build-isolation
pip install bitsandbytes

- 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: "Test suite reports artifacts: ${{ matrix.model-name }}_fa2_tests"
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's separate each step by an empty line - easier to read 🙏

if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.model-name }}_fa2_tests
path: /transformers/reports/${{ matrix.model-name }}_fa2_tests

- 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" --make-reports=tests_integration_${{ matrix.model-name }} tests/${{ matrix.model-name }}/test_modeling_*

- name: "Test suite reports artifacts: tests_integration_${{ matrix.model-name }}"
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: tests_integration_${{ matrix.model-name }}
path: /transformers/reports/tests_integration_${{ matrix.model-name }}

- 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: Tailscale # In order to be able to SSH when a test fails
if: ${{ failure() || runner.debug == '1'}}
uses: huggingface/tailscale-action@ssh-improvments
with:
authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }}
slackChannel: ${{ secrets.SLACK_CIFEEDBACK_CHANNEL }}
slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
waitForSSH: true
4 changes: 4 additions & 0 deletions utils/important_models.txt
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add whisper here too

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
models/gemma
models/gemma
models/whisper

let's at least add this one, and cc @amyeroberts and @NielsRogge maybe Llava?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes llava is a good candidate

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep - llava is good to add!

Loading