Commit graph

42 commits

Author SHA1 Message Date
Esun Kim
aa7d6f9fd8
Added Error Handling & Defensive Programming Guide (#3539)
* Added Error Handling & Defensive Programming Guide

* Review
2026-06-30 22:24:50 +00:00
Esun Kim
d7f46b6fb7
[Doc] Fix typos (#3446)
* Fix typos

* Typos

* More

* Last
2026-02-11 17:18:49 +00:00
Ryan Kuester
c3c78cb7ea
docs(compression): add MNIST compression tutorial (#3224)
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>
2025-10-17 10:01:13 -07:00
Esun Kim
7ba714a6d6
Updated QEMU doc (#3210)
* Updated QEMU doc

* Fix

* Fix linter issues
2025-10-02 10:40:34 -07:00
Esun Kim
6fce200982
[CI] Install qemu (#3201)
- 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
2025-09-24 07:27:47 +00:00
Ryan Kuester
93ebaa9ca4
feat(compression): integrate automatic FlatBuffer alignment (#3177)
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
2025-09-03 22:19:19 +00:00
David Davis
a8d13ff1ea
Update kernel porting documentation (#3144)
@tensorflow/micro

Updates/corrections to the FAQ section
Add tensor inspection to the FAQ section

bug=fixes #3143
2025-08-01 20:56:27 +00:00
Ryan Kuester
cc09a49b9b
docs: update compression documentation (#3020)
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
2024-12-17 23:37:12 +00:00
Måns Nilsson
e440f0ab81
Update CMSIS third party download (#2716)
CMSIS is updated from CMSIS_5 to CMSIS_6.

BUG=It is recommended to upgrade from CMSIS_5 to CMSIS_6
2024-10-28 19:16:43 +00:00
David Davis
e3f6dc1ff1
Compression documentation (#2711)
@tensorflow/micro

Add documentation describing some compression/decompression internals and makefile build procedures.

bug=#2710
2024-10-03 17:45:00 +00:00
Ryan Kuester
6c6e9b3eca
build: begin using -std=c++17 and c17 in Makefile builds (#2648)
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
2024-08-01 21:30:54 +00:00
StrugglingBunny
f6403469b4
Update new_platform_support.md (#2603)
Change link of system_setup.h

BUG=cleanup
2024-06-18 18:45:35 +00:00
Måns Nilsson
8085cecefc
Add kernel build flag for prioritizing speed or size (#2408)
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
2024-02-23 18:03:57 +00:00
Mike Bernico
5d81216567
Add QEMU Emulation to CI flow (#1892)
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
2023-04-14 07:11:10 +00:00
Cedric Nugteren
e60e8caf5d
Add support for offline planning in case of multiple subgraphs (#1195)
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
2023-03-29 04:05:07 +00:00
Advait Jain
bef8fe8bc6
Delete the magic_wand example (#1851)
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
2023-03-27 18:44:09 +00:00
Pauline Sho
7f51681273
Increase kMaxEvents and error out when it's exceeded (#1835)
The current behavior silently resets and overwrites the internal list, this PR changes it to error out instead.

BUG=b/264555999
2023-03-21 22:29:11 +00:00
Vamsi Krishna Manchala
f1a1f96282
Update READMEs to include logging recommendations
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
2022-11-23 03:22:16 +00:00
Advait Jain
015a7c488f
Update to Renode 1.13.2
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
2022-11-22 23:54:41 +00:00
Vamsi Krishna Manchala
95761fcfd0
TFLite Micro framework changes to support log refactor
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
2022-09-19 19:03:54 +00:00
Vamsi Krishna Manchala
59b39f6cb6
Fix formatting in online_memory_allocation_overview.md
This PR fixes some formatting errors in the online_memory_allocation_overview.md doc.

BUG=http://b/242560771
2022-09-15 00:14:27 +00:00
TANMAY DAS
5330f1620b
Changing the gen directory from tensorflow/lite/micro/make/gen to gen/.
BUG=https://b.corp.google.com/issues/244204467
2022-09-01 01:27:56 +00:00
Pauline Sho
7b12c2ecd3
Update porting_reference_ops.md (#1280)
Updating porting guide based on https://github.com/tensorflow/tflite-micro/pull/1275

BUG=doc update

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-07-25 20:00:08 +00:00
Ting Yan
cc935f1571
Allow int16 for reference kernel porting (#1212)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-06-30 18:56:47 +00:00
Fredrik Knutsson
9c279d09de
Add Arm landing page readme (#1034)
* 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>
2022-05-02 21:50:01 +00:00
Ram Kumar Koppu
5d514fc8d7
Correct URL for the Micro Contributing Guidelines (#998) 2022-03-27 06:45:31 +00:00
Michael O'Cleirigh
a30942eb03
docs: Fix broken listing in contribution docs (#805)
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
2021-12-19 19:49:53 +00:00
deqiangc
2050d4e4e1
Fix broken link in porting reference (#761) 2021-12-08 02:43:37 +00:00
Advait Jain
2620f729b7
Remove all hardware-specific code from the TFLM examples. (#672)
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
2021-11-11 00:20:37 +00:00
deqiangc
21c6d5c9f4
Add a NonPersistentMemoryPlannerShim to support a memory plan in c structure format. (#576)
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
2021-10-06 21:46:43 +00: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
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
Nat Jeffries
26944780f4
TFLM changes to support resource variables. (#482) 2021-09-07 09:21:53 -07:00
Advait Jain
6afb70e789
Fix typo (#408) 2021-08-13 18:35:16 +00:00
Advait Jain
f436b1e389
Update documentation for adding new platform support. (#399) 2021-08-13 18:32:40 +00:00
David Davis
c0de9bdaab
Add FAQ section (#384)
* 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>
2021-08-09 18:55:25 +00:00
Advait Jain
2ddb3cc800
Update links to point to the tflite-micro github repository. (#283)
BUG=http://b/193437031
2021-07-14 21:23:24 +00:00
Jens Elofsson
a0db1a6d01
Fix broken image links in pre-allocated tensors RFC (#171)
* 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>
2021-06-14 15:06:07 +00:00
TFLM-bot
40343df5c9
Sync from upstream TF. (#70) 2021-05-12 07:39:29 -07:00
github-actions[bot]
202d8ecfdd
Automated sync from github.com/tensorflow/tensorflow (#47)
Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
2021-04-29 22:48:26 +00:00
Advait Jain
5a65a54ce2
Sync from upstream with ci/sync_from_upstream_tf.sh (#15) 2021-04-21 03:23:30 +00:00
Advait Jain
a37043ff7a
Manually sync'd code from upstream TF. (#2)
Confirmed that the following command passes:
```
./tensorflow/lite/micro/tools/ci_build/test_all_new.sh GITHUB_PRESUBMIT
```
2021-04-09 11:17:58 -07:00