-
Notifications
You must be signed in to change notification settings - Fork 27.4k
144 lines (135 loc) · 5.68 KB
/
self-new-model-pr-caller.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: PR slow CI
on:
pull_request:
env:
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`.
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
TF_FORCE_GPU_ALLOW_GROWTH: true
RUN_PT_TF_CROSS_TESTS: 1
CUDA_VISIBLE_DEVICES: 0,1
jobs:
find_models_to_run:
runs-on: ubuntu-22.04
name: Find models to run slow tests
if: ${{ contains(github.event.pull_request.labels.*.name, 'run-slow') }}
outputs:
models: ${{ steps.models_to_run.outputs.models }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
ref: ${{ github.event.pull_request.head.sha }}
- name: Check commit message
run: |
echo "${{ github.event.head_commit.message }}"
echo "commit_message=$(git show -s --format=%s)" >> $GITHUB_ENV
# TODO: change the file name and implement commit message logic in the script
- name: Get models to run slow CI
run: |
python -m pip install GitPython
python utils/check_if_new_model_added.py | tee output.txt
echo "models=$(tail -n 1 output.txt)" >> $GITHUB_ENV
- name: Models to run slow CI
id: models_to_run
run: |
echo "${{ env.commit_message }}"
echo "models=${{ env.models }}" >> $GITHUB_OUTPUT
dummy:
runs-on: ubuntu-22.04
name: Check models to run 1
needs: find_models_to_run
steps:
- name: Check if there are specified models
run: |
echo "${{ needs.find_models_to_run.outputs.models }}"
dummy2:
runs-on: ubuntu-22.04
name: Check models to run 2
needs: find_models_to_run
if: ${{ needs.find_models_to_run.outputs.models != '[]' }}
steps:
- name: Check if there are specified models
run: |
echo "${{ needs.find_models_to_run.outputs.models }}"
#
# 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
# strategy:
# fail-fast: false
# matrix:
# folders: ["${{ needs.check_for_new_model.outputs.new_model }}"]
# machine_type: [single-gpu, multi-gpu]
# runs-on: ['${{ matrix.machine_type }}', nvidia-gpu, t4, ci]
# container:
# image: huggingface/transformers-all-latest-gpu
# options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
# steps:
# - name: Echo input and matrix info
# shell: bash
# run: |
# echo "${{ matrix.folders }}"
#
# - name: Echo folder ${{ matrix.folders }}
# shell: bash
# # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to
# # set the artifact folder names (because the character `/` is not allowed).
# run: |
# echo "${{ matrix.folders }}"
# matrix_folders=${{ matrix.folders }}
# matrix_folders=${matrix_folders/'models/'/'models_'}
# echo "$matrix_folders"
# echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV
#
# - name: Update clone
# working-directory: /transformers
# run: git fetch && git fetch origin pull/${{ github.event.pull_request.number }}/head:pull/${{ github.event.pull_request.number }}/merge && git checkout pull/${{ github.event.pull_request.number }}/merge
#
# - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
# working-directory: /transformers
# run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
#
# - name: NVIDIA-SMI
# run: |
# nvidia-smi
#
# - name: Environment
# working-directory: /transformers
# run: |
# python3 utils/print_env.py
#
# - name: Show installed libraries and their versions
# working-directory: /transformers
# run: pip freeze
#
# - name: Run all tests on GPU
# working-directory: /transformers
# run: python3 -m pytest -v -rs --make-reports=${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }}
#
# - name: Failure short reports
# if: ${{ failure() }}
# continue-on-error: true
# run: cat /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/failures_short.txt
#
# - name: Make sure report directory exists
# shell: bash
# run: |
# mkdir -p /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports
# echo "hello" > /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/hello.txt
# echo "${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports"
#
# - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports"
# if: ${{ always() }}
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports
# path: /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports