Skip to content

Commit 699ee7d

Browse files
authored
Add llama jobs on Arm64 and reduce llama jobs on MacOS (#9251)
Reduce macos llama runners Add arm64 llama runners: distribute into pull.yml and trunk.yml jobs.
1 parent 718aa6f commit 699ee7d

File tree

2 files changed

+74
-11
lines changed

2 files changed

+74
-11
lines changed

.github/workflows/pull.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ jobs:
136136
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
137137
138138
test-llama-runner-linux:
139+
# Test Both linux x86 and linux aarch64
139140
name: test-llama-runner-linux
140141
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
141142
permissions:
@@ -144,21 +145,29 @@ jobs:
144145
strategy:
145146
matrix:
146147
dtype: [fp32]
147-
mode: [portable, xnnpack+custom, xnnpack+custom+qe,xnnpack+custom+quantize_kv,xnnpack+quantize_kv]
148+
mode: [xnnpack+custom+qe,xnnpack+custom+quantize_kv,xnnpack+quantize_kv]
149+
runner: [linux.2xlarge, linux.arm64.2xlarge]
150+
docker-image: [executorch-ubuntu-22.04-clang12, executorch-ubuntu-22.04-gcc11-aarch64]
148151
include:
149-
- dtype: bf16
150-
mode: portable
151152
- dtype: bf16
152153
mode: custom
154+
runner: linux.2xlarge
155+
docker-image: executorch-ubuntu-22.04-clang12
156+
# Excluding specific runner + docker image combinations that don't make sense:
157+
# - Excluding the ARM64 gcc image on the x86 runner (linux.2xlarge)
158+
# - Excluding the x86 clang image on the ARM64 runner (linux.arm64.2xlarge)
159+
exclude:
160+
- runner: linux.2xlarge
161+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
162+
- runner: linux.arm64.2xlarge
163+
docker-image: executorch-ubuntu-22.04-clang12
153164
fail-fast: false
154165
with:
155-
runner: linux.2xlarge
156-
docker-image: executorch-ubuntu-22.04-clang12
166+
runner: ${{ matrix.runner }}
167+
docker-image: ${{ matrix.docker-image }}
157168
submodules: 'true'
158169
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
159170
timeout: 900
160-
upload-artifact: android-models
161-
upload-artifact-to-s3: true
162171
script: |
163172
# The generic Linux job chooses to use base env, not the one setup by the image
164173
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")

.github/workflows/trunk.yml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,18 +283,72 @@ jobs:
283283
# Test ANE llama
284284
${CONDA_RUN} sh .ci/scripts/test_ane_static_llama.sh
285285
286-
test-llama-runner-macos:
287-
name: test-llama-runner-mac
288-
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
286+
test-llama-runner-linux:
287+
# Test Both linux x86 and linux aarch64
288+
name: test-llama-runner-linux
289+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
290+
permissions:
291+
id-token: write
292+
contents: read
289293
strategy:
290294
matrix:
291295
dtype: [fp32]
292-
mode: [portable, xnnpack+kv+custom, mps, coreml, xnnpack+custom+quantize_kv]
296+
mode: [portable, xnnpack+custom]
297+
runner: [linux.2xlarge, linux.arm64.2xlarge]
298+
docker-image: [executorch-ubuntu-22.04-clang12, executorch-ubuntu-22.04-gcc11-aarch64]
293299
include:
294300
- dtype: bf16
295301
mode: portable
302+
runner: linux.2xlarge
303+
docker-image: executorch-ubuntu-22.04-clang12
304+
- dtype: bf16
305+
mode: portable
306+
runner: linux.arm64.2xlarge
307+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
296308
- dtype: bf16
297309
mode: custom
310+
runner: linux.arm64.2xlarge
311+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
312+
# Excluding specific runner + docker image combinations that don't make sense:
313+
# - Excluding the ARM64 gcc image on the x86 runner (linux.2xlarge)
314+
# - Excluding the x86 clang image on the ARM64 runner (linux.arm64.2xlarge)
315+
exclude:
316+
- runner: linux.2xlarge
317+
docker-image: executorch-ubuntu-22.04-gcc11-aarch64
318+
- runner: linux.arm64.2xlarge
319+
docker-image: executorch-ubuntu-22.04-clang12
320+
fail-fast: false
321+
with:
322+
runner: ${{ matrix.runner }}
323+
docker-image: ${{ matrix.docker-image }}
324+
submodules: 'true'
325+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
326+
timeout: 900
327+
script: |
328+
# The generic Linux job chooses to use base env, not the one setup by the image
329+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
330+
conda activate "${CONDA_ENV}"
331+
332+
DTYPE=${{ matrix.dtype }}
333+
BUILD_TOOL="cmake"
334+
MODE=${{ matrix.mode }}
335+
ARTIFACTS_DIR_NAME="artifacts-to-be-uploaded/${DTYPE}-${MODE}"
336+
ARTIFACTS_DIR_NAME="${ARTIFACTS_DIR_NAME/+/-}"
337+
338+
# Setup executorch
339+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
340+
# Install requirements for export_llama
341+
PYTHON_EXECUTABLE=python bash examples/models/llama/install_requirements.sh
342+
# Test llama2
343+
PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama.sh -model stories110M -build_tool "${BUILD_TOOL}" -dtype "${DTYPE}" -mode "${MODE}" -upload "${ARTIFACTS_DIR_NAME}"
344+
345+
test-llama-runner-macos:
346+
name: test-llama-runner-mac
347+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
348+
strategy:
349+
matrix:
350+
dtype: [fp32]
351+
mode: [mps, coreml, xnnpack+custom+quantize_kv]
298352
fail-fast: false
299353
with:
300354
runner: macos-m1-stable

0 commit comments

Comments
 (0)