Skip to content

Commit 38fe2c6

Browse files
committed
Merge remote-tracking branch 'origin/main' into mtk-android
2 parents 6b5a510 + 47bca20 commit 38fe2c6

File tree

193 files changed

+6569
-1760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+6569
-1760
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d1b87e26e5c4343f5b56bb1e6f89b479b389bfac
1+
bd5482c7c3e1197e10c46ff739027f917d9c1fcc

.github/scripts/propose_ghstack_orig_pr.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def parse_args():
2626
required=True,
2727
)
2828
parser.add_argument(
29-
"--pr",
30-
type=int,
31-
help="Number of the PR in the stack to check and create corresponding PR",
29+
"--ref",
30+
type=str,
31+
help="Ref fo PR in the stack to check and create corresponding PR",
3232
required=True,
3333
)
3434
return parser.parse_args()
@@ -68,12 +68,18 @@ def extract_stack_from_body(pr_body: str) -> List[int]:
6868
return list(reversed(prs))
6969

7070

71-
def get_pr_stack_from_number(pr_number: int, repo: Repository) -> List[int]:
71+
def get_pr_stack_from_number(ref: str, repo: Repository) -> List[int]:
72+
if ref.isnumeric():
73+
pr_number = int(ref)
74+
else:
75+
branch_name = ref.replace("refs/heads/", "")
76+
pr_number = repo.get_branch(branch_name).commit.get_pulls()[0].number
77+
7278
pr_stack = extract_stack_from_body(repo.get_pull(pr_number).body)
7379

7480
if not pr_stack:
7581
raise Exception(
76-
f"Could not find PR stack in body of #{pr_number}. "
82+
f"Could not find PR stack in body of ref. "
7783
+ "Please make sure that the PR was created with ghstack."
7884
)
7985

