Commit graph

260 commits

Author SHA1 Message Date
TFLM-bot
5dfdc446b7
Automated sync from github.com/tensorflow/tensorflow (#573) 2021-10-05 21:15:28 +00:00
Advait Jain
85817467ae
Comment out bazel Xtensa dependencies to fix the sync. (#569) 2021-10-04 20:12:40 -07:00
Nat Jeffries
13c69667be
Add features to cast, add slice, clean up split. (#568) 2021-10-04 15:33:41 -07:00
Jack Arendt
9aba3b7cfd
Added AddExp() to all_ops_resolver. (#567)
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-10-04 13:32:01 -07:00
Advait Jain
648ba296d9
Separated out the TFLM examples from the kernels and unit test builds. (#565)
The kernel and unit test list is going to be smaller (and have all the
code and CI be part of the TFLM repo).

The examples list is expected to grow and will be maintained external to
the TFLM repository as described in #407.

BUG=#407
2021-10-04 12:46:35 -07:00
Jack Arendt
115a93e4b1
Fixed buildifier error from bazel macro. (#562) 2021-10-01 23:08:12 +00:00
Jack Arendt
6ac817d5dc
Added xtensa kernels to be bazel compatible (#561)
* Added xtensa kernels to be bazel compatible

* Addressed PR comment feedback.

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-10-01 21:40:30 +00:00
cad-audio
b547789f3e
LSTM : code refactor and cleanup. (#537)
* LSTM : code refactor and cleanup.

BUG= microspeech model with lstm op on HiFi5 DSP

* removed unused floating point function call.

* clang-format

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
Co-authored-by: Advait Jain <advaitjain@google.com>
2021-10-01 18:25:40 +00:00
cad-audio
be60ead37c
REF_CODE_REFACTOR: Add, Mul and Sub (#348)
* REF_CODE_REFACTOR: Add, Mul and Sub
Refactoring the reference code for Add, Mul and Sub operators.

BUG=refactoring existing code.

* Small updates, and fix CMSIS build.

* Fix the build

* Fix cmsis_nn kernels.

Co-authored-by: Advait Jain <advaitjain@google.com>
2021-10-01 17:55:35 +00:00
deqiangc
69722ade7d
Add a document to describe one methodology of getting the TFLite Micro Framework code size (#549)
and add two example binaries for this purpose.

This corresponds to internal cl/399961397

BUG=http://b/200874024
2021-09-30 22:43:15 +00:00
Nat Jeffries
901e4df110
Add support for generating cc arrays from csv files. (#548)
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-30 20:46:19 +00:00
Advait Jain
2a245675a4
Remove unused function. (#546)
This causes internal checks to fail when importing from github.

BUG=cleanup
2021-09-30 18:16:49 +00:00
Shlomi Regev
08b59dc357
Patch KissFFT to perform float type cast correctly (#543) 2021-09-28 17:02:29 -07:00
rockyrhodes
dad21d3e25
Fix dependency for memory_arena_threshold_test. (#542)
BUG=179816930
2021-09-28 16:52:48 +00:00
rockyrhodes
de8f61a074
Add full 8bit version of keyword benchmark. (#540) 2021-09-28 09:13:46 -07:00
rockyrhodes
f4678f27d0
Generate keyword benchmark data from model. (#538) 2021-09-27 15:54:03 -07:00
Måns Nilsson
2226f6d0b9
Add option to provide an external CMSIS-NN lib (#487)
* Add option to provide an external CMSIS-NN lib

* Update CMSIS-NN README with new Mbed build instruction

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-27 21:34:59 +00:00
Shlomi Regev
de29703ba0
Wrap 16-bit Kiss FFT in a C++ namespace (#536)
* Wrap 16-bit Kiss FFT in a C++ namespace

This will enable us to support multiple copies of Kiss FFT for different
resolutions within the same application without running into linker
errors.

BUG=200737980

* Fix Bazel build by upgrading kissfft version to a version that has proper inclusion guards.

For Make build, where the include guards are patched in, change the
guards to a canonical format.

* missing header file and fix namespace wrapper.

* Sub extern C with extern C++ instead of undef-ing __cplusplus, which broke standard headers.

* Stop building kiss_fft source file. Instead, they are included in type-specific namespace wrappers

* Remove Kiss FFT source files from project generation makefile and consider kiss FFT .c files as headers

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-27 12:00:36 -07:00
Advait Jain
d044d60a86
Remove unused code. (#529)
BUG=cleanup and http://b/189926408#comment28
2021-09-24 19:51:03 -07:00
TFLM-bot
5b10619d8a
Sync from upstream TF. (#535) 2021-09-24 09:23:47 -07:00
TFLM-bot
392a7f30e4
Sync from upstream TF. (#533) 2021-09-23 15:45:39 -07:00
Advait Jain
f314a1c342
__restrict__ is an unnecessary optimization in the reference code. (#530)
If needed, we will need to add an ifdef similar to 180de4b73b/tensorflow/lite/kernels/internal/portable_tensor_utils.h (L26-L28)

BUG=cleanup and http://b/189926408#comment28
2021-09-22 23:19:01 +00:00
Advait Jain
a444b4bf27
Update flexbuffer patching to make it work with Visual Studio. (#531)
BUG=http://b/189926408#comment28
2021-09-22 16:00:11 -07:00
cad-audio
180de4b73b
Cadence HiFi5 NN Library: Softmax operator. (#424)
* Cadence HiFi5 NN Library: Softmax operator.
Integrating int8 input and int8 output optimized variant of softmax
funciton.

* small changes.

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
Co-authored-by: Advait Jain <advaitjain@google.com>
2021-09-21 21:56:48 +00:00
nyadla-sys
7011fff548
lstm:remove nested xtensa directory structure (#526)
Remove nested xtensa directory structure within kernels/xtensa/

Signed-off-by: Niranjan Yadla <nyadla@cadence.com>
2021-09-21 21:17:51 +00:00
Advait Jain
226f214301
Progress towards a working project generation with Xtensa. (#525)
Manually tested that the following command:
```
python tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py --makefile_options="TARGET=xtensa OPTIMIZED_KERNEL_DIR=xtensa TARGET_ARCH=hifi4 XTENSA_CORE=F1_190305_swupgrade" /tmp/tflm-xtensa
```

results in an output tree that has the header files for xa_nnlib as well
as the headers in tensorflow/micro/kernels/xtensa.

We are currently in the prototyping stage for http://b/194200306 so this
change does not include any CI for Xtensa + project generation.

BUG=http://b/194200306
2021-09-21 20:37:20 +00:00
rockyrhodes
c8c08497e0
Add reference kernel support for SVDF op with all 8 bit weights and state (#506) 2021-09-21 09:58:44 -07:00
Advait Jain
192c793bf2
Revert "Workaround for failing arm-gcc download." (#522)
This reverts commit 111411523b.
2021-09-20 23:59:43 +00:00
deqiangc
02898348ac
Add a hexagon build presubmit (#518)
* Add a hexagon build presubmit
Also update Hexagon Docker file

* Add a todo for to enable unit test for hexagon

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-20 22:59:30 +00:00
TFLM-bot
26a28789f3
Sync from upstream TF. (#519) 2021-09-18 10:03:50 -07:00
Advait Jain
4f6c514dd5
Hifi5 optimizations for Pooling. (#326)
The current PR takes the changes from
https://github.com/tensorflow/tflite-micro/pull/139 and applies them to
the refactored pooling kernels to increase the shared code between the
reference and optimized kernels.

BUG=#325

Co-authored-by: Nat Jeffries <natmjeffries@gmail.com>
2021-09-17 18:39:10 +00:00
TFLM-bot
0f40100fc6
Automated sync from github.com/tensorflow/tensorflow (#517) 2021-09-17 11:24:42 -07:00
Advait Jain
257f47fb6c
Update the docs (#516)
* we now accept a lot more types of contributions and have improved the documentation.
 * add link to the kernel porting guide from the readme.
 * small updates to the op porting guide.
2021-09-16 12:36:02 -07:00
TFLM-bot
080db2db55
Automated sync from github.com/tensorflow/tensorflow (#514) 2021-09-16 08:27:59 -07:00
Advait Jain
fc6fede6c8
Remove -DTF_LITE_STATIC_MEMORY from bazel CI checks. (#511)
We do not use the bazel build with `-DTF_LITE_STATIC_MEMORY` and having that be part of the CI can cause confusion.

BUG=cleanup
2021-09-15 21:38:20 +00:00
TFLM-bot
9d0e269238
Automated sync from github.com/tensorflow/tensorflow (#495)
* Sync from upstream TF.

* Manual fixes to get the presubmit checks to pass.

* nit change.

Co-authored-by: Advait Jain <advaitjain@google.com>
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-15 21:04:33 +00:00
Advait Jain
111411523b
Workaround for failing arm-gcc download. (#509)
BUG=#508 and http://b/200052821
2021-09-15 12:23:10 -07:00
Advait Jain
1ef3830fa6
Remove mbed Makefile integration from TFLM. (#503)
The recommended way to use mbed is via the project generation Python
script:
 * https://github.com/tensorflow/tflite-micro/issues/423#issuecomment-915653426
 * https://github.com/tensorflow/tflite-micro/issues/475#issuecomment-915649543

BUG=#407
2021-09-13 22:44:42 +00:00
Advait Jain
09eef73804
Remove (most of the) Arduino-specific and SparkfunEdge-specific code. (#501)
Additional context is in https://github.com/tensorflow/tflite-micro/issues/407

The Arduino code was previously deleted with
https://github.com/tensorflow/tflite-micro/pull/393, but that got merged
incorrectly and had to be reverted with 94ddbfe8ba

BUG=http://b/193823889 and #407
2021-09-13 22:27:36 +00:00
Advait Jain
70d160ae53
Remove some of the hardware specific code that has not been updated for a while. (#502)
We are moving towards removing ***all*** hardware-specific example code
out of the TFLM repository, and this PR is a step in that direction.

BUG=https://github.com/tensorflow/tflite-micro/issues/407
2021-09-13 21:34:43 +00:00
nyadla-sys
52bd2f2c07
lstm:training micro speech lstm model (#473)
* lstm:training micro speech lstm model

Signed-off-by: Niranjan Yadla <nyadla@cadence.com>

* Updated Makefile.inc

* Removed files that should not be needed

 * The model file is directly committed into the repository (and converted
   to model.cc and model.h during the Makefile build)
 * So, we do not need model.zip in the train folder and we do not need
   model.cc and model.h either.
 * We do need bazel support for this example (removed the BUILD file).

Also, chmod -x for some of the files.

* Remove unnecessary maxdepth parameter.

* ADD LICENSE file

Co-authored-by: Advait Jain <advaitjain@google.com>
2021-09-13 16:33:15 +00:00
TFLM-bot
d41f2011f3
Automated sync from github.com/tensorflow/tensorflow (#494) 2021-09-10 08:59:05 -07:00
Nat Jeffries
60f9ca81bc
Add hooks to recording micro interpreter. (#493) 2021-09-09 21:16:32 +00:00
deqiangc
a1f4b8804d
Refactor MicroAllocator such that a MemoryPlanner can be injected into the MicroAllocator (#492)
This is the first step to allow offline memory planner.

When a MemoryPlanner is not injected at creation time for
a MicroAllocator, a default GreedyMemoryPlanner is created
from the arena. This change is hence backward compatible
at the MicroAllocator api level. The arena usage slightly increase
by 80 bytes on linux x86 due to the GreedyMemoryPlanner is moved from
stack to the arena in such case.

This corresponds to internal cl/395749105

BUG=http://b/199230276
2021-09-09 12:50:24 -07:00
deqiangc
5e65f82045
Rename MemoryPlanner to MicroMemoryPlanner (#490)
* Rename MemoryPlanner to MicroMemoryPlanner.

This is to avoid the conflict with the duplicated MemoryPlanner
symbol in tflite. Such conflict arise because some projects
use both tflite and tflite micro.

This corresponds to internal cl/395557573

BUG=http://b/199230276

* Fix formatting errors

Lessons learned: some format errors prevent push
and some don't.
2021-09-09 00:30:05 +00:00
Måns Nilsson
7ca150eefc
Enable disabled tests for FVP target (#479)
* Enable disabled tests for FVP target

Change-Id: Ic03265cf9904f9616a956851ff61cf76d5ce9575

* Enable more disabled tests for FVP target

* Fix bazel build of micro_error_reporter test

* Fix clang-format

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-08 23:10:00 +00:00
Nat Jeffries
cefb91622f
Add generated sources to makefile project gen. (#489) 2021-09-08 17:33:39 +00:00
Shlomi Regev
f75696cb9e
Some improvements to build scripts (#481)
1. Add TENSORFLOW_ROOT as a prefix to paths in helper_functions.inc. This enables us to include this file from an external directory. Useful when building a custom op library.
2. Add a script size_hexagon_binary.sh to measure the size of a Hexagon binary, and a matching make macro/rule to invoke it. Similar scripts can be created for any target.
3. Lint fixes to generate_cc_array.py
4. Move HEXAGON_TFLM_LIB from the ext_lib makefile to
hexagon_makefile.inc. This library is needed by any binary, so it
belongs on the LDFLAGS.

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-07 17:10:57 +00:00
Nat Jeffries
26944780f4
TFLM changes to support resource variables. (#482) 2021-09-07 09:21:53 -07:00
TFLM-bot
2925fc5efb
Sync from upstream TF. (#478)
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-09-02 11:29:09 -07:00