Skip to content

Commit eb186b6

Browse files
author
Github Executorch
committed
Update on "stop double-installing ExecuTorch in one-off linux jobs"
setup-linux.sh already installs ExecuTorch with XNNPACK (and it passes use-pt-pinned-commit as it should). Differential Revision: [D67996460](https://our.internmc.facebook.com/intern/diff/D67996460/) [ghstack-poisoned]
2 parents a854f7f + 1319d82 commit eb186b6

Some content is hidden

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

54 files changed

+2687
-412
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2ea4b56ec872424e486c4fe2d55da061067a2ed3
1+
0a94bb432ed75cc2d950d81b2921363218a7e459

.github/workflows/apple-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ jobs:
410410
runs-on: linux.2xlarge
411411
steps:
412412
- name: Download the apps from GitHub
413-
uses: actions/download-artifact@v3
413+
uses: actions/download-artifact@v4
414414
with:
415415
# The name here needs to match the name of the upload-artifact parameter
416416
name: ios-apps

.github/workflows/apple.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
5454
timeout: 90
5555
secrets-env: BUILD_CERTIFICATE_BASE64 EXECUTORCH_DEMO_BUILD_PROVISION_PROFILE_BASE64 KEYCHAIN_PASSWORD
56-
upload-artifact: ios-apps
56+
upload-artifact: ios-demo-app
5757
script: |
5858
set -eux
5959
@@ -83,10 +83,10 @@ jobs:
8383
runs-on: linux.2xlarge
8484
steps:
8585
- name: Download the artifacts from GitHub
86-
uses: actions/download-artifact@v3
86+
uses: actions/download-artifact@v4
8787
with:
8888
# The name here needs to match the name of the upload-artifact parameter
89-
name: ios-apps
89+
name: ios-demo-app
9090
path: ${{ runner.temp }}/artifacts/
9191

9292
- name: Verify the artifacts
@@ -216,7 +216,7 @@ jobs:
216216
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-ios
217217
aws-region: us-east-1
218218
- name: Download the artifact
219-
uses: actions/download-artifact@v3
219+
uses: actions/download-artifact@v4
220220
with:
221221
# NB: The name here needs to match the upload-artifact name from build-frameworks-ios job
222222
name: executorch-frameworks-ios
@@ -291,7 +291,7 @@ jobs:
291291
python-version: '3.11'
292292
submodules: 'true'
293293
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
294-
upload-artifact: ios-apps
294+
upload-artifact: ios-benchmark-app
295295
secrets-env: BUILD_CERTIFICATE_BASE64 EXECUTORCH_BENCHMARK_BUILD_PROVISION_PROFILE_BASE64 KEYCHAIN_PASSWORD
296296
timeout: 90
297297
script: |

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
url = https://github.com/pybind/pybind11.git
6767
[submodule "backends/cadence/fusion_g3/third-party/nnlib/nnlib-FusionG3"]
6868
path = backends/cadence/fusion_g3/third-party/nnlib/nnlib-FusionG3
69-
url = https://github.com/foss-xtensa/nnlib-FusionG3/
69+
url = https://github.com/foss-xtensa/nnlib-FusionG3.git
7070
[submodule "third-party/ao"]
7171
path = third-party/ao
7272
url = https://github.com/pytorch/ao.git

backends/apple/mps/mps_preprocess.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
CompileSpec,
3333
PreprocessResult,
3434
)
35+
36+
from executorch.exir.passes.memory_format_ops_pass import DimOrderOpsRevertPass
37+
from executorch.exir.program._program import _transform
3538
from torch.export.exported_program import ExportedProgram
3639

