Skip to content

Commit 66e0901

Browse files
author
pytorchbot
committed
2024-09-27 nightly release (bdaeede)
1 parent 29f8ef3 commit 66e0901

File tree

54 files changed

+1117
-305
lines changed

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

+1117
-305
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Android Release Artifacts
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version name to be uploaded for AAR release
8+
required: false
9+
type: string
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-aar:
17+
name: build-aar
18+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
19+
with:
20+
runner: linux.2xlarge
21+
docker-image: executorch-ubuntu-22.04-clang12-android
22+
submodules: 'true'
23+
ref: ${{ github.sha }}
24+
timeout: 90
25+
upload-artifact: android-apps
26+
upload-artifact-to-s3: true
27+
script: |
28+
set -eux
29+
30+
# The generic Linux job chooses to use base env, not the one setup by the image
31+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
32+
conda activate "${CONDA_ENV}"
33+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh buck2
34+
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
35+
36+
# Build LLM Demo for Android
37+
bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME}
38+
39+
shasum -a 256 "${ARTIFACTS_DIR_NAME}/llm_demo/executorch.aar"
40+
41+
upload-release-aar:
42+
name: upload-release-aar
43+
needs: build-aar
44+
runs-on: ubuntu-22.04
45+
timeout-minutes: 10
46+
permissions:
47+
id-token: write
48+
contents: read
49+
steps:
50+
- name: configure aws credentials
51+
uses: aws-actions/[email protected]
52+
with:
53+
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-android
54+
aws-region: us-east-1
55+
- name: Upload AAR RC to AWS S3
56+
shell: bash
57+
run: |
58+
wget https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/executorch.aar
59+
shasum -a 256 executorch.aar > executorch.aar.sha256sums
60+
61+
pip install awscli==1.32.18
62+
AWS_CMD="aws s3 cp"
63+
VERSION="${{ inputs.version }}"
64+
VERSION_NAME="${VERSION:-temp_snapshot}"
65+
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar --acl public-read
66+
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar.sha256sums --acl public-read

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Check out the [Getting Started](https://pytorch.org/executorch/stable/getting-st
2424

2525
Check out the examples of [Llama](./examples/models/llama2/README.md), [Llava](./examples/models/llava/README.md) and [other models](./examples/README.md) running on edge devices using ExecuTorch.
2626

27+
28+
**[UPDATE - 09/25]** We have added support for running [Llama 3.2 1B/3B](./examples/models/llama2/README.md) models via ExecuTorch.
29+
2730
## Feedback
2831

2932
We welcome any feedback, suggestions, and bug reports from the community to help

backends/cadence/reference/operators/quantized_conv_out.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include <executorch/backends/cadence/reference/kernels/kernels.h>
1010

1111
#include <executorch/runtime/kernel/kernel_includes.h>
12-
#include <algorithm>
13-
#include <cmath>
1412

1513
namespace impl {
1614
namespace reference {

backends/cadence/reference/operators/quantized_layer_norm.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#include <executorch/backends/cadence/reference/kernels/kernels.h>
1010
#include <executorch/runtime/kernel/kernel_includes.h>
1111

12-
#include <algorithm>
1312
#include <cmath>
14-
#include <tuple>
1513

1614
using Tensor = exec_aten::Tensor;
1715
using executorch::runtime::KernelRuntimeContext;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load(":targets.bzl", "define_common_targets")
2+
3+
oncall("executorch")
4+
5+
define_common_targets()
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
load(
2+
"@fbsource//tools/build_defs:default_platform_defs.bzl",
3+
"ANDROID",
4+
)
5+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
6+
7+
PYTHON_MODULE_NAME = "PyQnnManagerAdaptor"
8+
9+
def define_common_targets():
10+
"""Defines targets that should be shared between fbcode and xplat.
11+
The directory containing this targets.bzl file should also contain both
12+
TARGETS and BUCK files that call this function.
13+
"""
14+
15+
runtime.cxx_python_extension(
16+
name = "PyQnnManagerAdaptor",
17+
srcs = [
18+
"PyQnnManagerAdaptor.cpp",
19+
],
20+
headers = [
21+
"PyQnnManagerAdaptor.h",
22+
],
23+
base_module = "executorch.backends.qualcomm.python",
24+
preprocessor_flags = [
25+
"-DEXECUTORCH_PYTHON_MODULE_NAME={}".format(PYTHON_MODULE_NAME),
26+
],
27+
deps = [
28+
"//executorch/runtime/core:core",
29+
"//executorch/backends/qualcomm/aot/python:python_lib",
30+
"//executorch/backends/qualcomm/aot/wrappers:wrappers",
31+
"//executorch/backends/qualcomm/runtime:logging",
32+
"//executorch/backends/qualcomm:schema",
33+
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
34+
"//executorch/backends/qualcomm/runtime:runtime",
35+
"fbsource//third-party/qualcomm/qnn:api",
36+
],
37+
external_deps = [
38+
"pybind11",
39+
"libtorch_python",
40+
],
41+
use_static_deps = True,
42+
visibility = [
43+
"//executorch/backends/qualcomm/...",
44+
],
45+
)
46+
47+
48+
runtime.cxx_python_extension(
49+
name = "PyQnnWrapperAdaptor",
50+
srcs = [
51+
"PyQnnWrapperAdaptor.cpp",
52+
],
53+
headers = [
54+
"PyQnnWrapperAdaptor.h",
55+
],
56+
base_module = "executorch.backends.qualcomm.python",
57+
preprocessor_flags = [
58+
"-DEXECUTORCH_PYTHON_MODULE_NAME={}".format(PYTHON_MODULE_NAME),
59+
],
60+
deps = [
61+
"//executorch/runtime/core:core",
62+
"//executorch/backends/qualcomm/aot/python:python_lib",
63+
"//executorch/backends/qualcomm/aot/wrappers:wrappers",
64+
"//executorch/backends/qualcomm/runtime:logging",
65+
"//executorch/backends/qualcomm:schema",
66+
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
67+
"//executorch/backends/qualcomm/runtime:runtime",
68+
"fbsource//third-party/qualcomm/qnn:api",
69+
],
70+
external_deps = [
71+
"pybind11",
72+
"libtorch_python",
73+
],
74+
use_static_deps = True,
75+
visibility = [
76+
"//executorch/backends/qualcomm/...",
77+
],
78+
)
79+
80+
runtime.cxx_library(
81+
name = "python_lib",
82+
srcs = glob([
83+
"*.cpp",
84+
]),
85+
exported_headers = glob([
86+
"*.h",
87+
]),
88+
visibility = ["@EXECUTORCH_CLIENTS"],
89+
deps = [
90+
"//executorch/backends/qualcomm/aot/wrappers:wrappers",
91+
"//executorch/backends/qualcomm/runtime:logging",
92+
"//executorch/backends/qualcomm:schema",
93+
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
94+
"//executorch/backends/qualcomm/runtime:runtime",
95+
"fbsource//third-party/qualcomm/qnn:api",
96+
],
97+
external_deps = [
98+
"pybind11",
99+
],
100+
)

backends/qualcomm/builders/TARGETS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load(":targets.bzl", "define_common_targets")
2+
3+
oncall("executorch")
4+
5+
define_common_targets()
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
3+
def define_common_targets():
4+
"""Defines targets that should be shared between fbcode and xplat.
5+
The directory containing this targets.bzl file should also contain both
6+
TARGETS and BUCK files that call this function.
7+
"""
8+
9+
runtime.python_library(
10+
name = "builders",
11+
srcs = glob([
12+
"*.py",
13+
]),
14+
visibility = [
15+
"@EXECUTORCH_CLIENTS",
16+
],
17+
deps = [
18+
"//executorch/exir/backend:backend_details",
19+
"//executorch/exir/backend:compile_spec_schema",
20+
"//executorch/backends/qualcomm/aot/python:PyQnnWrapperAdaptor",
21+
"//executorch/backends/qualcomm/aot/python:PyQnnManagerAdaptor",
22+
"//executorch/backends/qualcomm/utils:utils",
23+
"//executorch/exir:lib",
24+
],
25+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load(":targets.bzl", "define_common_targets")
2+
3+
oncall("executorch")
4+
5+
define_common_targets()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
3+
def define_common_targets():
4+
"""Defines targets that should be shared between fbcode and xplat.
5+
The directory containing this targets.bzl file should also contain both
6+
TARGETS and BUCK files that call this function.
7+
"""
8+
9+
runtime.python_library(
10+
name = "partition",
11+
srcs = glob([
12+
"*.py",
13+
]),
14+
visibility = [
15+
"@EXECUTORCH_CLIENTS",
16+
],
17+
deps = [
18+
"//executorch/exir/backend:backend_details",
19+
"//executorch/exir/backend:compile_spec_schema",
20+
"//executorch/backends/qualcomm/builders:builders",
21+
"//executorch/backends/qualcomm:preprocess",
22+
"//executorch/exir/backend/canonical_partitioners:canonical_partitioner_lib",
23+
],
24+
)

0 commit comments

Comments
 (0)