@@ -135,24 +135,75 @@ jobs:
135
135
fail-fast : false
136
136
with :
137
137
runner : linux.2xlarge
138
- docker-image : executorch-ubuntu-22.04-clang12
138
+ docker-image : executorch-ubuntu-22.04-clang12-android
139
139
submodules : ' true'
140
140
timeout : 60
141
141
upload-artifact : android-models
142
142
script : |
143
143
# The generic Linux job chooses to use base env, not the one setup by the image
144
+ echo "::group::Setting up dev environment"
144
145
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
145
146
conda activate "${CONDA_ENV}"
146
-
147
+ if [[ ${{ matrix.delegate }} == "qnn" ]]; then
148
+ PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
149
+ PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
150
+ fi
147
151
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "cmake"
148
- echo "Exporting model: ${{ matrix.model }}"
149
- export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded/${{ matrix.model }}_${{ matrix.delegate }}
152
+ ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded/${{ matrix.model }}_${{ matrix.delegate }}
153
+ echo "::endgroup::"
154
+
155
+ echo "::group::Exporting ${{ matrix.delegate }} model: ${{ matrix.model }}"
156
+ BUILD_MODE="cmake"
157
+ DTYPE="fp32"
158
+ if [[ ${{ matrix.delegate }} == "qnn" ]]; then
159
+ DELEGATE_CONFIG="qnn"
160
+ elif [[ ${{ matrix.delegate }} == "xnnpack" ]]; then
161
+ DELEGATE_CONFIG="xnnpack+custom+qe"
162
+ fi
163
+
164
+ if [[ ${{ matrix.model }} == "llama*" ]]; then
165
+ # Install requirements for export_llama
166
+ PYTHON_EXECUTABLE=python bash examples/models/llama2/install_requirements.sh
167
+ # Test llama2
168
+ PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama.sh "${{ matrix.model }}.pt" "${BUILD_MODE}" "${DTYPE}" "${DELEGATE_CONFIG}" "${ARTIFACTS_DIR_NAME}"
169
+ else
170
+ PYTHON_EXECUTABLE=python bash .ci/scripts/test_qnn_model.sh "${{ matrix.model }}"
171
+ fi
172
+ echo "::endgroup::"
173
+
174
+ test-llama-runner-qnn-linux :
175
+ name : test-llama-runner-qnn-linux
176
+ uses : pytorch/test-infra/.github/workflows/linux_job.yml@main
177
+ strategy :
178
+ matrix :
179
+ dtype : [fp32]
180
+ build-tool : [cmake]
181
+ mode : [qnn]
182
+ fail-fast : false
183
+ with :
184
+ runner : linux.2xlarge
185
+ docker-image : executorch-ubuntu-22.04-clang12-android
186
+ submodules : ' true'
187
+ ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
188
+ timeout : 900
189
+ script : |
190
+ # The generic Linux job chooses to use base env, not the one setup by the image
191
+ CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
192
+ conda activate "${CONDA_ENV}"
193
+
194
+ DTYPE=${{ matrix.dtype }}
195
+ BUILD_TOOL=${{ matrix.build-tool }}
196
+ MODE=${{ matrix.mode }}
197
+
198
+ PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
199
+ PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
150
200
151
- # TODO(T197546696): Note that the following scripts/steps only work for llama. It's expected to fail for other models+delegates.
201
+ # Setup executorch
202
+ PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh buck2
152
203
# Install requirements for export_llama
153
204
PYTHON_EXECUTABLE=python bash examples/models/llama2/install_requirements.sh
154
205
# Test llama2
155
- PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama.sh "${{ matrix.model }}.pt " "cmake " "fp32" "xnnpack+custom+qe" "${ARTIFACTS_DIR_NAME}"\
206
+ PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama.sh stories110M.pt "${BUILD_TOOL} " "${DTYPE} " "${MODE}"
156
207
157
208
# Upload models to S3. The artifacts are needed not only by the device farm but also TorchChat
158
209
upload-models :
0 commit comments