-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024-11-18 nightly release (8526d0a)
- Loading branch information
pytorchbot
committed
Nov 18, 2024
1 parent
c6936ba
commit 7059b27
Showing
99 changed files
with
828,437 additions
and
1,132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,16 +20,28 @@ on: | |
- extension/benchmark/apple/** | ||
- extension/module/** | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 10 * * *' # Runs daily at 2 AM PST | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
set-version: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
version: ${{ steps.set_version.outputs.version }} | ||
steps: | ||
- name: Set VERSION variable | ||
id: set_version | ||
shell: bash | ||
run: | | ||
VERSION="0.4.0.$(TZ='PST8PDT' date +%Y%m%d)" | ||
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
build-demo-ios: | ||
name: build-demo-ios | ||
# NB: Don't run this on fork PRs because they won't have access to the secret and would fail anyway | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main | ||
secrets: inherit | ||
with: | ||
|
@@ -41,6 +53,8 @@ jobs: | |
secrets-env: BUILD_CERTIFICATE_BASE64 EXECUTORCH_DEMO_BUILD_PROVISION_PROFILE_BASE64 KEYCHAIN_PASSWORD | ||
upload-artifact: ios-apps | ||
script: | | ||
set -eux | ||
BUILD_TOOL=cmake | ||
.ci/scripts/setup-conda.sh | ||
|
@@ -59,7 +73,7 @@ jobs: | |
# Build and test iOS Demo App | ||
PYTHON_EXECUTABLE=python ${CONDA_RUN} --no-capture-output \ | ||
build/test_ios_ci.sh ${ARTIFACTS_DIR_NAME} | ||
build/test_ios_ci.sh "${ARTIFACTS_DIR_NAME}" | ||
# Upload the test demo app to S3 | ||
upload-demo-ios: | ||
|
@@ -77,6 +91,7 @@ jobs: | |
shell: bash | ||
working-directory: ${{ runner.temp }}/artifacts/ | ||
run: | | ||
set -eux | ||
ls -lah ./ | ||
- name: Upload the artifacts to S3 | ||
|
@@ -114,6 +129,7 @@ jobs: | |
|
||
build-frameworks-ios: | ||
name: build-frameworks-ios | ||
needs: set-version | ||
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main | ||
with: | ||
runner: macos-latest-xlarge | ||
|
@@ -123,8 +139,10 @@ jobs: | |
upload-artifact: executorch-frameworks-ios | ||
timeout: 90 | ||
script: | | ||
set -eux | ||
BUILD_TOOL=cmake | ||
VERSION="latest" | ||
VERSION="${{ needs.set-version.outputs.version }}" | ||
FRAMEWORKS=( | ||
"executorch" | ||
"backend_coreml" | ||
|
@@ -173,13 +191,17 @@ jobs: | |
upload-frameworks-ios: | ||
runs-on: ubuntu-22.04 | ||
needs: build-frameworks-ios | ||
needs: [build-frameworks-ios, set-version] | ||
timeout-minutes: 30 | ||
environment: ${{ github.ref == 'refs/heads/main' && 'cherry-pick-bot' || '' }} | ||
permissions: | ||
id-token: write | ||
contents: read | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_PYTORCHBOT_CHERRY_PICK_TOKEN || secrets.GITHUB_TOKEN }} | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
@@ -196,15 +218,15 @@ jobs: | |
name: executorch-frameworks-ios | ||
path: ${{ runner.temp }}/frameworks-ios/ | ||
- name: Only push to S3 when running the workflow manually from main branch | ||
if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }} | ||
if: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }} | ||
shell: bash | ||
run: | | ||
set -eux | ||
echo "UPLOAD_ON_MAIN=1" >> "${GITHUB_ENV}" | ||
- name: Upload the artifact to ossci-ios S3 bucket | ||
shell: bash | ||
run: | | ||
set -eux | ||
VERSION="${{ needs.set-version.outputs.version }}" | ||
pip install awscli==1.32.18 | ||
|
@@ -215,14 +237,47 @@ jobs: | |
for FILENAME in "${RUNNER_TEMP}"/frameworks-ios/*.zip; do | ||
[ -e "${FILENAME}" ] || continue | ||
shasum -a 256 "${FILENAME}" | ||
FRAMEWORK_NAME=$(basename "${FILENAME}" | sed "s/-${VERSION}.zip//") | ||
CHECKSUM=$(shasum -a 256 "${FILENAME}" | cut -d ' ' -f1) | ||
echo "${FRAMEWORK_NAME} ${CHECKSUM}" >> "${RUNNER_TEMP}/checksums.txt" | ||
${AWS_CMD} "${FILENAME}" s3://ossci-ios/executorch/ --acl public-read | ||
done | ||
- name: Update SwiftPM | ||
shell: bash | ||
run: | | ||
set -eux | ||
VERSION="${{ needs.set-version.outputs.version }}" | ||
BRANCH="swiftpm-${VERSION}" | ||
git checkout swiftpm | ||
if git show-ref --verify --quiet refs/heads/${BRANCH}; then | ||
git checkout "${BRANCH}" | ||
else | ||
git checkout -b "${BRANCH}" | ||
fi | ||
[[ -f Package.swift ]] || mv Package.swift.template Package.swift | ||
sed -i "s/__VERSION__/${VERSION}/g" Package.swift | ||
while read -r FRAMEWORK CHECKSUM; do | ||
sed -i "s/__SHA256_${FRAMEWORK}__/${CHECKSUM}/g" Package.swift | ||
done < "${RUNNER_TEMP}/checksums.txt" | ||
if [[ "${UPLOAD_ON_MAIN:-0}" == "1" ]]; then | ||
git config --global user.name "PyTorch Bot" | ||
git config --global user.email "[email protected]" | ||
git add Package.swift | ||
git commit -am "${VERSION}" | ||
git push -f origin "${BRANCH}" | ||
else | ||
echo "Draft Package.swift:" | ||
cat Package.swift | ||
fi | ||
build-benchmark-app: | ||
name: build-benchmark-app | ||
# NB: Don't run this on fork PRs because they won't have access to the secret and would fail anyway | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main | ||
secrets: inherit | ||
with: | ||
|
@@ -285,5 +340,5 @@ jobs: | |
echo "::group::Build ExecuTorch benchmark app" | ||
mkdir -p extension/benchmark/apple/Benchmark/Models | ||
${CONDA_RUN} --no-capture-output \ | ||
build/build_apple_llm_demo.sh ${ARTIFACTS_DIR_NAME} | ||
build/build_apple_llm_demo.sh "${ARTIFACTS_DIR_NAME}" | ||
echo "::endgroup::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
load("@fbcode_macros//build_defs:python_library.bzl", "python_library") | ||
|
||
python_library( | ||
name = "operator_support", | ||
srcs = glob(["*.py"]), | ||
typing = True, | ||
deps = [ | ||
"//executorch/backends/xnnpack/_passes:xnnpack_passes", | ||
"//executorch/exir:lib", | ||
"//executorch/backends/arm:tosa_specification" | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2024 Arm Limited and/or its affiliates. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# pyre-unsafe | ||
|
||
from . import mean_dim_support, tosa_supported_operators, var_correction_support # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2024 Arm Limited and/or its affiliates. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# pyre-unsafe | ||
|
||
from typing import cast | ||
|
||
import torch.fx as fx | ||
|
||
from executorch.backends.arm.operator_support.tosa_supported_operators import ( | ||
register_tosa_support_check, | ||
SupportedTOSAOperatorCheck, | ||
) | ||
from executorch.backends.arm.tosa_specification import TosaSpecification | ||
from executorch.exir.dialects._ops import ops as exir_ops | ||
|
||
|
||
@register_tosa_support_check | ||
class MeanDimSupported(SupportedTOSAOperatorCheck): | ||
targets = [exir_ops.edge.aten.mean.dim] | ||
|
||
tosa_specs = [ | ||
TosaSpecification.create_from_string("TOSA-0.80.0+BI"), | ||
TosaSpecification.create_from_string("TOSA-0.80.0+MI"), | ||
] | ||
|
||
def is_node_supported(self, node: fx.Node, tosa_spec: TosaSpecification) -> bool: | ||
assert node.target in self.targets | ||
|
||
keep_dim = node.args[2] if len(node.args) > 2 else False | ||
return cast(bool, keep_dim) |
Oops, something went wrong.