Skip to content

Commit 4488e8a

Browse files
committed
Merge branch 'main' of https://github.com/pytorch/executorch into change-1024712
2 parents ee588d7 + 9663990 commit 4488e8a

File tree

205 files changed

+5951
-1432
lines changed

Some content is hidden

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

205 files changed

+5951
-1432
lines changed

.ci/scripts/check_c10_sync.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -eux
9+
ls pytorch/.git || git clone https://github.com/pytorch/pytorch.git
10+
pytorch_pin="$(< .ci/docker/ci_commit_pins/pytorch.txt)"
11+
pushd pytorch
12+
git checkout "$pytorch_pin"
13+
popd
14+
"$(dirname "${BASH_SOURCE[0]}")"/compare_dirs.sh runtime/core/portable_type/c10/c10 pytorch/c10

.ci/scripts/compare_dirs.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -eux
9+
10+
# Check if dir1's files are also found in dir2 with the same
11+
# contents. Exempt files named BUCK, CMakeLists.txt, TARGETS, or
12+
# targets.bzl.
13+
14+
if [ $# -ne 2 ]; then
15+
echo "Usage: $0 dir1 dir2" >&2
16+
exit 1
17+
fi
18+
dir1="$1"
19+
dir2="$2"
20+
21+
if [ ! -d "$dir1" ] || [ ! -d "$dir2" ]; then
22+
echo "Error: Both directories must exist" >&2
23+
exit 1
24+
fi
25+
26+
exit_status=0
27+
while IFS= read -r -d '' file; do
28+
base=$(basename "$file")
29+
case "$base" in
30+
"BUCK"|"CMakeLists.txt"|"TARGETS"|"targets.bzl")
31+
continue
32+
;;
33+
esac
34+
# Construct the corresponding path in the second directory
35+
file2="$dir2/${file#$dir1/}"
36+
# Check if the corresponding file exists in the second directory
37+
if [ ! -f "$file2" ]; then
38+
echo "Error: File '$file' found in '$dir1' but not found in '$dir2'" >&2
39+
exit 1
40+
fi
41+
# Compare the contents of the two files using diff
42+
set +ex
43+
differences=$(diff -u -p "$file" "$file2")
44+
set -e # leave x off
45+
# If there are any differences, print an error message and exit with failure status
46+
if [ -n "$differences" ]; then
47+
echo "Error: Mismatch detected in file '$file':" >&2
48+
echo "$differences" >&2
49+
exit_status=1
50+
fi
51+
set -x
52+
done < <(find "$dir1" -type f -print0)
53+
54+
exit $exit_status

.ci/scripts/test_ios_ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
set -e
99

10-
APP_PATH="executorch-examples/apple/ExecuTorchDemo/ExecuTorchDemo"
10+
APP_PATH="executorch-examples/mv3/apple/ExecuTorchDemo/ExecuTorchDemo"
1111
MODEL_NAME="mv3"
1212
SIMULATOR_NAME="executorch"
1313

.github/scripts/extract_benchmark_results.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ def transform(
341341
benchmark_results: List,
342342
benchmark_config: Dict[str, str],
343343
job_name: str,
344+
job_report: Any = {},
344345
) -> List:
345346
"""
346347
Transform the benchmark results into the format writable into the benchmark database
@@ -361,6 +362,7 @@ def transform(
361362
# Just keep a copy of the benchmark config here
362363
"benchmark_config": json.dumps(benchmark_config),
363364
"job_conclusion": "SUCCESS",
365+
"job_arn": job_report.get("arn", ""),
364366
},
365367
},
366368
"model": {
@@ -446,6 +448,7 @@ def transform_failure_record(
446448
"app_type": app_type,
447449
"job_conclusion": result,
448450
"failure_type": level,
451+
"job_arn": report.get("arn", ""),
449452
"job_report": json.dumps(report),
450453
},
451454
},
@@ -512,6 +515,7 @@ def get_benchmark_config(
512515
def extract_benchmark_result_from_artifact(
513516
artifact: Dict[str, Any],
514517
benchmark_config: Dict[str, str],
518+
job_report: Any,
515519
) -> List[Any]:
516520
job_name = artifact.get("job_name", "")
517521
artifact_type = artifact.get("type", "")
@@ -532,7 +536,9 @@ def extract_benchmark_result_from_artifact(
532536
)
533537
if not benchmark_results:
534538
return []
535-
return transform(app_type, benchmark_results, benchmark_config, job_name)
539+
return transform(
540+
app_type, benchmark_results, benchmark_config, job_name, job_report
541+
)
536542

537543

538544
def get_app_type(type: str):
@@ -674,7 +680,7 @@ def process_benchmark_results(content: Any, app: str, benchmark_configs: str):
674680
for job_artifact in job_artifacts:
675681
# generate result for each schema
676682
results = extract_benchmark_result_from_artifact(
677-
job_artifact, benchmark_config
683+
job_artifact, benchmark_config, job_report
678684
)
679685
all_benchmark_results.extend(results)
680686
return all_benchmark_results

.github/workflows/_unittest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
runner: linux.2xlarge
3535
docker-image: ${{ inputs.docker-image }}
36-
submodules: 'true'
36+
submodules: 'recursive'
3737
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
3838
timeout: 90
3939
script: |
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
runner: macos-m1-stable
4747
python-version: '3.11'
48-
submodules: 'true'
48+
submodules: 'recursive'
4949
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
5050
script: |
5151
set -eux

.github/workflows/android-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
with:
168168
runner: linux.2xlarge.memory
169169
docker-image: executorch-ubuntu-22.04-qnn-sdk
170-
submodules: 'true'
170+
submodules: 'recursive'
171171
timeout: 60
172172
upload-artifact: android-models
173173
upload-artifact-to-s3: true

.github/workflows/apple-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
# NB: Need to use our AWS MacOS runner to upload large models to S3
168168
runner: macos-m1-stable
169169
python-version: '3.11'
170-
submodules: 'true'
170+
submodules: 'recursive'
171171
timeout: 60
172172
upload-artifact: ios-models
173173
upload-artifact-to-s3: true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: check-c10-sync
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .ci/docker/ci_commit_pins/pytorch.txt
7+
- .ci/scripts/compare_dirs.sh
8+
- runtime/core/portable_type/c10/**
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
check-c10-sync:
16+
permissions:
17+
id-token: write
18+
contents: read
19+
name: check-c10-sync
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
- name: Clone PyTorch
26+
run: |
27+
.ci/scripts/check_c10_sync.sh

.github/workflows/doc-build.yml

Lines changed: 1 addition & 15 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:
@@ -41,7 +27,7 @@ jobs:
4127
job-name: Build doc
4228
runner: linux.2xlarge
4329
docker-image: executorch-ubuntu-22.04-clang12-android
44-
submodules: 'true'
30+
submodules: 'recursive'
4531
repository: pytorch/executorch
4632
upload-artifact: docs
4733
timeout: 90

.github/workflows/lint.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
runner: linux.2xlarge
2525
docker-image: executorch-ubuntu-22.04-linter
26-
submodules: 'true'
26+
submodules: 'recursive'
2727
fetch-depth: 0
2828
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
2929
timeout: 90
@@ -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:

0 commit comments

Comments
 (0)