Skip to content

Commit 005460d

Browse files
authored
Merge branch 'main' into update-opt-et-pin
2 parents 2cb67f1 + de89397 commit 005460d

File tree

33 files changed

+1998
-123
lines changed

33 files changed

+1998
-123
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2dccff7dcf56b0d168ebfd7ca08bdeca37273c56
1+
6fc0ad22f0a07b6f38d138861c56a765d5a9bb02

.ci/scripts/test_qnn_static_llama.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ exit_code1=$?
4141
$PYTHON_EXECUTABLE backends/qualcomm/tests/test_qnn_delegate.py -k TestExampleLLMScript.test_llama_stories_110m --model SM8650 --build_folder build-x86/ --executorch_root . --artifact_dir . --llama_artifacts . --enable_x86_64
4242
exit_code2=$?
4343

44+
# Check BC
45+
bash backends/qualcomm/bc/test_qnn_static_llama_bc.sh
46+
exit_code3=$?
47+
4448
# Check the exit codes and print messages
4549
if [ $exit_code1 -ne 0 ]; then
4650
echo "Static Llama compile only with weight sharing test failed. $exit_code1."
@@ -50,8 +54,12 @@ if [ $exit_code2 -ne 0 ]; then
5054
echo "Static Llama accuracy test failed. $exit_code2."
5155
fi
5256

57+
if [ $exit_code3 -ne 0 ]; then
58+
echo "Static Llama BACKWARD COMPATIBILITY test failed. $exit_code3."
59+
fi
60+
5361
# Return failure if either program failed
54-
if [ $exit_code1 -ne 0 ] || [ $exit_code2 -ne 0 ]; then
62+
if [ $exit_code1 -ne 0 ] || [ $exit_code2 -ne 0 ] || [ $exit_code3 -ne 0 ]; then
5563
exit 1
5664
else
5765
exit 0

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,10 @@ endif()
817817
if(EXECUTORCH_BUILD_VULKAN)
818818
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
819819
endif()
820+
if(EXECUTORCH_BUILD_VGF)
821+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/arm)
822+
endif()
823+
820824

821825
if(EXECUTORCH_BUILD_ANDROID_JNI)
822826
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/android)

backends/arm/CMakeLists.txt

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ if(NOT EXECUTORCH_ROOT)
1212
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
1313
endif()
1414

15-
add_compile_options("-Wall" "-Werror")
16-
1715
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
1816

1917
set(_common_include_directories ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10)
2018
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)
2119