@@ -100,14 +106,15 @@ def create_prs_for_orig_branch(pr_stack: List[int], repo: Repository):
100106
ghstack PR base: https://github.com/pytorch/executorch/tree/{pr.base.ref}
101107
ghstack PR head: https://github.com/pytorch/executorch/tree/{pr.head.ref}
102108
Merge bot PR base: https://github.com/pytorch/executorch/tree/{orig_branch_merge_base}
103-
Merge bot PR head: https://github.com/pytorch/executorch/tree/{orig_branch_merge_head}"""
109+
Merge bot PR head: https://github.com/pytorch/executorch/tree/{orig_branch_merge_head}
110+
@diff-train-skip-merge"""
104111

105112
existing_orig_pr = repo.get_pulls(
106113
head="pytorch:" + orig_branch_merge_head,
107114
base=orig_branch_merge_base,
108-
state="open",
115+
state="all",
109116
)
110-
if existing_orig_pr.totalCount > 0:
117+
if existing_orig_pr.totalCount > 0 and existing_orig_pr[0].title == pr.title:
111118
print(
112119
f"PR for {orig_branch_merge_head} already exists {existing_orig_pr[0]}"
113120
)
@@ -128,7 +135,7 @@ def main():
128135

129136
with Github(auth=Auth.Token(os.environ["GITHUB_TOKEN"])) as gh:
130137
repo = gh.get_repo(args.repo)
131-
create_prs_for_orig_branch(get_pr_stack_from_number(args.pr, repo), repo)
138+
create_prs_for_orig_branch(get_pr_stack_from_number(args.ref, repo), repo)
132139

133140

134141
if __name__ == "__main__":

.github/workflows/android.yml renamed to .github/workflows/_android.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
11
name: Android
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- release/*
8-
tags:
9-
- ciflow/android/*
10-
pull_request:
11-
paths:
12-
- .ci/docker/**
13-
- .github/workflows/android.yml
14-
- build/*android*.sh
15-
- install_requirements.sh
16-
- examples/demo-apps/android/**
17-
- extension/android/**
18-
- extension/benchmark/android/**
19-
- extension/module/**
4+
workflow_call:
205
workflow_dispatch:
216

22-
concurrency:
23-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
24-
cancel-in-progress: true
25-
267
jobs:
278
build-llm-demo:
289
name: build-llm-demo

.github/workflows/apple-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
# on-demand and periodic benchmarking.
7777
CRON_DEFAULT_MODELS: "stories110M,mv3,mv2,ic4,ic3,resnet50,edsr,mobilebert,w2l"
7878
CRON_DEFAULT_DEVICES: "apple_iphone_15"
79-
CRON_DEFAULT_DELEGATES: "nnpack,coreml,mps"
79+
CRON_DEFAULT_DELEGATES: "xnnpack,coreml,mps"
8080
run: |
8181
set -ex
8282
MODELS="${{ inputs.models }}"

.github/workflows/ghstack_land.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- 'gh/kimishpatel/[0-9]+/base'
1212
- 'gh/kirklandsign/[0-9]+/base'
1313
- 'gh/larryliu0820/[0-9]+/base'
14+
- 'gh/lucylq/[0-9]+/base'
1415
- 'gh/manuelcandales/[0-9]+/base'
1516
- 'gh/mcr229/[0-9]+/base'
1617
- 'gh/swolchok/[0-9]+/base'
1718
- 'gh/SS-JIA/[0-9]+/base'
19+
- 'gh/trivedivivek/[0-9]+/base'
1820

1921
jobs:
2022
ghstack_merge_to_main:
@@ -32,9 +34,7 @@ jobs:
3234
run: |
3335
pip install pygithub
3436
35-
PR_NUMBER=$(echo "$GITHUB_REF" | grep -oE '[0-9]+')
36-
37-
python .github/scripts/propose_ghstack_orig_pr.py --pr $PR_NUMBER --repo pytorch/executorch
37+
python .github/scripts/propose_ghstack_orig_pr.py --ref $GITHUB_REF --repo pytorch/executorch
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GH_PYTORCHBOT_CHERRY_PICK_TOKEN }}
4040
GITHUB_REF: ${{ github.ref }}

.github/workflows/pull.yml

Lines changed: 14 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
name: test-setup-linux-gcc
3636
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
3737
strategy:
38-
matrix:
39-
include:
40-
- build-tool: cmake
4138
fail-fast: false
4239
with:
4340
runner: linux.2xlarge
@@ -50,7 +47,7 @@ jobs:
5047
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
5148
conda activate "${CONDA_ENV}"
5249
53-
BUILD_TOOL=${{ matrix.build-tool }}
50+
BUILD_TOOL="cmake"
5451
5552
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
5653
# Build and test ExecuTorch with the add model on portable backend.
@@ -89,20 +86,11 @@ jobs:
8986
strategy:
9087
matrix:
9188
dtype: [fp32]
92-
build-tool: [buck2, cmake]
9389
mode: [portable, xnnpack+custom, xnnpack+custom+qe]
9490
include:
9591
- dtype: bf16
96-
build-tool: cmake
97-
mode: portable
98-
- dtype: bf16
99-
build-tool: buck2
10092
mode: portable
10193
- dtype: bf16
102-
build-tool: cmake
103-
mode: custom
104-
- dtype: bf16
105-
build-tool: buck2
10694
mode: custom
10795
fail-fast: false
10896
with:
@@ -117,11 +105,11 @@ jobs:
117105
conda activate "${CONDA_ENV}"
118106
119107
DTYPE=${{ matrix.dtype }}
120-
BUILD_TOOL=${{ matrix.build-tool }}
108+
BUILD_TOOL="cmake"
121109
MODE=${{ matrix.mode }}
122110
123111
# Setup executorch
124-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh buck2
112+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
125113
# Install requirements for export_llama
126114
PYTHON_EXECUTABLE=python bash examples/models/llama/install_requirements.sh
127115
# Test llama2
@@ -131,9 +119,6 @@ jobs:
131119
name: test-llama-runner-linux-android
132120
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
133121
strategy:
134-
matrix:
135-
include:
136-
- build-tool: cmake
137122
fail-fast: false
138123
with:
139124
runner: linux.2xlarge
@@ -146,18 +131,14 @@ jobs:
146131
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
147132
conda activate "${CONDA_ENV}"
148133
149-
BUILD_TOOL=${{ matrix.build-tool }}
134+
BUILD_TOOL="cmake"
150135
PYTHON_EXECUTABLE=python \
151136
bash .ci/scripts/build_llama_android.sh "${BUILD_TOOL}"
152137
153138
test-custom-ops-linux:
154139
name: test-custom-ops-linux
155140
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
156141
strategy:
157-
matrix:
158-
include:
159-
- build-tool: buck2
160-
- build-tool: cmake
161142
fail-fast: false
162143
with:
163144
runner: linux.2xlarge
@@ -170,7 +151,7 @@ jobs:
170151
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
171152
conda activate "${CONDA_ENV}"
172153
173-
BUILD_TOOL=${{ matrix.build-tool }}
154+
BUILD_TOOL="cmake"
174155
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
175156
# Test custom ops
176157
PYTHON_EXECUTABLE=python bash examples/portable/custom_ops/test_custom_ops.sh "${BUILD_TOOL}"
@@ -179,10 +160,6 @@ jobs:
179160
name: test-selective-build-linux
180161
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
181162
strategy:
182-
matrix:
183-
include:
184-
- build-tool: buck2
185-
- build-tool: cmake
186163
fail-fast: false
187164
with:
188165
runner: linux.2xlarge
@@ -195,7 +172,7 @@ jobs:
195172
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
196173
conda activate "${CONDA_ENV}"
197174
198-
BUILD_TOOL=${{ matrix.build-tool }}
175+
BUILD_TOOL="cmake"
199176
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
200177
# Test selective build
201178
PYTHON_EXECUTABLE=python bash examples/selective_build/test_selective_build.sh "${BUILD_TOOL}"
@@ -235,9 +212,6 @@ jobs:
235212
name: test-quantized-aot-lib-linux
236213
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
237214
strategy:
238-
matrix:
239-
include:
240-
- build-tool: cmake
241215
fail-fast: false
242216
with:
243217
runner: linux.2xlarge
@@ -250,17 +224,14 @@ jobs:
250224
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
251225
conda activate "${CONDA_ENV}"
252226
253-
BUILD_TOOL=${{ matrix.build-tool }}
227+
BUILD_TOOL="cmake"
254228
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
255229
PYTHON_EXECUTABLE=python bash examples/xnnpack/quantization/test_quantize.sh "${BUILD_TOOL}" mv2
256230
257231
test-pybind-build-linux:
258232
name: test-pybind-build-linux
259233
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
260234
strategy:
261-
matrix:
262-
include:
263-
- build-tool: cmake
264235
fail-fast: false
265236
with:
266237
runner: linux.2xlarge
@@ -274,7 +245,7 @@ jobs:
274245
conda activate "${CONDA_ENV}"
275246
276247
# build module for executorch.extension.pybindings.portable_lib
277-
BUILD_TOOL=${{ matrix.build-tool }}
248+
BUILD_TOOL="cmake"
278249
PYTHON_EXECUTABLE=python \
279250
EXECUTORCH_BUILD_XNNPACK=ON \
280251
EXECUTORCH_BUILD_PYBIND=ON \
@@ -347,17 +318,16 @@ jobs:
347318
exit 1
348319
fi
349320
321+
android:
322+
uses: ./.github/workflows/_android.yml
323+
350324
unittest:
351325
uses: ./.github/workflows/_unittest.yml
352326
with:
353327
docker-image: executorch-ubuntu-22.04-clang12
354328

355329
unittest-arm:
356330
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
357-
strategy:
358-
matrix:
359-
include:
360-
- build-tool: buck2
361331
with:
362332
runner: linux.2xlarge
363333
docker-image: executorch-ubuntu-22.04-arm-sdk
@@ -371,7 +341,7 @@ jobs:
371341
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
372342
conda activate "${CONDA_ENV}"
373343
374-
BUILD_TOOL=${{ matrix.build-tool }}
344+
BUILD_TOOL="cmake"
375345
376346
# Setup MacOS dependencies as there is no Docker support on MacOS atm
377347
PYTHON_EXECUTABLE=python \
@@ -393,7 +363,6 @@ jobs:
393363
strategy:
394364
matrix:
395365
dtype: [fp32]
396-
build-tool: [cmake]
397366
mode: [qnn]
398367
fail-fast: false
399368
with:
@@ -408,14 +377,14 @@ jobs:
408377
conda activate "${CONDA_ENV}"
409378
410379
DTYPE=${{ matrix.dtype }}
411-
BUILD_TOOL=${{ matrix.build-tool }}
380+
BUILD_TOOL="cmake"
412381
MODE=${{ matrix.mode }}
413382
414383
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
415384
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
416385
417386
# Setup executorch
418-
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh buck2
387+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
419388
# Install requirements for export_llama
420389
PYTHON_EXECUTABLE=python bash examples/models/llama/install_requirements.sh
421390
# Test llama2

.github/workflows/update-viablestrict.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
repository: pytorch/executorch
2222
stable-branch: viable/strict
23-
requires: '[\"pull\", \"lint\", \"trunk\", \"Build documentation\", \"^Android$\", \"^Apple$\"]'
23+
requires: '[\"pull\", \"lint\", \"trunk\", \"Build documentation\", \"^Apple$\"]'
2424
secret-bot-token: ${{ secrets.UPDATEBOT_TOKEN }}
2525
clickhouse-url: ${{ secrets.CLICKHOUSE_URL }}
2626
clickhouse-username: ${{ secrets.CLICKHOUSE_VIABLESTRICT_USERNAME }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Check out the [Getting Started](https://pytorch.org/executorch/stable/getting-st
2525
Check out the examples of [Llama](./examples/models/llama/README.md), [Llava](./examples/models/llava/README.md) and [other models](./examples/README.md) running on edge devices using ExecuTorch.
2626

2727

28-
**[UPDATE - 09/25]** We have added support for running [Llama 3.2 1B/3B](./examples/models/llama/README.md) models via ExecuTorch.
28+
**[UPDATE - 10/24]** We have added support for running [Llama 3.2 Quantized 1B/3B](./examples/models/llama/README.md) models via ExecuTorch.
2929

3030
## Feedback
3131

@@ -92,7 +92,7 @@ tools.
9292
├── runtime # Core C++ runtime.
9393
| ├── backend # Backend delegate runtime APIs.
9494
| ├── core # Core structures used across all levels of the runtime.
95-
| ├── executor # Model loading, initalization, and execution.
95+
| ├── executor # Model loading, initialization, and execution.
9696
| ├── kernel # Kernel registration and management.
9797
| ├── platform # Layer between architecture specific code and portable C++.
9898
├── schema # ExecuTorch PTE file format flatbuffer

0 commit comments

Comments
 (0)