Skip to content

Commit bebf8c5

Browse files
Update base for Update on "[ExecuTorch][#10375] Add extension.BundledModule to Wrap extension.Module with Bundled Program Logic"
#10375 # Context This issue is a step of #9638. In #9638, we want to have `extension.Module` as the single source of implementation in `pybindings`, which means that `pybindings.PyModule` should use `extension.Module` rather than its own `pybindings.Module`. The issue is that `pybindings.PyModule` is dependent on the `method` getter from `pybindings.Module`, which `extension.Module` do not have. Since we don't want to expose `method` getter in `extension.Module`, we have to protect the getter, wrap the functions that is dependent on it and use the protected getter there, ultimately decouple `pybindings` from a `method` getter. # Proposal Now that we have a protected `method` getter, we can introduce a `extension.BundledModule`, a child class inheriting `extension.Module` which wraps up bundled program logic that is dependent on the `method` getter. Differential Revision: [D73564125](https://our.internmc.facebook.com/intern/diff/D73564125/) [ghstack-poisoned]
2 parents 080a6ff + 0165a02 commit bebf8c5

File tree

66 files changed

+1079
-606
lines changed

Some content is hidden

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

66 files changed

+1079
-606
lines changed

.ci/scripts/gather_benchmark_configs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"apple_iphone_15": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/3b5acd2e-92e2-4778-b651-7726bafe129d",
2222
"apple_iphone_15+ios_18": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/12c8b15c-8d03-4e07-950d-0a627e7595b4",
2323
"samsung_galaxy_s22": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa",
24+
"samsung_galaxy_s22_private": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/ea6b049d-1508-4233-9a56-5d9eacbe1078",
2425
"samsung_galaxy_s24": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98f8788c-2e25-4a3c-8bb2-0d1e8897c0db",
2526
"google_pixel_8_pro": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d65096ab-900b-4521-be8b-a3619b69236a",
2627
"google_pixel_3_private_rooted": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98d23ca8-ea9e-4fb7-b725-d402017b198d",