3740
FORMAT = "[%(levelname)s %(asctime)s %(filename)s:%(lineno)s] %(message)s"
@@ -83,6 +86,9 @@ def preprocess(
8386
# FlatBuffer graph, process the `output` nodes and add their id to
8487
# the `output_ids` array in the schema.
8588

89+
# TODO: Remove this once we have a better support for the dim-order ops.
90+
edge_program = _transform(edge_program, DimOrderOpsRevertPass())
91+
8692
mps_graph = MPSGraph(
8793
version="0",
8894
mps_nodes=[],

backends/apple/mps/operators/constant_ops.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,25 @@ def define_node(
7979
)
8080

8181

82+
@register_node_visitor
83+
class ToDimOrderEmptyVisitor(NodeVisitor):
84+
target = ["dim_order_ops._empty_dim_order.default"]
85+
86+
def __init__(self, *args) -> None:
87+
super().__init__(*args)
88+
89+
def define_node(
90+
self,
91+
node: torch.fx.Node,
92+
mps_graph: MPSGraph,
93+
) -> None:
94+
# We should never get here, because DimOrderOpsRevertPass replaces this with an aten.empty.memory_format op
95+
# But if we do, we can't handle it ATM, so raise an exception
96+
raise NotImplementedError(
97+
"dim_order_ops._empty_dim_order.default is not supported yet"
98+
)
99+
100+
82101
@register_node_visitor
83102
class FullLikeVisitor(NodeVisitor):
84103
target = "aten.full_like.default"

backends/apple/mps/operators/op_clone.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,22 @@ def define_node(
3333
)
3434
input_id = self.define_tensor(get_input_node(node, 0), mps_graph)
3535
self.tensor_to_id[node] = input_id
36+
37+
38+
@register_node_visitor
39+
class ToDimOrderCopyVisitor(NodeVisitor):
40+
target = ["dim_order_ops._to_dim_order_copy.default"]
41+
42+
def __init__(self, *args) -> None:
43+
super().__init__(*args)
44+
45+
def define_node(
46+
self,
47+
node: torch.fx.Node,
48+
mps_graph: MPSGraph,
49+
) -> None:
50+
# We should never get here, because DimOrderOpsRevertPass replaces this with an aten._to_copy op
51+
# But if we do, we can't handle it ATM, so raise an exception
52+
raise NotImplementedError(
53+
"dim_order_ops._to_dim_order_copy.default is not supported yet"
54+
)

backends/apple/mps/test/test_mps.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,21 @@ def forward(self, x):
18291829
Clone(), model_inputs, func_name=inspect.stack()[0].function[5:]
18301830
)
18311831

1832+
def test_mps_backend_to_copy(self):
1833+
class Copy(torch.nn.Module):
1834+
def forward(self, x):
1835+
return (
1836+
torch.ops.aten._to_copy.default(
1837+
x + 2, memory_format=torch.contiguous_format
1838+
)
1839+
+ x
1840+
)
1841+
1842+
model_inputs = (torch.randn(1, 3, 3),)
1843+
self.lower_and_test_with_partitioner(
1844+
Copy(), model_inputs, func_name=inspect.stack()[0].function[5:]
1845+
)
1846+
18321847
def test_mps_backend_floor(self):
18331848
class Floor(torch.nn.Module):
18341849
def forward(self, x):

backends/apple/mps/test/test_mps_utils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626

2727
# Config for Capturing the weights, will be moved in the future
2828

29-
# TODO(T182928844): Delegate dim order op to backend.
30-
_EDGE_COMPILE_CONFIG = exir.EdgeCompileConfig(
31-
_check_ir_validity=False, _skip_dim_order=True
32-
)
29+
_EDGE_COMPILE_CONFIG = exir.EdgeCompileConfig(_check_ir_validity=False)
3330

3431

3532
class ansi_colors:
@@ -219,7 +216,6 @@ def lower_module_and_test_output(
219216
dynamic_shapes=dynamic_shapes,
220217
edge_compile_config=EdgeCompileConfig(
221218
_check_ir_validity=False,
222-
_skip_dim_order=True, # TODO(T182928844): Delegate dim order op to backend.
223219
),
224220
)
225221

@@ -250,7 +246,6 @@ def lower_module_and_test_output(
250246
export(delegated_program, sample_inputs, strict=True),
251247
compile_config=exir.EdgeCompileConfig(
252248
_check_ir_validity=False,
253-
_skip_dim_order=True, # TODO(T182928844): Delegate dim order op to backend.
254249
),
255250
).to_executorch(
256251
config=ExecutorchBackendConfig(extract_delegate_segments=False)

backends/arm/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,28 @@ The you can run the tests with
122122
pytest -c /dev/null -v -n auto backends/arm/test --arm_quantize_io --arm_run_corstoneFVP
123123
```
124124

125+
### Code coverage
126+
127+
To get code coverage:
128+
129+
```
130+
coverage run --source=<SRC> --rcfile=backends/arm/test/.coveragerc -m pytest \
131+
--config-file=/dev/null backends/arm/test/
132+
```
133+
134+
All files in `SRC` and its child directories will be analysed for code coverage,
135+
unless explicitly exluded in the .coveragerc file. If using venv this might be
136+
under `env/lib/python<VERSION_NUMBER>/site-packages/executorch/`. To get the
137+
absolute path, run:
138+
139+
```
140+
python -c "import executorch; print(executorch.__path__)"
141+
```
142+
143+
This contains a list of paths where the source directory is located. Pick the
144+
one that is located in `env/lib`. If that does not work try the others. Add
145+
`backends/arm` to the path in `--source` to only get code coverage for the Arm
146+
backend.
125147

126148
### A note on unit tests
127149

0 commit comments

Comments
 (0)