Skip to content

Commit 0e7c600

Browse files
committed
Rolling v10.6.1
1 parent 189093d commit 0e7c600

File tree

209 files changed

+1791
-12917
lines changed

Some content is hidden

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

209 files changed

+1791
-12917
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
5252

5353

5454

55-
##### 10.6.0 - Stability Increase (2022-07-17)
55+
56+
##### 10.6.1 - Stability Increase (2022-07-24)
57+
58+
- **NEW 10.6.1**: Revoke esp32cam & tflite update
59+
60+
- **NEW 10.6.1**: Bug Fix: tflite-filename with ".", HTML spelling error
5661

5762
- IndluxDB: direct injection into InfluxDB - thanks to **[wetneb](https://github.com/wetneb)**
5863

code/components/esp-nn/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ set(c_srcs
55
"src/basic_math/esp_nn_add_ansi.c"
66
"src/basic_math/esp_nn_mul_ansi.c"
77
"src/convolution/esp_nn_conv_ansi.c"
8-
"src/convolution/esp_nn_conv_opt.c"
98
"src/convolution/esp_nn_depthwise_conv_ansi.c"
10-
"src/convolution/esp_nn_depthwise_conv_opt.c"
119
"src/fully_connected/esp_nn_fully_connected_ansi.c"
1210
"src/softmax/esp_nn_softmax_ansi.c"
1311
"src/softmax/esp_nn_softmax_opt.c"
@@ -25,7 +23,7 @@ if(CONFIG_IDF_TARGET_ESP32S3)
2523
"src/convolution/esp_nn_conv_esp32s3.c"
2624
"src/convolution/esp_nn_depthwise_conv_s8_esp32s3.c"
2725
"src/convolution/esp_nn_conv_s16_mult8_esp32s3.S"
28-
"src/convolution/esp_nn_conv_s8_mult8_1x1_esp32s3.S"
26+
"src/convolution/esp_nn_conv_s16_mult8_1x1_esp32s3.S"
2927
"src/convolution/esp_nn_conv_s16_mult4_1x1_esp32s3.S"
3028
"src/convolution/esp_nn_depthwise_conv_s8_mult1_3x3_padded_esp32s3.S"
3129
"src/convolution/esp_nn_depthwise_conv_s16_mult1_esp32s3.S"

code/components/esp-nn/Kconfig.projbuild

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ choice NN_OPTIMIZATIONS
66
help
77
Use ANSI-C versions for verification and debug purpose.
88
Optimisations are automatically picked up for a chipset.
9-
For ESP32-S3, assembly optimisations are selected.
10-
For other platforms(viz., ESP32, ESP32-C3), generic optimisations are used.
9+
For ESP32-S3, assembly Optimisations are selected.
10+
For ESP32, just the ANSI C versions are selected for now.
1111

1212
config NN_ANSI_C
1313
bool "ANSI C"
@@ -17,8 +17,8 @@ config NN_OPTIMIZED
1717
bool "Optimized versions"
1818
help
1919
Optimisations are automatically picked up for a chipset.
20-
For ESP32-S3, assembly optimisations are selected.
21-
For other platforms(viz., ESP32, ESP32-C3), generic optimisations are used.
20+
For ESP32-S3, assembly Optimisations are selected.
21+
For ESP32, just the ANSI C versions are selected for now.
2222
endchoice
2323

2424
config NN_OPTIMIZATIONS

code/components/esp-nn/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ The library contains optimised NN (Neural Network) functions for various Espress
77

88
* Supported ESP chipsets include:
99
* ESP32-S3 (Assembly versions optimised to benefit from vector instructions of ESP32-S3)
10-
* ESP32 (Generic optimisations)
11-
* ESP32-C3 (Generic optimisations)
10+
* ESP32 (ANSI C versions)
1211

1312
## Performance
1413

@@ -40,8 +39,8 @@ The library contains optimised NN (Neural Network) functions for various Espress
4039
* Optimized versions
4140
* ANSI C
4241

43-
* Default selection is for `Optimized versions`. For ESP32-S3, assembly versions are automatically selected, whereas for other chipsets (viz., ESP32, ESP32-C3), generic optimisations are selected.
44-
* For debugging purposes, you may want to select `ANSI C` reference versions.
42+
* Default selection is for `Optimized versions`. For ESP32-S3, assembly versions are automatically selected, whereas for ESP32, ANSI-C versions are selected by default.
43+
* For debugging purposes, you may want to select `ANSI C`
4544

4645

4746
## Contributing

code/components/esp-nn/include/esp_nn.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#pragma once
1616

1717
#if defined(CONFIG_NN_OPTIMIZED)
18-
// select apt optimisations
1918
#ifdef CONFIG_IDF_TARGET_ESP32S3
2019
#define ARCH_ESP32_S3 1
2120
#endif
@@ -32,11 +31,12 @@ extern "C" {
3231
#include "esp_nn_ansi_headers.h"
3332

3433
#if defined(CONFIG_NN_OPTIMIZED)
35-
#if defined(ARCH_ESP32_S3)
34+
#ifdef ARCH_ESP32_S3
3635
#include "esp_nn_esp32s3.h"
37-
#else // for other platforms use generic optimisations
38-
#include "esp_nn_generic_opt.h"
39-
#endif // #if defined(ARCH_ESP32_S3)
36+
#endif
37+
#ifdef ARCH_ESP32
38+
#include "esp_nn_esp32.h"
39+
#endif
4040
#else
4141
#include "esp_nn_ansi_c.h"
4242
#endif

code/components/esp-nn/include/esp_nn_ansi_c.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#pragma once
2121

22-
#include "esp_nn_defs.h"
2322
#include "esp_nn_ansi_headers.h"
2423

2524
#define esp_nn_add_elementwise_s8 esp_nn_add_elementwise_s8_ansi

code/components/esp-nn/include/esp_nn_ansi_headers.h

Lines changed: 56 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
* @file Header definitions to include for esp_nn reference functions
1919
*/
2020

21-
#include "esp_nn_defs.h"
21+
#include <stdint.h>
22+
2223
/************************** Basic math functions ****************************/
2324

2425
/**
@@ -80,15 +81,28 @@ void esp_nn_mul_elementwise_s8_ansi(const int8_t *input1_data,
8081
* optimization notes: Though input_offset is int32 type,
8182
* offset values are contained in 8 bits [-128, 127]
8283
*/
83-
void esp_nn_depthwise_conv_s8_ansi(const data_dims_t *input_dims,
84-
const int8_t *input_data,
85-
const data_dims_t *filter_dims,
84+
void esp_nn_depthwise_conv_s8_ansi(const int8_t *input_data,
85+
const uint16_t input_wd,
86+
const uint16_t input_ht,
87+
const uint16_t channels,
88+
const int32_t input_offset,
89+
const uint16_t pad_wd,
90+
const uint16_t pad_ht,
91+
const uint16_t stride_wd,
92+
const uint16_t stride_ht,
93+
const uint16_t ch_mult,
8694
const int8_t *filter_data,
95+
const uint16_t filter_wd,
96+
const uint16_t filter_ht,
8797
const int32_t *bias,
88-
const data_dims_t *output_dims,
8998
int8_t *out_data,
90-
const dw_conv_params_t *conv_params,
91-
const quant_data_t *quant_data);
99+
const uint16_t out_wd,
100+
const uint16_t out_ht,
101+
const int32_t out_offset,
102+
const int32_t *out_shift,
103+
const int32_t *out_mult,
104+
const int32_t activation_min,
105+
const int32_t activation_max);
92106

93107
/**
94108
* @brief 2d-convolution channelwise
@@ -98,26 +112,43 @@ void esp_nn_depthwise_conv_s8_ansi(const data_dims_t *input_dims,
98112
* inputs type: int8_t, output: int8_t
99113
* input offsets: although int32_t, they are contained in 8 bits [-128, 127]
100114
*/
101-
void esp_nn_conv_s8_ansi(const data_dims_t *input_dims,
102-
const int8_t *input_data,
103-
const data_dims_t *filter_dims,
115+
void esp_nn_conv_s8_ansi(const int8_t *input_data,
116+
const uint16_t input_wd,
117+
const uint16_t input_ht,
118+
const uint16_t in_channels,
119+
const int32_t input_offset,
120+
const uint16_t pad_wd,
121+
const uint16_t pad_ht,
122+
const uint16_t stride_wd,
123+
const uint16_t stride_ht,
104124
const int8_t *filter_data,
125+
const uint16_t filter_wd,
126+
const uint16_t filter_ht,
105127
const int32_t *bias,
106-
const data_dims_t *output_dims,
107128
int8_t *out_data,
108-
const conv_params_t *conv_params,
109-
const quant_data_t *quant_data);
110-
111-
int esp_nn_get_conv_scratch_size_ansi(const data_dims_t *input_dims,
112-
const data_dims_t *filter_dims,
113-
const data_dims_t *output_dims,
114-
const conv_params_t *conv_params);
129+
const uint16_t out_wd,
130+
const uint16_t out_ht,
131+
const uint16_t out_channels,
132+
const int32_t out_offset,
133+
const int32_t *out_shift,
134+
const int32_t *out_mult,
135+
const int32_t activation_min,
136+
const int32_t activation_max);
137+
138+
int esp_nn_get_conv_scratch_size_ansi(const uint16_t input_wd,
139+
const uint16_t input_ht,
140+
const uint16_t in_ch,
141+
const uint16_t out_ch,
142+
const uint16_t filter_wd,
143+
const uint16_t filter_ht);
115144
void esp_nn_set_conv_scratch_buf_ansi(const void *buf);
116145

117-
int esp_nn_get_depthwise_conv_scratch_size_ansi(const data_dims_t *input_dims,
118-
const data_dims_t *filter_dims,
119-
const data_dims_t *output_dims,
120-
const dw_conv_params_t *conv_params);
146+
int esp_nn_get_depthwise_conv_scratch_size_ansi(const uint16_t input_wd,
147+
const uint16_t input_ht,
148+
const uint16_t channels,
149+
const uint16_t ch_mult,
150+
const uint16_t filter_wd,
151+
const uint16_t filter_ht);
121152
void esp_nn_set_depthwise_conv_scratch_buf_ansi(const void *buf);
122153

123154
/************************** Activation functions *****************************/
@@ -221,6 +252,9 @@ int32_t esp_nn_get_softmax_scratch_size_opt(const int32_t width, const int32_t h
221252
*/
222253
void esp_nn_set_softmax_scratch_buf_ansi(void *buffer);
223254

255+
/* ANSI C function to be hooked up when optimised version needed */
256+
void esp_nn_set_softmax_scratch_buf_opt(void *buffer);
257+
224258
/**
225259
* @brief reference softmax function
226260
*
@@ -234,66 +268,6 @@ void esp_nn_softmax_s8_ansi(const int8_t *input_data,
234268
const int32_t diff_min,
235269
int8_t *output_data);
236270

237-
238-
//////////////////////////// Generic optimisations /////////////////////////////
239-
240-
/************************** Convolution functions *****************************/
241-
242-
/**
243-
* @brief 2d-convolution channelwise optimized version
244-
*
245-
* @note operation: result += (input + offset) * filter
246-
*
247-
* inputs type: int8_t, output: int8_t
248-
* input offsets: although int32_t, they are contained in 8 bits [-128, 127]
249-
*/
250-
void esp_nn_conv_s8_opt(const data_dims_t *input_dims,
251-
const int8_t *input_data,
252-
const data_dims_t *filter_dims,
253-
const int8_t *filter_data,
254-
const int32_t *bias,
255-
const data_dims_t *output_dims,
256-
int8_t *out_data,
257-
const conv_params_t *conv_params,
258-
const quant_data_t *quant_data);
259-
260-
/**
261-
* @brief depthwise convolution per channel optimized version
262-
*
263-
* @note inputs type: int8_t, output: int8_t
264-
* Version used in tflite is per channel.
265-
* This version follows the same footsprints.
266-
* Meaning, it has per out_channel shift and multiplier for
267-
* requantization
268-
*
269-
* optimization notes: Though input_offset is int32 type,
270-
* offset values are contained in 8 bits [-128, 127]
271-
*/
272-
void esp_nn_depthwise_conv_s8_opt(const data_dims_t *input_dims,
273-
const int8_t *input_data,
274-
const data_dims_t *filter_dims,
275-
const int8_t *filter_data,
276-
const int32_t *bias,
277-
const data_dims_t *output_dims,
278-
int8_t *out_data,
279-
const dw_conv_params_t *conv_params,
280-
const quant_data_t *quant_data);
281-
282-
int esp_nn_get_conv_scratch_size_opt(const data_dims_t *input_dims,
283-
const data_dims_t *filter_dims,
284-
const data_dims_t *output_dims,
285-
const conv_params_t *conv_params);
286-
void esp_nn_set_conv_scratch_buf_opt(const void *buf);
287-
288-
int esp_nn_get_depthwise_conv_scratch_size_opt(const data_dims_t *input_dims,
289-
const data_dims_t *filter_dims,
290-
const data_dims_t *output_dims,
291-
const dw_conv_params_t *conv_params);
292-
void esp_nn_set_depthwise_conv_scratch_buf_opt(const void *buf);
293-
294-
/* ANSI C function to be hooked up when optimised version needed */
295-
void esp_nn_set_softmax_scratch_buf_opt(void *buffer);
296-
297271
/**
298272
* @brief optimised version of softmax function
299273
*

code/components/esp-nn/include/esp_nn_defs.h

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)