Skip to content

Commit 9c1fe5b

Browse files
authored
Merge branch 'pytorch:main' into next
2 parents 40858e8 + aa2c569 commit 9c1fe5b

36 files changed

+532
-187
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:

.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

backends/arm/operators/op_avg_pool2d.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ def define_node(
8585
) -> None:
8686
import tosa_tools.v0_80.serializer.tosa_serializer as ts # type: ignore
8787

88-
input_tensor = inputs[0]
89-
assert input_tensor.dtype == ts.DType.INT8
88+
supported_dtypes = [ts.DType.INT8]
89+
if inputs[0].dtype not in supported_dtypes:
90+
raise TypeError(
91+
f"IO data type needs to be one of {supported_dtypes}, got "
92+
f'"{inputs[0].dtype}"'
93+
)
9094

9195
accumulator_type = ts.DType.INT32
9296

@@ -118,9 +122,12 @@ def define_node(
118122
) -> None:
119123
import tosa_tools.v0_80.serializer.tosa_serializer as ts # type: ignore
120124

121-
assert (
122-
inputs[0].dtype == ts.DType.INT8 or inputs[0].dtype == ts.DType.FP32
123-
), "Only FP32 and INT8 supported"
125+
supported_dtypes = [ts.DType.INT8, ts.DType.FP32]
126+
if inputs[0].dtype not in supported_dtypes:
127+
raise TypeError(
128+
f"IO data type needs to be one of {supported_dtypes}, got "
129+
f'"{inputs[0].dtype}"'
130+
)
124131

125132
if inputs[0].dtype == ts.DType.INT8:
126133
super().define_node(node, tosa_graph, inputs, output)
@@ -205,8 +212,12 @@ def define_node(
205212
) -> None:
206213
import serializer.tosa_serializer as ts # type: ignore
207214

208-
input_tensor = inputs[0]
209-
assert input_tensor.dtype == ts.DType.INT8
215+
supported_dtypes = [ts.DType.INT8]
216+
if inputs[0].dtype not in supported_dtypes:
217+
raise TypeError(
218+
f"IO data type needs to be one of {supported_dtypes}, got "
219+
f'"{inputs[0].dtype}"'
220+
)
210221

211222
accumulator_type = ts.DType.INT32
212223

@@ -241,9 +252,12 @@ def define_node(
241252
) -> None:
242253
import serializer.tosa_serializer as ts # type: ignore
243254

244-
assert (
245-
inputs[0].dtype == ts.DType.INT8 or inputs[0].dtype == ts.DType.FP32
246-
), "Only FP32 and INT8 supported"
255+
supported_dtypes = [ts.DType.INT8, ts.DType.FP32]
256+
if inputs[0].dtype not in supported_dtypes:
257+
raise TypeError(
258+
f"IO data type needs to be one of {supported_dtypes}, got "
259+
f'"{inputs[0].dtype}"'
260+
)
247261

248262
if inputs[0].dtype == ts.DType.INT8:
249263
super().define_node(node, tosa_graph, inputs, output)

backends/cadence/aot/tests/test_fusion_ops_passes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ def forward(self, x):
328328
model = M()
329329
graph_module = export_to_edge(model, (inputs,)).exported_program().graph_module
330330
graph_module = FuseQuantDequantToRequantizePass()(graph_module).graph_module
331-
graph_module.print_readable()
332331

333332
self.check_op_counts(
334333
graph_module,

backends/cadence/aot/tests/test_memory_passes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,6 @@ def forward(self, x) -> torch.Tensor:
711711
.exported_program()
712712
.graph_module
713713
)
714-
graph_module.print_readable()
715714
self.assertEqual(count_node(graph_module, torch.ops.aten._cat_nop.out), 1)
716715
self.assertEqual(
717716
count_node(graph_module, torch.ops.aten._slice_copy_nop.Tensor_out), 0
@@ -741,7 +740,6 @@ def forward(self, x) -> torch.Tensor:
741740
.exported_program()
742741
.graph_module
743742
)
744-
graph_module.print_readable()
745743
self.assertEqual(count_node(graph_module, torch.ops.aten._cat_nop.out), 2)
746744
self.assertEqual(count_node(graph_module, torch.ops.aten.cat.out), 0)
747745
self.verify_nop_memory_alloc(graph_module)

backends/cadence/aot/tests/test_remove_ops_passes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def forward(self, t: torch.Tensor):
100100
p = RemoveNopAddOpPass()
101101

102102
graph_after_passes = cast(PassResult, p(graph_module)).graph_module
103-
graph_module.print_readable()
104103
self.assertEqual(
105104
count_node(graph_after_passes, exir_ops.edge.aten.add.Tensor),
106105
0,
@@ -140,7 +139,6 @@ def forward(self, t: torch.Tensor):
140139
p = RemoveNopMulOpPass()
141140

142141
graph_after_passes = cast(PassResult, p(graph_module)).graph_module
143-
graph_module.print_readable()
144142
self.assertEqual(
145143
count_node(graph_after_passes, exir_ops.edge.aten.mul.Tensor),
146144
0,

0 commit comments

Comments
 (0)