Skip to content

Commit 3a65439

Browse files
committed
Merge remote-tracking branch 'origin/main' into android-test-kt
2 parents 54e6bcb + fb45e19 commit 3a65439

File tree

150 files changed

+4049
-913
lines changed

Some content is hidden

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

150 files changed

+4049
-913
lines changed

.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

CMakeLists.txt

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -410,20 +410,6 @@ endif()
410410
message(STATUS "executorch: Using sources file ${EXECUTORCH_SRCS_FILE}")
411411
include(${EXECUTORCH_SRCS_FILE})
412412

413-
#
414-
# Modify default options when cross-compiling.
415-
#
416-
# The intent is for the EXECUTORCH_BUILD_HOST_TARGETS option to affect the
417-
# default ON/OFF values of host targets around the tree. This way, a user can
418-
# disable EXECUTORCH_BUILD_HOST_TARGETS to disable all host targets, and then
419-
# optionally re-enable some of those targets. Or they could leave
420-
# EXECUTORCH_BUILD_HOST_TARGETS enabled and then optionally disable any given
421-
# host target.
422-
#
423-
# We can then use various cross-compilation hints to set the default value of
424-
# EXECUTORCH_BUILD_HOST_TARGETS, which can still be overridden if desired.
425-
#
426-
427413
# Detect if an iOS toolchain is set.
428414
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
429415
set(CMAKE_TOOLCHAIN_IOS ON)
@@ -458,16 +444,6 @@ if(EXECUTORCH_USE_CPP_CODE_COVERAGE)
458444
endif()
459445
endif()
460446

461-
# EXECUTORCH_BUILD_HOST_TARGETS: Option to control the building of host-only
462-
# tools like `flatc`, along with example executables like `executor_runner` and
463-
# libraries that it uses, like `gflags`. Disabling this can be helpful when
464-
# cross-compiling, but some required tools that would have been built need to be
465-
# provided directly.
466-
cmake_dependent_option(
467-
EXECUTORCH_BUILD_HOST_TARGETS "Build host-only targets." ON
468-
"NOT CMAKE_TOOLCHAIN_IOS" OFF
469-
)
470-
471447
#
472448
# flatc: Flatbuffer commandline tool to generate .h files from .fbs files
473449
#
@@ -665,10 +641,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/configurations)
665641
#
666642
# gflags: Commandline flag host library.
667643
#
668-
cmake_dependent_option(
669-
EXECUTORCH_BUILD_GFLAGS "Build the gflags library." ON
670-
EXECUTORCH_BUILD_HOST_TARGETS OFF
671-
)
644+
option(EXECUTORCH_BUILD_GFLAGS "Build the gflags library." ON)
672645
if(EXECUTORCH_BUILD_GFLAGS)
673646
add_subdirectory(third-party/gflags)
674647
endif()
@@ -694,7 +667,7 @@ install(FILES tools/cmake/executorch-config.cmake DESTINATION lib/cmake/ExecuTor
694667
#
695668
cmake_dependent_option(
696669
EXECUTORCH_BUILD_EXECUTOR_RUNNER "Build the executor_runner executable" ON
697-
EXECUTORCH_BUILD_HOST_TARGETS OFF
670+
"NOT CMAKE_TOOLCHAIN_IOS" OFF
698671
)
699672

700673
# Add googletest if any test targets should be built

backends/apple/mps/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The MPS backend device maps machine learning computational graphs and primitives
1515
* [Introduction to ExecuTorch](../../../docs/source/intro-how-it-works.md)
1616
* [Setting up ExecuTorch](../../../docs/source/getting-started-setup.rst)
1717
* [Building ExecuTorch with CMake](../../../docs/source/using-executorch-cpp.md#building-with-cmake)
18-
* [ExecuTorch iOS Demo App](../../../docs/source/demo-apps-ios.md)
18+
* [ExecuTorch iOS Demo App](https://github.com/pytorch-labs/executorch-examples/tree/main/mv3/apple/ExecuTorchDemo)
1919
* [ExecuTorch iOS LLaMA Demo App](../../../docs/source/llm/llama-demo-ios.md)
2020
:::
2121
::::

backends/arm/__init__.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

backends/arm/_passes/insert_table_ops.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class TableOps:
4848
exir_ops.edge.aten.reciprocal.default: torch.reciprocal,
4949
exir_ops.edge.aten.rsqrt.default: torch.rsqrt,
5050
exir_ops.edge.aten.sigmoid.default: torch.sigmoid,
51+
exir_ops.edge.aten.cos.default: torch.cos,
52+
exir_ops.edge.aten.sin.default: torch.sin,
5153
exir_ops.edge.aten.tanh.default: torch.tanh,
5254
exir_ops.edge.aten.hardsigmoid.default: torch.nn.functional.hardsigmoid,
5355
exir_ops.edge.aten.hardswish.default: torch.nn.functional.hardswish,

backends/arm/ethosu_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import logging
1515
from typing import final, List
1616

17-
from executorch.backends.arm import TOSABackend
18-
1917
from executorch.backends.arm.arm_vela import vela_compile
18+
19+
from executorch.backends.arm.tosa_backend import TOSABackend
2020
from executorch.exir.backend.backend_details import BackendDetails, PreprocessResult
2121
from executorch.exir.backend.compile_spec_schema import CompileSpec
2222
from torch.export.exported_program import ExportedProgram

backends/arm/ethosu_partitioner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from executorch.backends.arm.arm_backend import (
1111
is_ethosu,
1212
) # usort: skip
13-
from executorch.backends.arm import EthosUBackend, TOSAPartitioner
13+
from executorch.backends.arm.ethosu_backend import EthosUBackend
14+
from executorch.backends.arm.tosa_partitioner import TOSAPartitioner
1415
from executorch.exir.backend.compile_spec_schema import CompileSpec
1516
from executorch.exir.backend.partitioner import DelegationSpec
1617
from torch.fx.passes.operator_support import OperatorSupportBase

backends/arm/operator_support/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
pool_2d_support,
1313
reduce_sum_support,
1414
right_shift_support,
15+
sin_cos_support,
1516
slice_copy_support,
1617
to_copy_support,
1718
tosa_supported_operators,
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2025 Arm Limited and/or its affiliates.
2+
#
3+
# This source code is licensed under the BSD-style license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
# pyre-unsafe
7+
8+
9+
import torch.fx as fx
10+
from executorch.backends.arm.operator_support.tosa_supported_operators import (
11+
register_tosa_support_check,
12+
SupportedTOSAOperatorCheck,
13+
)
14+
from executorch.backends.arm.tosa_specification import TosaSpecification
15+
from executorch.exir.dialects._ops import ops as exir_ops
16+
17+
18+
@register_tosa_support_check
19+
class SinCosSupported(SupportedTOSAOperatorCheck):
20+
targets = [
21+
exir_ops.edge.aten.cos.default,
22+
exir_ops.edge.aten.sin.default,
23+
]
24+
25+
tosa_specs = [
26+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
27+
TosaSpecification.create_from_string("TOSA-1.0+INT"),
28+
TosaSpecification.create_from_string("TOSA-1.0+FP"),
29+
]
30+
31+
def is_node_tosa_supported(self, node: fx.Node, tosa_spec: TosaSpecification):
32+
return True

0 commit comments

Comments
 (0)