Skip to content

Commit 05378f5

Browse files
committed
Merge remote-tracking branch 'origin/main' into start-pos-api-llava-7-9
2 parents 8745801 + ccd9824 commit 05378f5

Some content is hidden

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

55 files changed

+610
-348
lines changed

.ci/docker/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ case "${IMAGE_NAME}" in
5454
executorch-ubuntu-22.04-mediatek-sdk)
5555
MEDIATEK_SDK=yes
5656
CLANG_VERSION=12
57-
ANDROID_NDK_VERSION=r27b
57+
ANDROID_NDK_VERSION=r28c
5858
;;
5959
executorch-ubuntu-22.04-clang12-android)
6060
LINTRUNNER=""
6161
CLANG_VERSION=12
6262
# From https://developer.android.com/ndk/downloads
63-
ANDROID_NDK_VERSION=r27b
63+
ANDROID_NDK_VERSION=r28c
6464
;;
6565
*)
6666
echo "Invalid image name ${IMAGE_NAME}"

.ci/scripts/setup-samsung-linux-deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ download_ai_lite_core() {
5252
install_enn_backend() {
5353
NDK_INSTALLATION_DIR=/opt/ndk
5454
rm -rf "${NDK_INSTALLATION_DIR}" && sudo mkdir -p "${NDK_INSTALLATION_DIR}"
55-
ANDROID_NDK_VERSION=r27b
55+
ANDROID_NDK_VERSION=r28c
5656

5757
# build Exynos backend
5858
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/ndk}

.ci/scripts/test-cuda-build.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ set -exu
99

1010
CUDA_VERSION=${1:-"12.6"}
1111

12-
echo "=== Testing ExecutorTorch CUDA ${CUDA_VERSION} Build ==="
12+
echo "=== Testing ExecuTorch CUDA ${CUDA_VERSION} Build ==="
1313

14-
# Function to build and test ExecutorTorch with CUDA support
14+
# Function to build and test ExecuTorch with CUDA support
1515
test_executorch_cuda_build() {
1616
local cuda_version=$1
1717

18-
echo "Building ExecutorTorch with CUDA ${cuda_version} support..."
19-
echo "ExecutorTorch will automatically detect CUDA and install appropriate PyTorch wheel"
18+
echo "Building ExecuTorch with CUDA ${cuda_version} support..."
19+
echo "ExecuTorch will automatically detect CUDA and install appropriate PyTorch wheel"
2020

2121
# Check available resources before starting
2222
echo "=== System Information ==="
@@ -27,11 +27,11 @@ test_executorch_cuda_build() {
2727
nvcc --version || echo "nvcc not found"
2828
nvidia-smi || echo "nvidia-smi not found"
2929

30-
# Set CMAKE_ARGS to enable CUDA build - ExecutorTorch will handle PyTorch installation automatically
30+
# Set CMAKE_ARGS to enable CUDA build - ExecuTorch will handle PyTorch installation automatically
3131
export CMAKE_ARGS="-DEXECUTORCH_BUILD_CUDA=ON"
3232

33-
echo "=== Starting ExecutorTorch Installation ==="
34-
# Install ExecutorTorch with CUDA support with timeout and error handling
33+
echo "=== Starting ExecuTorch Installation ==="
34+
# Install ExecuTorch with CUDA support with timeout and error handling
3535
timeout 5400 ./install_executorch.sh || {
3636
local exit_code=$?
3737
echo "ERROR: install_executorch.sh failed with exit code: $exit_code"
@@ -41,15 +41,15 @@ test_executorch_cuda_build() {
4141
exit $exit_code
4242
}
4343

44-
echo "SUCCESS: ExecutorTorch CUDA build completed"
44+
echo "SUCCESS: ExecuTorch CUDA build completed"
4545

4646
# Verify the installation
47-
echo "=== Verifying ExecutorTorch CUDA Installation ==="
47+
echo "=== Verifying ExecuTorch CUDA Installation ==="
4848

49-
# Test that ExecutorTorch was built successfully
49+
# Test that ExecuTorch was built successfully
5050
python -c "
5151
import executorch
52-
print('SUCCESS: ExecutorTorch imported successfully')
52+
print('SUCCESS: ExecuTorch imported successfully')
5353
"
5454

5555
# Test CUDA availability and show details
@@ -60,7 +60,7 @@ try:
6060
print('INFO: CUDA available:', torch.cuda.is_available())
6161
6262
if torch.cuda.is_available():
63-
print('SUCCESS: CUDA is available for ExecutorTorch')
63+
print('SUCCESS: CUDA is available for ExecuTorch')
6464
print('INFO: CUDA version:', torch.version.cuda)
6565
print('INFO: GPU device count:', torch.cuda.device_count())
6666
print('INFO: Current GPU device:', torch.cuda.current_device())
@@ -74,16 +74,16 @@ try:
7474
print('SUCCESS: CUDA tensor operation completed on device:', z.device)
7575
print('INFO: Result tensor shape:', z.shape)
7676
77-
print('SUCCESS: ExecutorTorch CUDA integration verified')
77+
print('SUCCESS: ExecuTorch CUDA integration verified')
7878
else:
79-
print('WARNING: CUDA not detected, but ExecutorTorch built successfully')
79+
print('WARNING: CUDA not detected, but ExecuTorch built successfully')
8080
exit(1)
8181
except Exception as e:
82-
print('ERROR: ExecutorTorch CUDA test failed:', e)
82+
print('ERROR: ExecuTorch CUDA test failed:', e)
8383
exit(1)
8484
"
8585

86-
echo "SUCCESS: ExecutorTorch CUDA ${cuda_version} build and verification completed successfully"
86+
echo "SUCCESS: ExecuTorch CUDA ${cuda_version} build and verification completed successfully"
8787
}
8888

8989
# Main execution

.github/workflows/_android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
# NB: Use metal install for KVM support to run the emulator faster
5555
runs-on: linux.24xl.spr-metal
5656
env:
57-
ANDROID_NDK_VERSION: r27b
57+
ANDROID_NDK_VERSION: r28c
5858
API_LEVEL: 34
5959
steps:
6060
- name: Setup SSH (Click me for login details)

CMakePresets.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/third-party/ios-cmake/ios.toolchain.cmake",
6464
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/ios.cmake",
6565
"PLATFORM": "OS64",
66-
"DEPLOYMENT_TARGET": "17.0"
66+
"DEPLOYMENT_TARGET": "17.0",
67+
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
6768
},
6869
"condition": {
6970
"lhs": "${hostSystemName}",
@@ -80,7 +81,8 @@
8081
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/third-party/ios-cmake/ios.toolchain.cmake",
8182
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/ios.cmake",
8283
"PLATFORM": "SIMULATORARM64",
83-
"DEPLOYMENT_TARGET": "17.0"
84+
"DEPLOYMENT_TARGET": "17.0",
85+
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
8486
},
8587
"condition": {
8688
"lhs": "${hostSystemName}",

backends/cortex_m/CMakeLists.txt

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ set(CMSIS_NN_LOCAL_PATH
3636
# library is downloaded via FetchContent in the default/regular case.
3737
if(CMSIS_NN_LOCAL_PATH AND EXISTS "${CMSIS_NN_LOCAL_PATH}")
3838
message(STATUS "Using CMSIS-NN from specified path: ${CMSIS_NN_LOCAL_PATH}")
39-
add_subdirectory(${CMSIS_NN_LOCAL_PATH} cmsis_nn_build)
39+
add_subdirectory(${CMSIS_NN_LOCAL_PATH} _deps/cmsis_nn-build)
4040
else()
4141
# Use FetchContent with automatic fallback
4242
message(STATUS "Using CMSIS-NN via FetchContent")
@@ -48,23 +48,7 @@ else()
4848
GIT_SHALLOW TRUE
4949
)
5050

51-
FetchContent_GetProperties(cmsis_nn)
52-
if(NOT cmsis_nn_POPULATED)
53-
FetchContent_Populate(cmsis_nn)
54-
add_subdirectory(${cmsis_nn_SOURCE_DIR} ${cmsis_nn_BINARY_DIR})
55-
endif()
56-
endif()
57-
58-
# Add MVEI define to cmsis-nn target
59-
if(TARGET cmsis-nn)
60-
target_compile_definitions(cmsis-nn PUBLIC ARM_MATH_MVEI=1)
61-
get_target_property(CMSIS_NN_INCLUDES cmsis-nn INTERFACE_INCLUDE_DIRECTORIES)
62-
message(STATUS "CMSIS-NN include dirs: ${CMSIS_NN_INCLUDES}")
63-
else()
64-
message(
65-
FATAL_ERROR
66-
"CMSIS-NN target not found. Check your CMSIS_NN_LOCAL_PATH or network connection."
67-
)
51+
FetchContent_MakeAvailable(cmsis_nn)
6852
endif()
6953

7054
# Cortex-M ops kernel sources

backends/cortex_m/test/test_quantize_op_fusion_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def forward(self, x, y):
313313
# Apply passes
314314
transformed_program = self._apply_passes(edge_program)
315315

316-
# Generate ExecutorTorch program
316+
# Generate ExecuTorch program
317317
executorch_program = transformed_program.to_executorch()
318318

319319
# Verify the program contains the expected fused operator

backends/nxp/backend/edge_program_converter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def _process_nodes(self, nodes: list[Node], conversion_context: ConversionContex
134134

135135
qdq_related_functions = [
136136
exir_ops.edge.quantized_decomposed.dequantize_per_tensor.default,
137+
exir_ops.edge.quantized_decomposed.dequantize_per_channel.default,
137138
exir_ops.edge.quantized_decomposed.quantize_per_tensor.default,
138139
]
139140

@@ -203,7 +204,8 @@ def _convert_qdq_cluster_q_dq_nodes(
203204
:param conversion_context: ConversionContext instance.
204205
"""
205206
qdq_q_ops_converters = {
206-
exir_ops.edge.quantized_decomposed.dequantize_per_tensor.default: QDQDequantizeConverter, # noqa F405
207+
exir_ops.edge.quantized_decomposed.dequantize_per_tensor.default: QDQPerTensorDequantizeConverter, # noqa F405
208+
exir_ops.edge.quantized_decomposed.dequantize_per_channel.default: QDQPerChannelDequantizeConverter, # noqa F405
207209
exir_ops.edge.quantized_decomposed.quantize_per_tensor.default: QDQQuantizeConverter, # noqa F405
208210
}
209211

backends/nxp/backend/ir/converter/node_converters/ops_converters/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
PermuteCopyConverter,
4242
)
4343
from executorch.backends.nxp.backend.ir.converter.node_converters.ops_converters.qdq_dequantize_converter import (
44-
QDQDequantizeConverter,
44+
QDQPerChannelDequantizeConverter,
45+
QDQPerTensorDequantizeConverter,
4546
)
4647
from executorch.backends.nxp.backend.ir.converter.node_converters.ops_converters.qdq_quantize_converter import (
4748
QDQQuantizeConverter,
@@ -70,7 +71,8 @@
7071
"PermuteCopyConverter",
7172
"SoftmaxConverter",
7273
"ViewCopyConverter",
73-
"QDQDequantizeConverter",
74+
"QDQPerTensorDequantizeConverter",
75+
"QDQPerChannelDequantizeConverter",
7476
"QDQQuantizeConverter",
7577
"ConstantPadNDConverter",
7678
"ReLUConverter",

backends/nxp/backend/ir/converter/node_converters/ops_converters/convolution_converter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ def _convert_2d_conv(
321321
t_op.tmp_inputs[1] = self.builder.create_transposed_tensor(
322322
weight_tensor, perm
323323
)
324+
325+
if t_op.tmp_inputs[1].quantization is not None:
326+
# Model is quantized
327+
t_op.tmp_inputs[1].quantization.quantized_dimension = 3
324328
else:
325329
raise NotImplementedError("Dynamic Depthwise Conv weights.")
326330

0 commit comments

Comments
 (0)