@@ -4,6 +4,10 @@ run-name: ${{ inputs.run_name }}
4
4
on :
5
5
workflow_dispatch :
6
6
inputs :
7
+ test_mode :
8
+ description : accuracy or performance
9
+ type : string
10
+ default : accuracy
7
11
suite :
8
12
description : Test suite
9
13
type : choice
71
75
BENCHMARK_REPO : pytorch/benchmark
72
76
73
77
jobs :
74
- setup :
75
- name : Setup
76
- runs-on : linux
77
- outputs :
78
- suite : ${{ steps.set-matrix.outputs.suite }}
79
- mode : ${{ steps.set-matrix.outputs.mode }}
80
- dtype : ${{ steps.set-matrix.outputs.dtype }}
81
- models : ${{ steps.set-matrix.outputs.models }}
82
- timeout-minutes : 10
83
- steps :
84
- - name : Set matrix
85
- id : set-matrix
86
- run : |
87
- if [[ -z "${{ inputs.suite }}" || "${{ inputs.suite }}" == "all" ]]; then
88
- suite='["huggingface", "timm_models", "torchbench"]'
89
- else
90
- suite='["${{ inputs.suite }}"]'
91
- fi
92
- if [[ -z "${{ inputs.mode }}" || "${{ inputs.mode }}" == "all" ]]; then
93
- mode='["inference", "inference-with-freezing", "training"]'
94
- else
95
- mode='["${{ inputs.mode }}"]'
96
- fi
97
- if [[ -z "${{ inputs.dtype }}" || "${{ inputs.dtype }}" == "all" ]]; then
98
- dtype='["amp_bf16", "amp_fp16", "bfloat16", "float16", "float32"]'
99
- else
100
- dtype='["${{ inputs.dtype }}"]'
101
- fi
102
- if [[ -z "${{ inputs.models }}" ]]; then
103
- models="subset"
104
- else
105
- models="${{ inputs.models }}"
106
- fi
107
- echo "suite=$suite" >> $GITHUB_OUTPUT
108
- echo "mode=$mode" >> $GITHUB_OUTPUT
109
- echo "dtype=$dtype" >> $GITHUB_OUTPUT
110
- echo "models=$models" >> $GITHUB_OUTPUT
111
-
112
- - name : Print inputs
113
- run : |
114
- cat <<EOF
115
- ${{ toJSON(github.event.inputs) }}
116
- EOF
117
-
118
- - name : Print setup outputs
119
- run : |
120
- cat <<EOF
121
- ${{ toJSON(steps.set-matrix.outputs) }}
122
- EOF
123
-
124
78
tests :
125
79
name : Tests
126
- needs : setup
127
80
runs-on :
128
81
- windows
129
82
- ${{ inputs.runner_label }}
130
83
timeout-minutes : 1440 # 24h
131
84
strategy :
132
85
fail-fast : false
133
86
steps :
87
+ - name : Print inputs
88
+ shell : bash
89
+ run : |
90
+ cat <<EOF
91
+ ${{ toJSON(github.event.inputs) }}
92
+ EOF
93
+
134
94
- name : Checkout repository
135
95
uses : actions/checkout@v4
136
96
@@ -153,12 +113,6 @@ jobs:
153
113
run :
154
114
python -m venv .venv
155
115
156
- # https://github.com/pytorch/data/blob/e316c5ca1ab2a4f69dd6d48e8fc9c6f8d0c7c468/README.md?plain=1#L6-L15
157
- - name : Install pinned torchdata
158
- run : |
159
- .venv\Scripts\activate.ps1
160
- pip install torchdata==0.9.0
161
-
162
116
- name : Install PyTorch (source)
163
117
run : |
164
118
.venv\Scripts\activate.ps1
@@ -174,7 +128,7 @@ jobs:
174
128
run : |
175
129
.venv\Scripts\activate.ps1
176
130
Invoke-BatchFile "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
177
- python -c 'import torch;print(torch.__version__)' Tee-Object -Variable PYTORCH_VERSION
131
+ python -c 'import torch; print(torch.__version__)' | Tee-Object -Variable PYTORCH_VERSION
178
132
echo "PYTORCH_VERSION=$PYTORCH_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
179
133
180
134
- name : Clean up Triton cache
@@ -200,26 +154,88 @@ jobs:
200
154
python -c 'import triton; print(triton.__version__)'
201
155
202
156
- name : Identify pinned versions
157
+ shell : bash
203
158
run : |
204
- cd c: /pytorch
159
+ cd /c /pytorch
205
160
echo "BENCHMARK_COMMIT_ID=$(<.github/ci_commit_pins/torchbench.txt)" | tee -a "$GITHUB_ENV"
206
161
echo "TORCHVISION_COMMIT_ID=$(<.github/ci_commit_pins/vision.txt)" | tee -a "$GITHUB_ENV"
207
162
echo "TORCHTEXT_COMMIT_ID=$(<.github/ci_commit_pins/text.txt)" | tee -a "$GITHUB_ENV"
208
163
echo "TORCHAUDIO_COMMIT_ID=$(<.github/ci_commit_pins/audio.txt)" | tee -a "$GITHUB_ENV"
209
164
echo "TRANSFORMERS_VERSION=$(<.ci/docker/ci_commit_pins/huggingface.txt)" | tee -a "$GITHUB_ENV"
210
165
echo "TIMM_COMMIT_ID=$(<.ci/docker/ci_commit_pins/timm.txt)" | tee -a "$GITHUB_ENV"
211
166
167
+ - name : Install pinned torchdata
168
+ run : |
169
+ .venv\Scripts\activate.ps1
170
+ # Pinned torchdata
171
+ # https://github.com/pytorch/data/blob/e316c5ca1ab2a4f69dd6d48e8fc9c6f8d0c7c468/README.md?plain=1#L6-L15
172
+ pip install pyyaml pandas scipy numpy psutil pyre_extensions torchrec torchdata==0.9.0
173
+
174
+ - name : Install transformers package
175
+ if : inputs.suite == 'all' || inputs.suite == 'huggingface'
176
+ uses : ./.github/actions/install-dependency
177
+ with :
178
+ package : transformers
179
+ repository : huggingface/transformers
180
+ ref : ${{ env.TRANSFORMERS_VERSION }}
181
+ try-tag-prefix : v
182
+ extra-cache-key : ${{ env.PYTORCH_VERSION }}
183
+ workspace : /c/gh${{ github.run_id }}
184
+
185
+ - name : Install torchvision package
186
+ if : inputs.suite == 'all' || inputs.suite == 'timm_models' || inputs.suite == 'torchbench'
187
+ env :
188
+ DISTUTILS_USE_SDK : ' 1'
189
+ uses : ./.github/actions/install-dependency
190
+ with :
191
+ package : torchvision
192
+ repository : pytorch/vision
193
+ ref : ${{ env.TORCHVISION_COMMIT_ID }}
194
+ extra-cache-key : ${{ env.PYTORCH_VERSION }}
195
+ workspace : /c/gh${{ github.run_id }}
196
+
197
+ - name : Install torchtext package
198
+ if : inputs.suite == 'all' || inputs.suite == 'torchbench'
199
+ uses : ./.github/actions/install-dependency
200
+ with :
201
+ package : torchtext
202
+ repository : pytorch/text
203
+ ref : ${{ env.TORCHTEXT_COMMIT_ID }}
204
+ extra-cache-key : ${{ env.PYTORCH_VERSION }}
205
+ workspace : /c/gh${{ github.run_id }}
206
+
207
+ - name : Install torchaudio package
208
+ if : inputs.suite == 'all' || inputs.suite == 'torchbench'
209
+ uses : ./.github/actions/install-dependency
210
+ with :
211
+ package : torchaudio
212
+ repository : pytorch/audio
213
+ ref : ${{ env.TORCHAUDIO_COMMIT_ID }}
214
+ extra-cache-key : ${{ env.PYTORCH_VERSION }}
215
+ workspace : /c/gh${{ github.run_id }}
216
+
217
+ - name : Install timm package
218
+ if : inputs.suite == 'all' || inputs.suite == 'timm_models' || inputs.suite == 'torchbench'
219
+ uses : ./.github/actions/install-dependency
220
+ with :
221
+ package : timm
222
+ repository : huggingface/pytorch-image-models
223
+ ref : ${{ env.TIMM_COMMIT_ID }}
224
+ extra-cache-key : ${{ env.PYTORCH_VERSION }}
225
+ workspace : /c/gh${{ github.run_id }}
226
+
227
+ - name : Identify GPU
228
+ run : |
229
+ # Initializing oneAPI to enable sycl-ls, which is used in capture-hw-details.sh on Windows.
230
+ Invoke-BatchFile "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
231
+ bash -c './scripts/capture-hw-details.sh | tee -a $GITHUB_ENV'
232
+
212
233
- name : Report environment details
213
234
shell : bash
214
235
run : |
215
- mkdir -p ${{ env.NEW_WORKSPACE }}\inductor_log
236
+ mkdir -p /c/gh${{ github.run_id }}/inductor_log
237
+ cat <<EOF | tee /c/gh${{ github.run_id }}/inductor_log/e2e.env
216
238
TIMESTAMP=$(date '+%Y%m%d%H%M%S')
217
- echo "TIMESTAMP=$TIMESTAMP" >> "${GITHUB_ENV}"
218
-
219
- source ./scripts/capture-hw-details.sh --quiet
220
-
221
- cat <<EOF | tee ${{ env.NEW_WORKSPACE }}\inductor_log\.env
222
- TIMESTAMP=$TIMESTAMP
223
239
JOB_NAME=${{ join(inputs.*, '-') }}
224
240
GITHUB_RUN_ID=$GITHUB_RUN_ID
225
241
GITHUB_RUN_NUMBER=$GITHUB_RUN_NUMBER
0 commit comments