43 Commits

Author SHA1 Message Date
jihandong
25937282ed ml: follow nxstyle
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
7d87768f78 ml: a cmdline tool to use tflite-micro.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
b91adbb9f2 ml: useful tflm debug options
print memory plan, and time cost of each operators.

Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
f2eb5cd3c4 ml: tflite extra hardware support.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
b15e71cd22 ml: update Makefile
-O3: reduce code size.
-DTF_LITE_STATIC_MEMORY: cause bugs on some cores.
+DTFLITE_EMULATE_FLOAT: robuster to emulate float cucalation by fix-point.
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
c585aa147a ml: clean tflite Makefile
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
958d8e03eb Modify the usage error of neon instruction set
The second argument of vgetq_lane_s32(__a, __b) needs to be initialized before compilation, so unroll the for loop. and correct the passed parameters.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
eb56c62dc9 cmake:add tflite-micro CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
8dfd998db1 cmake:add cmsis-nn CMake build
Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
dda8cab335 ml: tflm mean optimization patch
Separate the Int8 implementation of the 'mean' operator to reduce the code size.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
068b2b16bb ml: tflm quantize optimization patch
Separate the 'Float32 to Int8' implementation of the 'quantize' operator to reduce the code size.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
570102c501 delete the neon conv2D
The complete implementation is placed separately in mLearning/tflite-micro/operators/neon, delete this part.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
jihandong
14a591fab2 ml: tflm dequantize optimization patch
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
67f495e360 Added Cortex-A compilation environment.
Cortex-A compilation options are added to tflite-micro and cmsis-nn, and new operator compilation environments are configured.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
11519fe1ca Update third-party library version
Tflite-micro, ruy and cmsis-nn need to be updated to a new version.
Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
fb17e33894 Neon optimized Add operator
VELAPLATFO-25411

On the basis of CMSIS-NN, neon was used to optimize the Add operator, which calculates the offset and addition of eight input and output data in one loop.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
a37ca36a8a Neon optimized Conv operator
Based on CMSIS-NN, the Conv operator was optimized. Using Neon acceleration, multiply 8 input data and 8 filter data in a single loop; Using Im2col technology, convert the output data into a matrix, calculate 2 rows of input data and 4 rows of filter data in a single large loop, and obtain 2x4 output data.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
xinhaiteng
754d9e39a8 TFLM Cortex-A NEON Conv
Use neon to accelerate the conv op, and the output results are the same.

Signed-off-by: xinhaiteng <xinhaiteng@xiaomi.com>
2024-10-18 09:40:17 +08:00
renzhiyuan1
71cbcb2618 Add configurations files.
Add configuration files of TFLite Micro, its dependent third-party libraries and CMSIS_NN.

Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-18 09:40:17 +08:00
xuxin19
bdfce937e9 remove:flatbuffers,gemmlowp,kissfft,ruy repos
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-18 09:40:17 +08:00
dengwenqi
6b6e0783cf fix: git status/git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-18 09:40:17 +08:00
dengwenqi
06189b556c fix: git status/git status --ignore normalization check problem
Signed-off-by: dengwenqi <dengwenqi@xiaomi.com>
2024-10-18 09:40:17 +08:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
Nathan Hartman
8e77b79f78 Kconfig: Make indent consistent with TABS 2023-02-10 14:11:48 +08:00
chao an
42d34fcef3 build/Kconfig: fix warnings detected by kconfiglib
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 19:45:36 +08:00
yinshengkai
ee4d8b738f Makefile: replace INCDIR to INCDIR_PREFIX
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-10 02:38:58 +08:00
yinshengkai
2c3c2edcb7 Makefile: Remove INCDIROPT
This option, which resolves to -w when CONFIG_CYGWIN_WINTOOL is
configured, is now appended to INCDIR in tools/Config.mk.

See git commit # 5eae32577e5d5226e5d3027c169eeb369f83f77d in the main
2022-10-25 13:48:16 +08:00
Xiang Xiao
4941182cc6 Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
to support the tristate option correctly and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Huang Qi
2e2630e838 Don't download tarballs if a local git repo found
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-28 17:20:47 +08:00
liuhaitao
14030f6ba4 Add minmea and cmsis .gitignore files
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2022-08-16 12:50:26 +03:00
Alin Jerpelea
b065d72194 mlearning: add Darknet (Open Source Neural Networks in C)
Darknet is an open source neural network framework written
in C and CUDA. It is fast, easy to install, and supports
CPU and GPU computation.

