From 9c027956ca51023cfc9414bafd9516b95113f888 Mon Sep 17 00:00:00 2001 From: unmeshna Date: Fri, 11 Sep 2026 00:24:54 -0700 Subject: [PATCH] Bump Xtensa NNLib to 09_03_2026 and enable hifi_iq download Updates the hifi4 and hifi5 NNLib package links (and MD5s) to the 09_03_2026 release, and adds hifi_iq download support: a new hifi_iq branch in xtensa_download.sh and a matching hifi_iq target block in xtensa.inc. --- .../lite/micro/tools/make/ext_libs/xtensa.inc | 34 +++++++++++++++++++ .../tools/make/ext_libs/xtensa_download.sh | 16 +++++---- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/tensorflow/lite/micro/tools/make/ext_libs/xtensa.inc b/tensorflow/lite/micro/tools/make/ext_libs/xtensa.inc index c3237cf8253..3c499464e74 100644 --- a/tensorflow/lite/micro/tools/make/ext_libs/xtensa.inc +++ b/tensorflow/lite/micro/tools/make/ext_libs/xtensa.inc @@ -8,6 +8,40 @@ ifeq ($(TARGET_ARCH), hifimini) THIRD_PARTY_CC_HDRS += \ $(shell find $(FFT_PATH)/hifi2_fft -name "*.h") +else ifeq ($(TARGET_ARCH), hifi_iq) + DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/ext_libs/xtensa_download.sh ${DOWNLOADS_DIR} hifi_iq $(TENSORFLOW_ROOT)) + ifneq ($(DOWNLOAD_RESULT), SUCCESS) + $(error Something went wrong with the xtensa download: $(DOWNLOAD_RESULT)) + endif + + PLATFORM_FLAGS = \ + -Wno-shadow\ + + CCFLAGS += $(PLATFORM_FLAGS) + CXXFLAGS += $(PLATFORM_FLAGS) + + NNLIB_PATH := $(MAKEFILE_DIR)/downloads/xa_nnlib_hifi_iq + + THIRD_PARTY_KERNEL_CC_SRCS += \ + $(shell find $(NNLIB_PATH) -name "*.c") + + EXCLUDED_NNLIB_SRCS = \ + $(NNLIB_PATH)/algo/layers/cnn/src/xa_nn_cnn_api.c \ + $(NNLIB_PATH)/algo/layers/gru/src/xa_nn_gru_api.c \ + $(NNLIB_PATH)/algo/layers/lstm/src/xa_nn_lstm_api.c \ + + THIRD_PARTY_KERNEL_CC_SRCS := $(filter-out $(EXCLUDED_NNLIB_SRCS), $(THIRD_PARTY_KERNEL_CC_SRCS)) + + THIRD_PARTY_CC_HDRS += \ + $(shell find $(NNLIB_PATH) -name "*.h") \ + + INCLUDES += \ + -I$(NNLIB_PATH)/ \ + -I$(NNLIB_PATH)/algo/kernels/ \ + -I$(NNLIB_PATH)/include/nnlib/ \ + -I$(NNLIB_PATH)/include/ \ + -I$(NNLIB_PATH)/algo/common/include/ \ + else ifeq ($(TARGET_ARCH), hifi5) DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/ext_libs/xtensa_download.sh ${DOWNLOADS_DIR} hifi5 $(TENSORFLOW_ROOT)) ifneq ($(DOWNLOAD_RESULT), SUCCESS) diff --git a/tensorflow/lite/micro/tools/make/ext_libs/xtensa_download.sh b/tensorflow/lite/micro/tools/make/ext_libs/xtensa_download.sh index 391eaf12f4c..9c5be928a98 100755 --- a/tensorflow/lite/micro/tools/make/ext_libs/xtensa_download.sh +++ b/tensorflow/lite/micro/tools/make/ext_libs/xtensa_download.sh @@ -41,17 +41,21 @@ DOWNLOADS_DIR=${1} PATCH="" if [[ ${2} == "hifi3" ]]; then - LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_30_2025.zip" + LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_03_2026.zip" LIBRARY_DIRNAME="xa_nnlib_hifi4" - LIBRARY_MD5="a1cba57501a35d0bffdd39c536689366" + LIBRARY_MD5="69537cd86952b02aa6ed566d4a6f0c08" elif [[ ${2} == "hifi4" ]]; then - LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_30_2025.zip" + LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_03_2026.zip" LIBRARY_DIRNAME="xa_nnlib_hifi4" - LIBRARY_MD5="a1cba57501a35d0bffdd39c536689366" + LIBRARY_MD5="69537cd86952b02aa6ed566d4a6f0c08" elif [[ ${2} == "hifi5" ]]; then - LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi5/raw/master/archive/xa_nnlib_hifi5_09_30_2025.zip" + LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi5/raw/master/archive/xa_nnlib_hifi5_09_03_2026.zip" LIBRARY_DIRNAME="xa_nnlib_hifi5" - LIBRARY_MD5="f3ac445ae47143b1fddf26b85d763697" + LIBRARY_MD5="2fbe7a4459609f257b43fb1d2cdc2339" +elif [[ ${2} == "hifi_iq" ]]; then + LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi_iq/raw/main/archive/xa_nnlib_hifi_iq_09_03_2026.zip" + LIBRARY_DIRNAME="xa_nnlib_hifi_iq" + LIBRARY_MD5="050f2e27b5b68068a3b4d00a1b449013" elif [[ ${2} == "vision_p6" ]]; then LIBRARY_URL="https://github.com/foss-xtensa/tflmlib_vision/raw/main/archive/xi_tflmlib_vision_p6_22_06_29.zip" LIBRARY_DIRNAME="xi_tflmlib_vision_p6"