Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manifest: update cmsis-nn to v6.0.0 & tflite-micro #73995

Merged
merged 6 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/releases/release-notes-3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,11 @@ Libraries / Subsystems
for the Mbed TLS's p256-m driver PSA crypto library. This is a Cortex-M SW
optimized implementation of secp256r1 curve.

* CMSIS-NN

* CMSIS-NN was updated to v6.0.0 from v4.1.0:
https://arm-software.github.io/CMSIS-NN/latest/rev_hist.html

* Random

* Besides the existing :c:func:`sys_rand32_get` function, :c:func:`sys_rand8_get`,
Expand Down
15 changes: 9 additions & 6 deletions modules/cmsis-nn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,24 @@ if(CONFIG_CMSIS_NN)
endif()

if(CONFIG_CMSIS_NN_CONVOLUTION)
file(GLOB SRC "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s8*.c")
file(GLOB SRC_S4 "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s4*.c")
file(GLOB SRC_S8 "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s8*.c")
file(GLOB SRC_S16 "${CMSIS_NN_DIR}/Source/ConvolutionFunctions/*_s16*.c")
zephyr_library_sources(${SRC} ${SRC_S16})
zephyr_library_sources(${SRC_S4} ${SRC_S8} ${SRC_S16})
endif()

if(CONFIG_CMSIS_NN_FULLYCONNECTED)
file(GLOB SRC "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s8.c")
file(GLOB SRC_S4 "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s4.c")
file(GLOB SRC_S8 "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s8.c")
file(GLOB SRC_S16 "${CMSIS_NN_DIR}/Source/FullyConnectedFunctions/*_s16*.c")
zephyr_library_sources(${SRC} ${SRC_S16})
zephyr_library_sources(${SRC_S4} ${SRC_S8} ${SRC_S16})
endif()

if(CONFIG_CMSIS_NN_NNSUPPORT)
file(GLOB SRC "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s8*.c")
file(GLOB SRC_S4 "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s4*.c")
file(GLOB SRC_S8 "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s8*.c")
file(GLOB SRC_S16 "${CMSIS_NN_DIR}/Source/NNSupportFunctions/*_s16*.c")
zephyr_library_sources(${SRC} ${SRC_S16}
zephyr_library_sources(${SRC_S4} ${SRC_S8} ${SRC_S16}
${CMSIS_NN_DIR}/Source/NNSupportFunctions/arm_nntables.c
${CMSIS_NN_DIR}/Source/NNSupportFunctions/arm_q7_to_q15_with_offset.c
${CMSIS_NN_DIR}/Source/NNSupportFunctions/arm_s8_to_s16_unordered_with_offset.c)
Expand Down
5 changes: 2 additions & 3 deletions modules/tflite-micro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ if(CONFIG_TENSORFLOW_LITE_MICRO)
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/test_helper_custom_ops.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/recording_micro_allocator.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_time.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_string.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_profiler.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_utils.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/flatbuffer_utils.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_graph.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/mock_micro_graph.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_interpreter.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_interpreter_context.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_interpreter_graph.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_allocator.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_context.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/micro_log.cc
Expand All @@ -83,7 +83,6 @@ if(CONFIG_TENSORFLOW_LITE_MICRO)
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/flatbuffer_conversions.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/error_reporter.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/tensor_utils.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/core/api/op_resolver.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/schema/schema_utils.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/kernels/activations.cc
${TENSORFLOW_LITE_MICRO_DIR}/tensorflow/lite/micro/kernels/activations_common.cc
Expand Down
1 change: 1 addition & 0 deletions samples/modules/tflite-micro/hello_world/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ CONFIG_CPP=y
CONFIG_STD_CPP17=y
CONFIG_TENSORFLOW_LITE_MICRO=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_REQUIRES_FLOAT_PRINTF=y
1 change: 1 addition & 0 deletions samples/modules/tflite-micro/tflm_ethosu/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ CONFIG_TENSORFLOW_LITE_MICRO=y
CONFIG_ARM_ETHOS_U=y
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_LOG=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
2 changes: 1 addition & 1 deletion submanifests/optional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ manifest:
groups:
- optional
- name: tflite-micro
revision: 1a34dcab41e7e0e667db72d6a40999c1ec9c510c
revision: 48613f7ba1ffbda46ad771a77a35408f48f922e9
path: optional/modules/lib/tflite-micro
repo-path: tflite-micro
remote: upstream
JordanYates marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
1 change: 1 addition & 0 deletions tests/lib/cmsis_nn/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ ZTEST(cmsis_nn, test_convolve)
input_dims.c = CONV_4_IN_CH;
filter_dims.w = CONV_4_FILTER_X;
filter_dims.h = CONV_4_FILTER_Y;
filter_dims.c = CONV_4_IN_CH;
output_dims.w = CONV_4_OUTPUT_W;
output_dims.h = CONV_4_OUTPUT_H;
output_dims.c = CONV_4_OUT_CH;
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ manifest:
revision: 6489e771e9c405f1763b52d64a3f17a1ec488ace
path: modules/lib/cmsis-dsp
- name: cmsis-nn
revision: 0c8669d81381ccf3b1a01d699f3b68b50134a99f
revision: ea987c1ca661be723de83bd159aed815d6cbd430
Comment on lines 126 to +127
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on what we do for other modules (e.g. TF-M), it would make more sense to merge the CMSIS-NN v6.0.0 tag into the existing zephyr branch than to create and reference a separate zephyr-v6.0.0 branch.

Note that merge commits are allowed in the CMSIS-NN module repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes more sense is up to the repo maintainer to decide. For the other modules I control I create branches per upstream release, as I see more value in having a clean diff (that is possible to review) from the upsteam release than a linear commit history (e.g. https://github.com/zephyrproject-rtos/loramac-node).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes more sense is up to the repo maintainer to decide

Sure, as long as the maintainer sticks with only one method.

For the other modules I control I create branches per upstream release, as I see more value in having a clean diff (that is possible to review) from the upsteam release than a linear commit history

That makes sense; but, that does not seem to be how upstream syncs are meant to be handled for the particular module (especially, looking at the branch name) -- for example, what is the zephyr branch supposed to be after zephyr-v6.0.0 branch is created?

If you, as the maintainer of the CMSIS-NN module, decide to do this, it would only make sense to rename the existing zephyr branch accordingly.

On a side note, maybe we need a place to properly document how every module handles upstream syncs so that we do not end up with a mess like zephyr, zephyr-v2.6 and v4.7.0-zephyr, as seen in the loramac-node module repository.

path: modules/lib/cmsis-nn
- name: edtt
revision: 8d7b543d4d2f2be0f78481e4e1d8d73a88024803
Expand Down
Loading