20+
21+
# bare metal backend builds
22+
if(EXECUTORCH_BUILD_ARM_BAREMETAL)
23+
24+
add_compile_options("-Wall" "-Werror")
25+
2226
# Third-party folder and Ethos-U driver inclued
2327
set(THIRD_PARTY_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
2428
set(DRIVER_ETHOSU_INCLUDE_DIR "${THIRD_PARTY_ROOT}/ethos-u-core-driver/include")
@@ -36,3 +40,47 @@ target_include_directories(
3640
target_include_directories(
3741
executorch_delegate_ethos_u PUBLIC ${DRIVER_ETHOSU_INCLUDE_DIR}
3842
)
43+
44+
# end config for bare metal builds
45+
endif()
46+
47+
48+
# VGF backend builds
49+
if(EXECUTORCH_BUILD_VGF)
50+
51+
# include libvgf
52+
set(LIBVGF_PATH "${EXECUTORCH_ROOT}/examples/arm/ethos-u-scratch/ml-sdk-for-vulkan-manifest/sw/vgf-lib/")
53+
54+
set(VULKAN_THIRD_PARTY_PATH ${EXECUTORCH_ROOT}/backends/vulkan/third-party)
55+
set(VULKAN_HEADERS_PATH ${VULKAN_THIRD_PARTY_PATH}/Vulkan-Headers/include)
56+
set(VOLK_HEADERS_PATH ${VULKAN_THIRD_PARTY_PATH}/volk)
57+
58+
set(LIBVGF_STATIC "${LIBVGF_PATH}/build/src/libvgf.a")
59+
set(LIBVGF_INCLUDE "${LIBVGF_PATH}/include/")
60+
61+
add_library(vgf STATIC IMPORTED)
62+
set_property( TARGET vgf PROPERTY IMPORTED_LOCATION "${LIBVGF_STATIC}" )
63+
target_include_directories(vgf INTERFACE "${LIBVGF_INCLUDE}")
64+
65+
# Add backend delegate for VGF
66+
set(_vgf_backend_sources backends/arm/runtime/VGFBackend.cpp
67+
backends/arm/runtime/VGFSetup.cpp )
68+
69+
# vgf backend
70+
list(TRANSFORM _vgf_backend_sources PREPEND "${EXECUTORCH_ROOT}/")
71+
add_library(vgf_backend ${_vgf_backend_sources})
72+
target_include_directories(
73+
vgf_backend PUBLIC
74+
${_common_include_directories}
75+
${VULKAN_HEADERS_PATH}
76+
${VOLK_HEADERS_PATH}
77+
)
78+
target_compile_options(vgf_backend PRIVATE -DUSE_VULKAN_WRAPPER -DUSE_VULKAN_VOLK)
79+
80+
81+
target_link_libraries(vgf_backend PRIVATE executorch_core)
82+
target_link_libraries(vgf_backend PRIVATE vgf)
83+
executorch_target_link_options_shared_lib(vgf_backend)
84+
85+
# end config for VGF builds
86+
endif()

backends/arm/_passes/match_arg_ranks_pass.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def __init__(self, exported_program):
5454
exir_ops.edge.aten.le.Tensor,
5555
exir_ops.edge.aten.pow.Tensor_Tensor,
5656
exir_ops.edge.aten.where.self,
57+
exir_ops.edge.aten.bitwise_and.Tensor,
58+
exir_ops.edge.aten.bitwise_xor.Tensor,
59+
exir_ops.edge.aten.bitwise_or.Tensor,
5760
]
5861

5962
def _match_op_rank(self, graph_module, node, arg, max_rank):

backends/arm/_passes/replace_scalar_with_tensor_pass.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
exir_ops.edge.aten.lt.Scalar: exir_ops.edge.aten.lt.Tensor,
3535
exir_ops.edge.aten.le.Scalar: exir_ops.edge.aten.le.Tensor,
3636
exir_ops.edge.aten.ne.Scalar: exir_ops.edge.aten.ne.Tensor,
37+
exir_ops.edge.aten.bitwise_and.Scalar: exir_ops.edge.aten.bitwise_and.Tensor,
38+
exir_ops.edge.aten.bitwise_or.Scalar: exir_ops.edge.aten.bitwise_or.Tensor,
39+
exir_ops.edge.aten.bitwise_xor.Scalar: exir_ops.edge.aten.bitwise_xor.Tensor,
3740
torch.ops.aten.add.Scalar: torch.ops.aten.add.Tensor,
3841
torch.ops.aten.sub.Scalar: torch.ops.aten.sub.Tensor,
3942
torch.ops.aten.mul.Scalar: torch.ops.aten.mul.Tensor,
@@ -46,6 +49,9 @@
4649
torch.ops.aten.lt.Scalar: torch.ops.aten.lt.Tensor,
4750
torch.ops.aten.le.Scalar: torch.ops.aten.le.Tensor,
4851
torch.ops.aten.ne.Scalar: torch.ops.aten.ne.Tensor,
52+
torch.ops.aten.bitwise_and.Scalar: torch.ops.aten.bitwise_and.Tensor,
53+
torch.ops.aten.bitwise_or.Scalar: torch.ops.aten.bitwise_or.Tensor,
54+
torch.ops.aten.bitwise_xor.Scalar: torch.ops.aten.bitwise_xor.Tensor,
4955
}
5056

5157

backends/arm/operator_support/ethos_u55_support.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ class EthosU55NotSupported(OperatorSupportBase):
125125
exir_ops.edge.aten.bitwise_and.Tensor,
126126
exir_ops.edge.aten.bitwise_or.Tensor,
127127
exir_ops.edge.aten.bitwise_xor.Tensor,
128+
exir_ops.edge.aten.bitwise_and.Scalar,
129+
exir_ops.edge.aten.bitwise_or.Scalar,
130+
exir_ops.edge.aten.bitwise_xor.Scalar,
128131
exir_ops.edge.aten.bitwise_not,
129132
exir_ops.edge.aten.logical_and.default,
130133
exir_ops.edge.aten.logical_or.default,

backends/arm/operator_support/tosa_supported_operators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ def is_node_supported(
164164
exir_ops.edge.aten.bitwise_and.Tensor,
165165
exir_ops.edge.aten.bitwise_or.Tensor,
166166
exir_ops.edge.aten.bitwise_xor.Tensor,
167+
exir_ops.edge.aten.bitwise_and.Scalar,
168+
exir_ops.edge.aten.bitwise_or.Scalar,
169+
exir_ops.edge.aten.bitwise_xor.Scalar,
167170
exir_ops.edge.aten.expand_copy.default,
168171
exir_ops.edge.aten.cat.default,
169172
exir_ops.edge.aten.ceil.default,

0 commit comments

Comments
 (0)