Add a comprehensive Jupyter notebook tutorial demonstrating TFLM's
compression pipeline using the MNIST dataset. The tutorial covers weight
clustering with TensorFlow Model Optimization toolkit, post-training
quantization, and TFLM's LUT-based compression.
Update documentation to reference the new tutorial from the main README,
Python interpreter guide, and compression documentation.
BUG=#2636
Co-authored-by: Esun Kim <veblush@google.com>
- Improved ci/Dockerfile.micro further by
- Installing QEMU from packages
- Optimizing the docker definition by combining multiple layers into single layer to reduce the footprint.
BUG=Clean-up
Enhance compress() function to automatically apply proper
FlatBuffer alignment after compression, eliminating the need for
users to manually run tflite_flatbuffer_align as a separate step.
Use the C++ alignment wrapper internally, as the Python
flatbuffers library doesn't respect force_align schema
attributes.
Keep the API unchanged - compress() still returns a bytearray,
but now the output is properly aligned for the TFLM interpreter.
Update documentation, and build dependencies of the Python
package.
BUG=#3125
Clarify the usage of `MicroContext::AllocateDecompressionScratchBuffer`
and`tflite::micro::GetTensorData` for handling decompressed tensor
data.
Add a section on alternate decompression memory regions,
explaining how to specify and use specialized memory for
decompression.
Update instructions for compressing models using a YAML
specification.
Simplify the model compression and alignment command examples.
Spin off new Generic Benchmark Application documentation.
BUG=part of #2636
Begin using -std=c++17 and -std=c17 in Makefile builds on
all platforms. Bazel builds have been using C++17 since 52c9568.
Set `-stdlib=libc++ on xt-clang` on Xtensa to add C++17 library
support in addition to compiler support. From the xt-clang docs:
Starting with the RI-2019.1 release, XT-CLANG has included support
for C++14 and C++17 language features. The compiler support for
C++14 and C++17 is accompanied by the C++ library from the LLVM
project. This library can be selected with the -stdlib=libc++
option, and this is strongly recommended when compiling with
-std=c++14 or - std=c++17. Starting with the RI-2021.6 release, two
additional versions of this C++ library are provided— one that
excludes support for exception handling, and one that excludes both
exception handling and run-time type identification. These libraries
can be selected with -stdlib=libc ++-e and -stdlib=libc++-re options
respectively.
Based on the `docker run` command in
tflite-micro/.github/workflows/xtensa_presubmit.yml, our CI is
currently using RI-2020.4.
Refactor the make/ext_libs/xtensa_download.sh script to make it eaiser
to patch downloads for all Xtensa platforms. The old script made overly
strict assumptions about the name of the patch.
Patch the Xtensa vision_p6 platform download xi_tflmlib_vision_p6 for
compatibility with the C++ library standard. Use the header <climits> to
access constants such as INT_MAX.
BUG=#2650
Adds a build flag that can be used by any kernel to provide a different implementation depending on use case.
Adds a first use case for cmsis-nn transpose conv.
The background for this PR is in https://github.com/tensorflow/tflite-micro/pull/2345
BUG=none
Addresses #1891 and adds Cortex M QEMU based unit tests to the CI flow.
Verification:
1. From repo root, run the command `tensorflow/lite/micro/tools/ci_build/test_cortex_m_qemu.sh`
2. Verify that all tests pass
Note this doesn't remove or change anything related to renode, for the sake of brevity, but we can remove renode here if desired.
BUG=1891
In https://github.com/tensorflow/tflite-micro/pull/947 support for multiple subgraphs was added to the memory planner. However, in case memory planning information was provided offline this would not work since it would only read the planning data for the first subgraph. This PR fixes that.
The fix itself is simple and local to the function, assuming all offline planned tensors are just concatenated, e.g.: `[s0t0, s0t1, s1t0, s2t1, s1t2, s3t0, s3t1, s3t2, s3t3]`. The documentation is updated to reflect this.
The metadata format also had a subgraph ID according to the documentation, but that was never read. I tried to use that but that wouldn't work either, because it would only hold one subgraph ID and we can only have one meta-data with a given name. So I'm not sure how this was intended to be used originally but I added a note to the documentation and the code to clarify that it is unused at the moment.
BUG=see PR description
We are moving in a direction where the goal of the code within the TFLM examples directory is to illustrate how to use different functionality of the framework.
Examples that don't exercise very different functionality from the others can be removed.
BUG=cleanup
TFLM recommends the use of MicroPrintf for logging messages to the terminal. This PR adds that information to the existing documentation.
BUG=http://b/245802069
With help from @PiotrZierhoffer, this PR updates TFLM to use the Renode release from Oct 3 (renode-1.13.2.linux-portable).
Manually confirmed that I can run the following command locally (http://b/257332395):
```
make -f tensorflow/lite/micro/tools/make/Makefile TARGET=bluepill test -j8
```
BUG=http://b/260027053 and http://b/257332395
This PR-
1. Changes the TFLite Micro Framework classes to eliminate the usage of `MicroErrorReporter` and `ErrorReporter` classes.
2. Keeps the version of the APIs, that expect ErrorReporter for backwards compatibility.
- This compatibility is limited to the bare minimum set of API currently being used.
- The minimum support to the version of API expecting ErrorReporter will be removed as a follow-up PR, expected to be merged next week.
- Any new applications or examples using TFLM should no longer be creating and passing-in an ErrorReporter.
BUG=http://b/245802069
* Add Arm IP landing page readme
Plus re-phrasing and spelling fixes in other Arm readme's
Change-Id: I95b43850026b1fa45285fe044cf0ef5c119c114d
* Add clarification as per code review comment
Change-Id: I650c7ac21f2385339b607f49bf309fc51298de2f
* Adding Arm as subchapter. As per review comment.
Change-Id: Ida7598a6f561fb25bde968632551890712c7a557
Co-authored-by: Pauline Sho <psho@google.com>
I was reading the optimized_kernel_implementations.md and I noticed multiply characters inline with the text. I believe the items were supposed to be shown as an unordered list and not inline.
I fixed the structure so that they now show up as an unordered list
In addition, this PR also removes support for the Makefile based project generation.
Relevant issues:
* https://github.com/tensorflow/tflite-micro/issues/407
* https://github.com/tensorflow/tflite-micro/issues/445
The documentation, tests for the examples etc. still need to be updated,
and that will be addressed in follow-up PRs.
Additionally, there are some existing users that may not have fully
transitioned over to the new project generation and examples guidance.
This will be a breaking change for these users but is something that we
need to do to make progress on the goals of #407.
BUG=#407
This memory plan specifies the memory layout of all non persistent
buffers in the arena.
This is an early stage exploration of what the next version of
offline memory planning in TFLM might look like; thus this is
an experimental feature subjected to change.
This corresponds to internal c/401255189
BUG=http://b/199230276
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
* 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.
* Add files from TfLite
Added batch_matmul.h and tensor_utils_common.h that are needed for the BATCH_MATMUL operator.
* Add FAQ section
Add frequently asked questions section with regard to memory allocation and tensor structure manipulation.
bug=Add FAQ to reference op porting document #383
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
* Fix broken links to images in preallocated tensors RFC.
* Update links to refer to the new repo.
* Add line breaks to make it easier to read.
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>