.github/scripts/extract_benchmark_results.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ def transform(
349349
# Overwrite the device name here with the job name as it has more information about
350350
# the device, i.e. Samsung Galaxy S22 5G instead of just Samsung
351351
for r in benchmark_results:
352-
r["deviceInfo"]["device"] = job_name
352+
is_private_device = job_report.get("is_private_instance", False)
353+
r["deviceInfo"]["device"] = (
354+
f"{job_name} (private)" if is_private_device else job_name
355+
)
353356

354357
# From https://github.com/pytorch/pytorch/wiki/How-to-integrate-with-PyTorch-OSS-benchmark-database
355358
return [
@@ -363,6 +366,7 @@ def transform(
363366
"benchmark_config": json.dumps(benchmark_config),
364367
"job_conclusion": "SUCCESS",
365368
"job_arn": job_report.get("arn", ""),
369+
"instance_arn": job_report.get("instance_arn", ""),
366370
},
367371
},
368372
"model": {

.github/workflows/android-perf-private-device-experiment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
description: Target devices to run benchmark
2424
required: false
2525
type: string
26-
default: google_pixel_3_private_rooted
26+
default: samsung_galaxy_s22_private
2727
benchmark_configs:
2828
description: The list of configs used the benchmark
2929
required: false
@@ -39,7 +39,7 @@ on:
3939
description: Target devices to run benchmark
4040
required: false
4141
type: string
42-
default: google_pixel_3_private_rooted
42+
default: samsung_galaxy_s22_private
4343
benchmark_configs:
4444
description: The list of configs used the benchmark
4545
required: false
@@ -58,5 +58,5 @@ jobs:
5858
contents: read
5959
with:
6060
models: ${{ inputs.models || 'mv3,meta-llama/Llama-3.2-1B-Instruct-SpinQuant_INT4_EO8,meta-llama/Llama-3.2-1B-Instruct-QLORA_INT4_EO8' }}
61-
devices: google_pixel_3_private_rooted
61+
devices: samsung_galaxy_s22_private
6262
benchmark_configs: ${{ inputs.benchmark_configs }}

.github/workflows/apple-perf-private-device-experiment.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
name: apple-perf (private devices)
22

33
on:
4-
# TODO (huydhn): Disable the schedule run until we land the change to add device pool and device name
5-
# to separate between public and private iOS devices
6-
# schedule:
7-
# - cron: 0 0,4,8,12,16,20 * * *
4+
schedule:
5+
- cron: 0 0,4,8,12,16,20 * * *
86
pull_request:
97
paths:
108
- .github/workflows/apple-perf-private-device-experiment.yml
11-
# push:
12-
# branches:
13-
# - main
14-
# paths:
15-
# - .github/workflows/apple-perf-private-device-experiment.yml
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- .github/workflows/apple-perf-private-device-experiment.yml
1614
# Note: GitHub has an upper limit of 10 inputs
1715
workflow_dispatch:
1816
inputs:

.github/workflows/doc-build.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@ on:
1414
- cron: '0 0 * * *'
1515

1616
jobs:
17-
check-urls:
18-
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/checkout@v3
21-
- name: Check URLs
22-
run: bash ./scripts/check_urls.sh
23-
24-
check-xrefs:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v3
28-
- name: Check Links
29-
run: bash ./scripts/check_xrefs.sh
30-
3117
build:
3218
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
3319
permissions:

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,30 @@ jobs:
6464
6565
exit $RC
6666
67+
lint-urls:
68+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
69+
with:
70+
runner: linux.2xlarge
71+
docker-image: executorch-ubuntu-22.04-linter
72+
submodules: 'none'
73+
fetch-depth: 0
74+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
75+
timeout: 90
76+
script: |
77+
./scripts/lint_urls.sh
78+
79+
lint-xrefs:
80+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
81+
with:
82+
runner: linux.2xlarge
83+
docker-image: executorch-ubuntu-22.04-linter
84+
submodules: 'none'
85+
fetch-depth: 0
86+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
87+
timeout: 90
88+
script: |
89+
./scripts/lint_xrefs.sh
90+
6791
android-java-format:
6892
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
6993
permissions:

.github/workflows/pull.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -481,37 +481,38 @@ jobs:
481481
build-tool: buck2
482482
docker-image: executorch-ubuntu-22.04-clang12
483483

484-
unittest-arm:
484+
unittest-arm-backend-with-no-fvp:
485+
name: unittest-arm-backend-with-no-fvp
485486
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
486487
permissions:
487488
id-token: write
488489
contents: read
490+
strategy:
491+
matrix:
492+
include:
493+
- test_arm_baremetal: test_pytest_ops
494+
- test_arm_baremetal: test_pytest_models
495+
fail-fast: false
489496
with:
490497
runner: linux.2xlarge
491498
docker-image: executorch-ubuntu-22.04-arm-sdk
492499
submodules: 'recursive'
493500
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
494501
timeout: 90
495502
script: |
496-
set -eux
497-
498503
# The generic Linux job chooses to use base env, not the one setup by the image
499504
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
500505
conda activate "${CONDA_ENV}"
501506
502-
BUILD_TOOL="cmake"
503-
504-
# Setup MacOS dependencies as there is no Docker support on MacOS atm
505-
PYTHON_EXECUTABLE=python \
506-
CMAKE_ARGS="-DEXECUTORCH_BUILD_PYBIND=ON" \
507-
EXECUTORCH_BUILD_ARM_BAREMETAL=ON \
508-
.ci/scripts/setup-linux.sh --build-tool "${BUILD_TOOL}"
507+
source .ci/scripts/utils.sh
508+
install_executorch "--use-pt-pinned-commit"
509509
510-
# Install Arm dependencies
511510
.ci/scripts/setup-arm-baremetal-tools.sh
512511
513-
# Run pytest without simulator
514-
backends/arm/test/test_arm_baremetal.sh test_pytest
512+
ARM_TEST=${{ matrix.test_arm_baremetal }}
513+
514+
# Test test_arm_baremetal.sh with test
515+
backends/arm/test/test_arm_baremetal.sh "${ARM_TEST}"
515516
516517
test-llama-runner-qnn-linux:
517518
name: test-llama-runner-qnn-linux

.github/workflows/trunk.yml

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,22 @@ jobs:
176176
# Test selective build
177177
PYTHON_EXECUTABLE=python bash examples/portable/scripts/test_demo_backend_delegation.sh "${BUILD_TOOL}"
178178
179-
test-arm-backend-delegation:
180-
name: test-arm-backend-delegation
179+
test-arm-backend:
180+
name: test-arm-backend
181181
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
182182
permissions:
183183
id-token: write
184184
contents: read
185+
strategy:
186+
matrix:
187+
include:
188+
- test_arm_baremetal: test_pytest_ops_ethosu_fvp
189+
- test_arm_baremetal: test_pytest_models_ethosu_fvp
190+
- test_arm_baremetal: test_run_ethosu_fvp
191+
- test_arm_baremetal: test_models_tosa
192+
- test_arm_baremetal: test_models_ethos-u55
193+
- test_arm_baremetal: test_models_ethos-u85
194+
fail-fast: false
185195
with:
186196
runner: linux.2xlarge.memory
187197
docker-image: executorch-ubuntu-22.04-arm-sdk
@@ -202,34 +212,10 @@ jobs:
202212
# Hopefully this is high enough for this setup.
203213
sudo sysctl fs.inotify.max_user_watches=1048576 # 1024 * 1024
204214
205-
# Test ethos-u delegate examples with run.sh
206-
backends/arm/test/test_arm_baremetal.sh test_full_ethosu_fvp
207-
208-
209-
test-arm-reference-delegation:
210-
name: test-arm-reference-delegation
211-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
212-
permissions:
213-
id-token: write
214-
contents: read
215-
with:
216-
runner: linux.2xlarge.memory
217-
docker-image: executorch-ubuntu-22.04-arm-sdk
218-
submodules: 'recursive'
219-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
220-
timeout: 90
221-
script: |
222-
# The generic Linux job chooses to use base env, not the one setup by the image
223-
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
224-
conda activate "${CONDA_ENV}"
225-
226-
source .ci/scripts/utils.sh
227-
install_executorch "--use-pt-pinned-commit"
228-
229-
.ci/scripts/setup-arm-baremetal-tools.sh
215+
ARM_TEST=${{ matrix.test_arm_baremetal }}
230216
231-
# Run arm unit tests using the simulator
232-
backends/arm/test/test_arm_baremetal.sh test_pytest_ethosu_fvp
217+
# Test test_arm_baremetal.sh with test
218+
backends/arm/test/test_arm_baremetal.sh "${ARM_TEST}"
233219
234220
test-arm-cortex-m-size-test:
235221
name: test-arm-cortex-m-size-test

.lintrunner.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exclude_patterns = [
1010
'exir/serde/**',
1111
]
1212
command = [
13-
'python',
13+
'python3',
1414
'-m',
1515
'lintrunner_adapters',
1616
'run',
@@ -19,7 +19,7 @@ command = [
1919
'@{{PATHSFILE}}'
2020
]
2121
init_command = [
22-
'python',
22+
'python3',
2323
'-m',
2424
'lintrunner_adapters',
2525
'run',
@@ -41,7 +41,7 @@ exclude_patterns = [
4141
'exir/serde/**',
4242
]
4343
command = [
44-
'python',
44+
'python3',
4545
'-m',
4646
'lintrunner_adapters',
4747
'run',
@@ -50,7 +50,7 @@ command = [
5050
'@{{PATHSFILE}}'
5151
]
5252
init_command = [
53-
'python',
53+
'python3',
5454
'-m',
5555
'lintrunner_adapters',
5656
'run',
@@ -83,7 +83,7 @@ exclude_patterns = [
8383
'runtime/core/portable_type/c10/**',
8484
]
8585
command = [
86-
'python',
86+
'python3',
8787
'-m',
8888
'lintrunner_adapters',
8989
'run',
@@ -94,7 +94,7 @@ command = [
9494
'@{{PATHSFILE}}'
9595
]
9696
init_command = [
97-
'python',
97+
'python3',
9898
'-m',
9999
'lintrunner_adapters',
100100
'run',
@@ -116,7 +116,7 @@ exclude_patterns = [
116116
'**/third-party/**',
117117
]
118118
command = [
119-
'python',
119+
'python3',
120120
'-m',
121121
'lintrunner_adapters',
122122
'run',
@@ -126,7 +126,7 @@ command = [
126126
'@{{PATHSFILE}}',
127127
]
128128
init_command = [
129-
'python',
129+
'python3',
130130
'-m',
131131
'lintrunner_adapters',
132132
'run',
@@ -150,7 +150,7 @@ exclude_patterns = [
150150
'**/third-party/**',
151151
]
152152
command = [
153-
'python',
153+
'python3',
154154
'-m',
155155
'lintrunner_adapters',
156156
'run',
@@ -191,7 +191,7 @@ exclude_patterns = [
191191
'extension/llm/custom_ops/spinquant/test/fast_hadamard_transform_special_unstrided_cpu.h',
192192
]
193193
command = [
194-
'python',
194+
'python3',
195195
'-m',
196196
'lintrunner_adapters',
197197
'run',
@@ -226,7 +226,7 @@ exclude_patterns = [
226226
'util/**',
227227
]
228228
command = [
229-
'python',
229+
'python3',
230230
'-m',
231231
'lintrunner_adapters',
232232
'run',
@@ -275,7 +275,7 @@ exclude_patterns = [
275275
'util/**',
276276
]
277277
command = [
278-
'python',
278+
'python3',
279279
'-m',
280280
'lintrunner_adapters',
281281
'run',
@@ -325,7 +325,7 @@ exclude_patterns = [
325325
'backends/arm/test/**',
326326
]
327327
command = [
328-
'python',
328+
'python3',
329329
'-m',
330330
'lintrunner_adapters',
331331
'run',
@@ -337,7 +337,7 @@ command = [
337337
'@{{PATHSFILE}}'
338338
]
339339
init_command = [
340-
'python',
340+
'python3',
341341
'-m',
342342
'lintrunner_adapters',
343343
'run',
@@ -356,7 +356,7 @@ exclude_patterns = [
356356
'.lintrunner.toml',
357357
]
358358
command = [
359-
'python',
359+
'python3',
360360
'-m',
361361
'lintrunner_adapters',
362362
'run',

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Key value propositions of ExecuTorch are:
4949
## Getting Started
5050
To get started you can:
5151

52-
- Visit the [Step by Step Tutorial](https://pytorch.org/executorch/main/index) to get things running locally and deploy a model to a device
53-
- Use this [Colab Notebook](https://pytorch.org/executorch/main/getting-started-setup#quick-setup-colab-jupyter-notebook-prototype) to start playing around right away
52+
- Visit the [Step by Step Tutorial](https://pytorch.org/executorch/stable/getting-started.html) to get things running locally and deploy a model to a device
53+
- Use this [Colab Notebook](https://colab.research.google.com/drive/1qpxrXC3YdJQzly3mRg-4ayYiOjC6rue3?usp=sharing) to start playing around right away
5454
- Jump straight into LLM use cases by following specific instructions for [Llama](examples/models/llama/README.md) and [Llava](examples/models/llava/README.md)
5555

5656
## Feedback and Engagement

0 commit comments

Comments
 (0)