Commit graph

36 commits

Author SHA1 Message Date
TFLM-bot
35b20c5c74
Sync from upstream TF. (#3625) 2026-07-13 11:31:17 -07:00
TFLM-bot
fddd3707a3
Sync from upstream TF. (#3617) 2026-07-08 22:34:57 +00:00
Esun Kim
e142972d4f
Manual sync from sync from github.com/tensorflow/tensorflow (#3616)
* Synced

* Added FLOAT8_* types
2026-07-01 18:13:01 -07:00
Esun Kim
fbda8b8d6b
Manual sync from sync from github.com/tensorflow/tensorflow (#3601)
* Synced

* No abseil
2026-07-01 14:46:41 -07:00
Esun Kim
7914a2d7a1
Clean-up unused bzl load (#3576) 2026-05-26 22:55:55 +00:00
Ryan Kuester
068c6a59b6
build(bazel): inject tflite_micro shim via tflm_py_* wrappers (#3573)
Python targets in this repository import one another under the
"tflite_micro" package namespace, which //:tflite_micro_shim synthesizes
at import time. The shim is required under Bzlmod, where the main
repository's runfiles root is the fixed name "_main" rather than the
module name, so the "tflite_micro" prefix no longer resolves on its own.
Every such target therefore had to list //:tflite_micro_shim in its
deps, which was repetitive and easy to forget.

Add tflm_py_library, tflm_py_test, and tflm_py_binary wrappers in a new
//python:py_rules.bzl that inject the shim dependency automatically,
following the naming convention of the existing tflm_cc_* wrappers, and
document the shim's rationale there. Convert every target that
previously listed the shim to the corresponding wrapper and drop the
explicit dependency. The dependency graph is unchanged; only the means
by which the shim is attached differs.
2026-05-26 19:51:58 +00:00
Esun Kim
1c2bae841e
No tensorflow 1 (#3546)
* No tensorflow 1

* Vendoring our own utils

* Vendoering revise

* Removed unnecessary tf pythons

* Reformat
2026-05-06 18:31:12 +00:00
Esun Kim
807c35d6a9
Bazel Module (#3364)
* Work

* Review update

* Enabled tests

* Bazel: Suppress warnings from external repositories

* Fixed whl_test

* Formatted

* More format
2026-02-11 14:11:47 -08:00
Esun Kim
fd33340e06
Revert "[CI] Replaced tensorflow with tensorflow-cpu (#3261)" (#3290)
This reverts commit 9cbf6e0403.
2026-01-12 11:19:37 -08:00
Esun Kim
9cbf6e0403
[CI] Replaced tensorflow with tensorflow-cpu (#3261)
* Replaced tensorflow with tensorflow-cpu

* Use tensorflow-cpu for bazel targets
2025-12-03 13:43:14 -08:00
TFLM-bot
37fb41f371
Automated sync from github.com/tensorflow/tensorflow (#3214)
* Sync from upstream TF.

* Manual change from cl/819821231

* Fix

* Copyright

---------

Co-authored-by: Esun Kim <veblush@google.com>
2025-10-16 14:33:56 -07:00
Esun Kim
858f5a3edd
[CI] Removed six, updated absl_py (#3203)
* Removed ci/install_qemu.sh

* Removed six from direct deps

* Removed six from tflm-ci docker

* Use requirement(absl_py)

* New qemu-user
2025-09-25 14:37:39 -07:00
Esun Kim
ba753cef3e
[CI] Fix build (#3194)
- Upgraded the Bazel BuildTool to the latest version (8.2.1).
- Updated the `tflm-ci` Docker image and pushed the new tag (0.6.1) to the `ghcr.io/tflm-bot/tflm-ci registry`.
- Updated the WORKSPACE to load `rules_cc` and `rules_shell` explicitly
- Ran `buildifier` to ensure all BUILD files to have all the fixes.

BUG=Clean-up
2025-09-19 20:48:22 +00:00
TFLM-bot
f60e4fa400
Automated sync from github.com/tensorflow/tensorflow (#3124)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2025-07-08 19:28:19 +00:00
TFLM-bot
5f0db3464d
Automated sync from github.com/tensorflow/tensorflow (#3060)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2025-04-16 17:56:33 +00:00
suleshahid
bc68d362d6
Remove deprecated BUILD tags (#3091)
These tags have been deprecated and are unused now. Syncing with upstream and removing them from the BUILD files.

BUG=remove deprecated tags
2025-04-08 19:21:25 +00:00
TFLM-bot
6fc405dd65
Automated sync from github.com/tensorflow/tensorflow (#3033)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2025-03-07 18:05:46 +00:00
RJ Ascani
ff5c090eca
Fix upstream TF sync (#2625)
The CI sync from the upstream TF has been failing for the last month due
to the relocation of certain TFLite files. In particular, some schema
files were relocated to tensorflow/compiler/mlir/lite subfolder. This PR
mirrors the migration and adds a few redirection headers to ensure
source compatibility for now.

This PR also includes a TF sync as well to get us caught up again. While
that could have been done separately, this is done together to ensure
everything continues to build with the relocations.

BUG=b/351824449
2024-07-15 13:04:01 -07:00
RJ Ascani
29526e413b
Replace tensorflow-cpu usage with tensorflow (#2396)
The tensorflow-cpu package does not support MacOS or non-x86 hardware. Replacing the tensorflow-cpu python package requirement with the tensorflow meta package should enable the bazel build and the dependent python scripts to be used on those platforms.

BUG=#2367, #1781
2024-02-23 00:35:22 +00:00
TFLM-bot
4bbdef5f8a
Automated sync from github.com/tensorflow/tensorflow (#2251)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2023-09-29 16:09:38 +00:00
TFLM-bot
b4060efe00
Automated sync from github.com/tensorflow/tensorflow (#2182)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2023-08-23 15:38:18 +00:00
TFLM-bot
c6e758b3ac
Automated sync from github.com/tensorflow/tensorflow (#2049)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2023-06-20 22:33:01 +00:00
TFLM-bot
feea164f7d
Automated sync from github.com/tensorflow/tensorflow (#1829)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2023-03-16 16:56:10 +00:00
TFLM-bot
2ea0867623
Automated sync from github.com/tensorflow/tensorflow (#1736)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2023-02-13 05:17:59 +00:00
TFLM-bot
b2eb8f68de
Automated sync from github.com/tensorflow/tensorflow (#1696)
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2023-02-01 02:49:38 +00:00
Pauline Sho
809c9e9e37
Add missing dependency schema_util in tools (#1700) 2023-01-31 15:09:52 -08:00
TFLM-bot
b7b95879f2
Automated sync from github.com/tensorflow/tensorflow
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2022-12-21 17:43:11 +00:00
suleshahid
1e74475fde
Update Flatbuffer version to 2.0.6 and generate schema local. (#1374) 2022-08-25 18:01:35 +00:00
TFLM-bot
eacc122d91
Automated sync from github.com/tensorflow/tensorflow
BUG=automated sync from upstream
NO_CHECK_TFLITE_FILES=automated sync from upstream
2022-08-09 06:35:06 +00:00
TFLM-bot
0c8c12342c
Automated sync from github.com/tensorflow/tensorflow (#1225)
* Sync from upstream TF.

* Generate C++ bindings for schema as part of the import.

Co-authored-by: Advait Jain <advaitjain@users.noreply.github.com>
Co-authored-by: Advait Jain <advaitjain@google.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-07-21 09:59:11 +00:00
Måns Nilsson
d0d1d6532d
Generate Micro Mutable Op Resolver for a given model (#971)
* Generate Micro Mutable Op Resolver for a given model

Also adds functionality to generate a test to verify the generated
header file.
Adds a CI script that does this for the person_detect.tflite file.

Change-Id: I5de316da7f7ec6b916371156e57e35da1b236911

* Break out TestDataGenerator from generate_per_layer_test.py

TestDataGenerator is also used by gen_micro_mutable_op_resolver_test.py.
TestDataGenerator.generate_test() and generate_build_file() are moved
out. They have to be implemented by the inheriting class
since they are not generic and would be different for every user.
Adds generate_golden() to TestDataGenerator since it is generic.

* Fix formatting errors from code style test

* Fix format error

* Fix 2 formatting errors

* Address review comments

* Add documentation to generate_goldens()

* Fix review comment

* Address review comments

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-07-12 22:49:52 +00:00
Advait Jain
c5b8d4a3dc
Initial implementation of tool to generate integration tests. (#656)
* Use csv file name to determine type of the array.

This will allow us to have either int8 or int16 be generated from csv
files and will expand the types of integration tests that we can run.

Renamed all the files with:
```bash
for CSV in $(ls *.csv)
do
  mv "${CSV}" "$(basename ${CSV} .csv)_int16.csv"
done
```

Also,
  * added the integration_test to x86 makefile per-PR CI
  * changed bazel target to cc_test so that the integration test is run
    as part of CI.

If this slows down the CI, we will add a mechanism to run a more
exhaustive test suite nightly, but we are currently going to err on the
side of having more coverage.

For now, running the integration tests on x86 is fast.

BUG=http://b/205042963

* Initial implementation of tool to generate integration tests.

Manually tested that tests can be generated with:
```
python tensorflow/lite/micro/integration_tests/generate_per_layer_tests.py --input_tflite_file tensorflow/lite/micro/models/person_detect.tflite --output_dir tensorflow/lite/micro/integration_tests/person_detect/conv
```

And run with:
```
make -f tensorflow/lite/micro/tools/make/Makefile test_integration_tests_person_detect_conv_test
bazel test tensorflow/lite/micro/integration_tests/person_detect/conv:integration_test
```

This tool is in very early stages of prototyping. Follow-up PRs will add tests and improve the tool.

Some bugs:
 * http://b/205046520
 * http://b/205042963
 * http://b/204109200

BUG=see description.

* fix build file formatting.

* Fix the bazel build

* Actually fix the build.
2021-11-08 18:25:43 -08:00
Advait Jain
e958bb1161
Allow using Python scripts without bazel. (#639)
* Allow using Python scripts without bazel.

Manually verified and documented the steps that I can follow to run
Python code without Bazel.

BUG=http://b/204109200
NO_CHECK_TFLITE_FILES=manually ran the sync script.

* Address review comments.
2021-10-29 14:40:24 -07:00
Advait Jain
be7f88c81a
Sync additional Python flatbuffer utils from Tensorflow (#635)
Sync additional Python flatbuffer utils from Tensorflow.

 * strip_strings
 * visualize

Manually confirmed that I can strip strings and visualize from the TFLM repo:

```
bazel build tensorflow/lite/tools:strip_strings
bazel build tensorflow/lite/tools:visualize

bazel-bin/tensorflow/lite/tools/strip_strings --input_tflite_file tensorflow/lite/micro/models/person_detect.tflite --output_tflite_file tensorflow/lite/micro/models/person_detect.strip_strings.tflite
bazel-bin/tensorflow/lite/tools/visualize tensorflow/lite/micro/models/person_detect.strip_strings.tflite tensorflow/lite/micro/models/person_detect.strip_strings.tflite.html
```

Additionally, this changes switches the bazel build to use tensorflow-cpu to avoid CUDA not found warnings.

BUG=http://b/204109200
2021-10-28 23:15:35 +00:00
Advait Jain
05694f8c38
Add flatbuffer_utils and corresponding test to the bazel build. (#632)
This is the first step towards being able to manipulate flatbuffers from
Python from the TFLM github repository.

Manually confirmed that the following command works:
```
bazel test tensorflow/lite/tools:flatbuffer_utils_test
```

Note that the code that is sync'd from TF needs to have an updated
import path and we have changed the sync script to perform this
transformation.

These python tests will also be run as part of the bazel CI.

BUG=http://b/204109200
2021-10-28 15:57:34 -07:00
TFLM-bot
0beb99eb2a
Automated sync from github.com/tensorflow/tensorflow (#629) 2021-10-27 17:55:45 +00:00