You Only Look Once (YOLO) is a state-of-the-art,
real-time object detection system

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-05-31 23:33:29 +08:00
Peter Bee
2831af6395 apps/mlearning: tweak lib makefile
only one .c needed for each function group
add -flax-vector-conversions to avoid build error on gcc && M55

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-03-28 16:08:58 +08:00
Peter Bee
96efff32fe apps/mlearning: tweak lib makefile
only one .c needed for each function group
add -flax-vector-conversions to avoid build error on gcc && M55

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-03-28 16:08:58 +08:00
Alin Jerpelea
18609ab1df mlearning: cmsis: enable FPU support
In case of HW with FPU we can benefit from the FPU support.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-24 11:26:27 -03:00
Alin Jerpelea
67c05f172b mlearning: cmsis: libcmsisdsp: simplify config naming
the extra function configuration name can be simplified
for better readability

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-24 00:56:22 +08:00
Alin Jerpelea
a943184ab2 NNABLA: build as a module
NNABLA_RT should compile as a module to provide the necessary support
for the dnn test application

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-23 21:57:25 +08:00
Alin Jerpelea
0ee15da565 cmsis: build CMSIS support as a module
CMSIS should compile as a module to provide the necessary support
for the dnn test application

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-23 21:57:25 +08:00
Alin Jerpelea
0c69ccea18 libcmsisnn: add the new CHW functionality
The patch for CHW functionality has been added as a result we
can compile the new functions

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-23 21:57:25 +08:00
Alin Jerpelea
02a50ccb1f mlearning: CMSIS NN: add support for the CHW tensor layout
- support float version of convolution
 - support the CHW tensor layout

following function prototypes are added:
 - arm_convolve_CHW_f32_basic_nonsquare()
 - arm_convolve_CHW_q15_basic_nonsquare()
 - arm_convolve_CHW_q7_basic_nonsquare()
 - arm_nn_CHW_mat_mult_kernel_q7_q15()

NOTE:this patch will be contributed to SMSIS and reverted later from NuttX
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-19 00:54:49 +08:00
Alin Jerpelea
020503576c mlearning: nnabla: fix include path
During contribution the folders have moved and the path
should be updated

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-16 23:47:50 +08:00
Alin Jerpelea
5dc7694b17 Add support for CMSIS NN
the CMSIS NN software library is a collection of efficient neural
network kernels developed to maximize the performance and minimize
the memory footprint of neural networks on Cortex-M processor cores.

Project https://github.com/ARM-software/CMSIS_5

The library is divided into a number of functions each covering
a specific category:

    Convolution Functions
    Activation Functions
    Fully-connected Layer Functions
    SVDF Layer Functions
    Pooling Functions
    Softmax Functions
    Basic math Functions

The library has separate functions for operating on different weight
and activation data types including 8-bit integers (q7_t) and 16-bit
integers (q15_t). The descrition of the kernels are included in the
function description.

More information
https://www.keil.com/pack/doc/CMSIS/NN/html/index.html

Project license : Apache 2.0 License
https://github.com/ARM-software/CMSIS_5/blob/develop/LICENSE.txt

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-01 19:53:07 +08:00
Alin Jerpelea
53f6574054 Add support for NNabla C Runtime
This is a runtime library for inference Neural Network created
by Neural Network Libraries.

Project git: https://github.com/sony/nnabla-c-runtime

It is almost independent from external libraries(depends on C
standard math library) and is written in Pure C (C99).

It has been developed with priority over readability rather than
performance, making it ideal for learning and porting.
It adopts an extensible architecture, and you can use the function
you implemented yourself as necessary for applications that need performance.

Project license : Apache 2.0 License
https://github.com/sony/nnabla-c-runtime/blob/master/LICENSE

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-01-27 17:33:16 +08:00
Alin Jerpelea
2052adc90a add Machine Learning folder and menu
This is a placeholder to group Machine Learning functionality
for microcontrolers.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-01-27 17:33:16 +08:00