diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a3b1f7bfe0..33ca9e1fd6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -606,9 +606,9 @@ if(EXECUTORCH_BUILD_PYBIND) endif() if(EXECUTORCH_BUILD_XNNPACK) - # need to explicitly specify XNNPACK and microkernels-prod here otherwise + # need to explicitly specify XNNPACK and xnnpack-microkernels-prod here otherwise # uses XNNPACK and microkernel-prod symbols from libtorch_cpu - list(APPEND _dep_libs xnnpack_backend XNNPACK microkernels-prod) + list(APPEND _dep_libs xnnpack_backend XNNPACK xnnpack-microkernels-prod) endif() # compile options for pybind diff --git a/backends/xnnpack/cmake/Dependencies.cmake b/backends/xnnpack/cmake/Dependencies.cmake index 64d2409fb61..ca31a1e45cb 100644 --- a/backends/xnnpack/cmake/Dependencies.cmake +++ b/backends/xnnpack/cmake/Dependencies.cmake @@ -61,7 +61,7 @@ set(XNNPACK_BUILD_ALL_MICROKERNELS add_subdirectory("${XNNPACK_SOURCE_DIR}") include_directories(SYSTEM ${XNNPACK_INCLUDE_DIR}) list(APPEND xnnpack_third_party XNNPACK) -install(TARGETS microkernels-prod +install(TARGETS xnnpack-microkernels-prod LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/backends/xnnpack/test/CMakeLists.txt b/backends/xnnpack/test/CMakeLists.txt index c73709817f2..12d0a6d45be 100644 --- a/backends/xnnpack/test/CMakeLists.txt +++ b/backends/xnnpack/test/CMakeLists.txt @@ -32,7 +32,7 @@ et_cxx_test( XNNPACK pthreadpool cpuinfo - microkernels-prod + xnnpack-microkernels-prod ) target_include_directories( backends_xnnpack_test diff --git a/backends/xnnpack/third-party/XNNPACK b/backends/xnnpack/third-party/XNNPACK index 4ea82e595b3..84096dd536e 160000 --- a/backends/xnnpack/third-party/XNNPACK +++ b/backends/xnnpack/third-party/XNNPACK @@ -1 +1 @@ -Subproject commit 4ea82e595b36106653175dcb04b2aa532660d0d8 +Subproject commit 84096dd536edffd19337d9297634c4f5c5449bfd diff --git a/backends/xnnpack/third-party/xnnpack_src_defs.bzl b/backends/xnnpack/third-party/xnnpack_src_defs.bzl index f940a38025b..43c68f9858d 100644 --- a/backends/xnnpack/third-party/xnnpack_src_defs.bzl +++ b/backends/xnnpack/third-party/xnnpack_src_defs.bzl @@ -4,11 +4,38 @@ load( _OPERATOR_SRCS = "OPERATOR_SRCS", _SUBGRAPH_SRCS = "SUBGRAPH_SRCS", _TABLE_SRCS = "TABLE_SRCS", - _XNNPACK_SRCS = "XNNPACK_SRCS", + # _MICROKERNEL_DEFS = "MICROKERNEL_DEFS", + # _MICROKERNEL_SRCS = "MICROKERNEL_SRCS", ) load("//backends/xnnpack/third-party/XNNPACK/gen:microkernels.bzl", "prod_srcs_for_arch") load("@fbsource//xplat/executorch/third-party:glob_defs.bzl", "subdir_glob") +_XNNPACK_SRCS = [ + "src/configs/argmaxpool-config.c", + "src/configs/avgpool-config.c", + "src/configs/binary-elementwise-config.c", + "src/configs/cmul-config.c", + "src/configs/conv-hwc2chw-config.c", + "src/configs/dwconv-config.c", + "src/configs/dwconv2d-chw-config.c", + "src/configs/gemm-config.c", + "src/configs/ibilinear-chw-config.c", + "src/configs/ibilinear-config.c", + "src/configs/lut32norm-config.c", + "src/configs/maxpool-config.c", + "src/configs/pack-lh-config.c", + "src/configs/raddstoreexpminusmax-config.c", + "src/configs/reduce-config.c", + "src/configs/spmm-config.c", + "src/configs/transpose-config.c", + "src/configs/unary-elementwise-config.c", + "src/configs/unpool-config.c", + "src/configs/vmulcaddc-config.c", + "src/configs/x8-lut-config.c", + "src/configs/xx-fill-config.c", + "src/configs/xx-pad-config.c", +] + def define_xnnpack_build_src(xnnpack_build_src): return ["XNNPACK/{}".format(src) for src in xnnpack_build_src] @@ -18,10 +45,12 @@ def prod_srcs_for_arch_wrapper(arch): def get_xnnpack_headers(): src_headers = subdir_glob([ - ("XNNPACK/src", "**/*.h"), + ("xnnpack/src", "**/*.h"), + ("xnnpack/src", "**/*.inc"), ]) include_headers = subdir_glob([ ("XNNPACK/include", "*.h"), + ("XNNPACK/include", "*.inc"), ]) return src_headers | include_headers @@ -31,3 +60,5 @@ SUBGRAPH_SRCS = define_xnnpack_build_src(_SUBGRAPH_SRCS) TABLE_SRCS = define_xnnpack_build_src(_TABLE_SRCS) XNNPACK_SRCS = define_xnnpack_build_src(_XNNPACK_SRCS) LOGGING_SRCS = define_xnnpack_build_src(_LOGGING_SRCS) +# MICROKERNEL_DEFS = define_xnnpack_build_src(_MICROKERNEL_DEFS) +# MICROKERNEL_SRCS = define_xnnpack_build_src(_MICROKERNEL_SRCS) diff --git a/examples/models/llama/CMakeLists.txt b/examples/models/llama/CMakeLists.txt index 8c27de20845..e03c7a2de25 100644 --- a/examples/models/llama/CMakeLists.txt +++ b/examples/models/llama/CMakeLists.txt @@ -155,7 +155,7 @@ endif() # XNNPACK if(TARGET xnnpack_backend) - set(xnnpack_backend_libs xnnpack_backend XNNPACK microkernels-prod) + set(xnnpack_backend_libs xnnpack_backend XNNPACK xnnpack-microkernels-prod) if(TARGET kleidiai) list(APPEND xnnpack_backend_libs kleidiai) endif() diff --git a/examples/models/llava/CMakeLists.txt b/examples/models/llava/CMakeLists.txt index 64be6111674..89896a65c36 100644 --- a/examples/models/llava/CMakeLists.txt +++ b/examples/models/llava/CMakeLists.txt @@ -130,7 +130,7 @@ endif() # XNNPACK if(TARGET xnnpack_backend) - set(xnnpack_backend_libs xnnpack_backend XNNPACK microkernels-prod) + set(xnnpack_backend_libs xnnpack_backend XNNPACK xnnpack-microkernels-prod) if(TARGET kleidiai) list(APPEND xnnpack_backend_libs kleidiai) endif() diff --git a/extension/android/CMakeLists.txt b/extension/android/CMakeLists.txt index 3b7a04c2e97..8f7e19cb172 100644 --- a/extension/android/CMakeLists.txt +++ b/extension/android/CMakeLists.txt @@ -113,7 +113,7 @@ endif() if(TARGET xnnpack_backend) target_link_options_shared_lib(xnnpack_backend) - list(APPEND link_libraries xnnpack_backend XNNPACK pthreadpool cpuinfo microkernels-prod) + list(APPEND link_libraries xnnpack_backend XNNPACK pthreadpool cpuinfo xnnpack-microkernels-prod) endif() if(TARGET vulkan_backend) diff --git a/extension/training/CMakeLists.txt b/extension/training/CMakeLists.txt index 55537359cfe..11f94b39a89 100644 --- a/extension/training/CMakeLists.txt +++ b/extension/training/CMakeLists.txt @@ -52,9 +52,9 @@ if(EXECUTORCH_BUILD_PYBIND) ) if(EXECUTORCH_BUILD_XNNPACK) - # need to explicitly specify XNNPACK and microkernels-prod + # need to explicitly specify XNNPACK and xnnpack-microkernels-prod # here otherwise uses XNNPACK and microkernel-prod symbols from libtorch_cpu - list(APPEND _pybind_training_dep_libs xnnpack_backend XNNPACK microkernels-prod) + list(APPEND _pybind_training_dep_libs xnnpack_backend XNNPACK xnnpack-microkernels-prod) endif() # pybind training diff --git a/scripts/build_apple_frameworks.sh b/scripts/build_apple_frameworks.sh index fd457d9f21c..c3d5490d190 100755 --- a/scripts/build_apple_frameworks.sh +++ b/scripts/build_apple_frameworks.sh @@ -51,7 +51,7 @@ libmpsdelegate.a,\ FRAMEWORK_BACKEND_XNNPACK="backend_xnnpack:\ libXNNPACK.a,\ libxnnpack_backend.a,\ -libmicrokernels-prod.a,\ +libxnnpack-microkernels-prod.a,\ :" FRAMEWORK_KERNELS_CUSTOM="kernels_custom:\ diff --git a/tools/cmake/executorch-config.cmake b/tools/cmake/executorch-config.cmake index aa5776163a9..6aa2f275fae 100644 --- a/tools/cmake/executorch-config.cmake +++ b/tools/cmake/executorch-config.cmake @@ -79,7 +79,7 @@ set(lib_list xnnpack_backend # Start XNNPACK Lib Deps XNNPACK - microkernels-prod + xnnpack-microkernels-prod kleidiai # End XNNPACK Lib Deps cpuinfo