Commit graph

108 commits

Author SHA1 Message Date
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
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
9bf8b1885b
[CI] Docker 0.6.7 (#3441)
* git config --system --add safe.directory

* 0.6.7
2026-02-10 13:22:40 -08:00
Esun Kim
a45021ad30
[CI] Docker 66 (#3437)
* Docker 0.6.6.

* Updated docker images to 0.6.6
2026-02-10 10:50:54 -08:00
Esun Kim
a69ad532ae
Updated issue_on_error (#3422) 2026-02-09 13:27:34 -08:00
Esun Kim
b41b1cb25e
Clean-up shebang (#3356) 2026-01-26 14:07:28 -08:00
Esun Kim
0a8e6c54a5
[CI] Removed code from Yaml files. (#3315)
* CI no code

* Updated
2026-01-21 21:21:39 -08:00
Esun Kim
8e48f45960
Fixed ci/sync_from_upstream_tf.sh to keep ci/tflite_files.txt (#3313) 2026-01-21 15:51:51 -08:00
Pedro Gonnet
f50d917a19
Switch to LiteRT repo (#3199)
* Switch from the github.com/tensorflow/tensorflow repository to the new github.com/google-ai-edge/LiteRT repository for TFLite sources.

* Fix up include paths.

* More fixes.

* Fix more paths.

* Re-add missing python fixes.

* Re-add missing python fixes.

* Re-run `bazel run //third_party:python_requirements.update -- --upgrade` with Python 3.12.

* Revert third_party/python_requirements.txt.

---------

Co-authored-by: Esun Kim <veblush@google.com>
2025-10-06 14:52:15 +02: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
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
Esun Kim
598c48e4e6
[CI] Updated tflm-ci docker image (#3200)
This update improves the `tflm-ci` Docker image and CI stability using it:

- Pinned CI for Deterministic Builds: All GitHub workflows now use the pinned `tflm-ci:0.6.3` image. This replaces the latest tag to ensure all CI runs are deterministic.
- Upgraded Base Image: The Dockerfile now uses Debian bookworm instead of bullseye.
- Updated Dependencies:
  - `bazelisk` is updated to version 1.27.0.
  - `yapf` is updated to 0.40.2 for consistency with [this](eacd4c404d/third_party/python_requirements.txt (L1170)).
- Improved Documentation: The Dockerfile comment is expanded to include instructions on how to upload new image versions to ghcr.io.

BUG=Clean-up
2025-09-23 17:16:33 +00:00
Esun Kim
eacd4c404d
[Clean-up] Clang-format some existing files (#3179)
- Updated the clang-format to the latest (21)
- Reformatted all existing files using this new clang-format

BUG=SImple-clean-up
2025-09-22 21:30:38 +00: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
Kunasi Ramesh
40cf8cbd47
CI changes for REVERSE_V2 Operator (#3121)
Added  reverse.h file changes in CI to pull from TFLite.

BUG=fixes #3110
2025-06-16 16:54:27 +00:00
suleshahid
39ba5a848d
Fix upstream sync (again) (#2763)
* sync from upstream with new files

* formatting
2024-12-11 11:43:49 -08:00
Ryan Kuester
694d25007c
chore: remove obsolete ci/temp_patches (#2744)
chore: remove obsolete ci/temp_patches

Remove ci/temp_patches, which was obsoleted in 23f608fd once it
was no longer used by the sync script. It should have been
deleted then.

Remove it not only to clean up dead code, but because it contains
a reference to `micro_copts`, which is about to be refactored
away, and we don't want to leave stray references to it in the
tree.

BUG=#2636
2024-11-05 21:48:52 +00:00
RJ Ascani
011a68423a
Fix upstream TF sync (#2694)
* Sync from upstream TF.

* Fix upstream TF Sync

The CI sync from the upstream TF has been failing for the last month
due to the relocation of certain TFLite files. In particular, the
error_reporter sources were moved to the compiler subdirectory.

This PR also includes a full sync to get us caught up again.

BUG=b/369123029

---------

Co-authored-by: TFLM-bot <tflm-github-bot@google.com>
2024-09-24 10:47:58 -07: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
f9044b0334
Remove Wave as dependency (#2508)
The Wave pypi package was recently updated, and the new version caused
failures in our CI for pip installing it. From what I can tell, this
package is no longer being used, so this PR simply removes it as a build
dependency.

BUG=b/329887147
2024-03-15 14:04:11 -07:00
RJ Ascani
20fd5b23ac
Prevent runtime_shape.cc removal during sync (#2484)
Despite existing in TFLite, the runtime_shape.h has long differed
between TFLite and TFLM. The file is not copied during the sync and the
sync script does a `git checkout` on the file to ensure that the
existing version in the TFLM tree remains.

In PR #2476, we needed to add a runtime_shape.cc file. This PR ensures
that the runtime_shape.cc file will not be removed during the sync by
performing a `git checkout` on the existing file.

BUG=323856831
2024-02-28 10:20:50 -08:00
Ryan Kuester
ba8364a55d
ci: remove obsolete ci/flatbuffers_for_tf_sync (#2273)
Remove the directory ci/flatbuffers_for_tf_sync, which was obsoleted in 1e74475.

BUG=see description
2023-10-13 17:50:06 +00:00
RJ Ascani
778d6f8249
Remove extra Xtensa tools install (#2271) 2023-10-12 13:05:31 -07:00
RJ Ascani
d027f2a55c
Update python version in Xtensa images (#2228)
The Xtensa docker images were using python 3.6, which is incompatible
with some of our python packages. This has not been a problem before
because the Xtensa images only perform make builds with very minimal
python script usage. With the new codegen tools, Bazel is used to invoke
the code generator, and this brings in the incompatible python
dependencies.

This PR changes the base image for the three Xtensa docker containers to
pull to python instead of ubuntu. This is similar to our base TFLM
docker image, which also uses the same python:3.10-bullseye base image.

BUG=b/300655634
2023-09-20 20:03:50 -07:00
RJ Ascani
d1bc163973
Add Xtensa dockerfiles (#2223)
This PR adds the existing Xtensa dockerfiles and install scripts to the repo. Notably, this does not include any of the install packages themselves.

An additional change on top of the existing dockerfiles was to have Bazel installed in each image. This is necessary for using Bazel as part of the codegen process. Commit 6d0d214 has the original dockerfiles as they existed prior.

The install_bazelisk.sh script was also slightly tweaked to be compatible with docker as well.

BUG=cleanup
2023-09-15 00:04:05 +00:00
Advait Jain
c20bab12db
No longer sync TfLite OpResolver from upstream. (#2145)
With https://github.com/tensorflow/tflite-micro/pull/1818, TFLM does not need the TfLite OpResolver.

BUG=http://b/272808609
2023-07-25 17:11:45 +00:00
Advait Jain
699c5178b9
Explicit load for py_library. (#2127)
BUG=http://b/291306662
2023-07-14 21:59:36 +00:00
Advait Jain
23f3869f1d
Small improvements to documentation about qemu. (#2122)
* pointers to why we are installing from source (including a TODO)
 * added additional packages to install to the dockerfile (copied from http://doc/1lP_b6NogecZ7HfLKm3bqUE81mTNvNDj8L6OIgbfqNdI and tested locally on my machine).

Note that the dockerfile changes are only tested locally and not as part of the dockerfile.

BUG=documentation
2023-07-13 18:03:18 +00:00
Advait Jain
e63dc4cbcd
Sync from upstream TF. (#2053)
Steps:
 * modified ci/tflite_files.txt
 * ```./ci/sync_from_upstream_tf.sh```
 * additional changes needed to fix the build

There are some assumptions that we had been making that have been
somewhat broken by the changes from http://cl/539690111

More details to follow. This PR is currently to test that all the TFLM
builds are green.

BUG=http://b/287269351
NO_CHECK_TFLITE_FILES=manual sync + fixes
2023-06-14 23:27:57 +00:00
TANMAY DAS
869e70bfbd
Manually ran sync_from_upstream_tf to add tensorflow/lite/core/macros.h. (#1921)
BUG=http://b/279053959
NO_CHECK_TFLITE_FILES=manual sync from upstream
2023-04-25 01:12:50 +00:00
TANMAY DAS
5b699b37ac
We need tensorflow/lite/core/macros.h file from lite to build TFLM. (#1920)
BUG=http://b/279058458
2023-04-20 22:39:05 +00:00
Mike Bernico
2da84da562
Update CI Dockerfile (#1904)
BUG=1891

Update Dockerfile.micro to install QEMU.  This allows for CI to run QEMU based tests.

Verification:
1) Build container `docker build -f ci/Dockerfile.micro -t tflm-ci . `
2) Verify `qemu-arm` exists as  `/usr/local/qemu/qemu-arm`
3) Run the container with the tflm directory mounted as a volume
  `docker run -v $(pwd):/tmp/tflm -it tflm-ci bash`
 4. Inside the tflm root in the container, run the qemu ci script.
   `tensorflow/lite/micro/tools/ci_build/test_cortex_m_qemu.sh`
2023-04-19 23:42:22 +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
TANMAY DAS
e1bba19f71
Update Dockerfile.micro to use Python 3.10 (#1855)
Additionally:
1. update to use `bullseye`
2. change how we `install clang` to make it easier to maintain and hopefully avoid occasional errors with the debian package installation

BUG=http://b/275010053
2023-04-12 23:47:06 +00:00
TANMAY DAS
c1a7015ce2
Need to avoid the error - detected dubious ownership in repository at '/github/workspace'in github or '/opt/tflm' locally. (#1886)
BUG=http://b/275010053#comment8
2023-04-08 15:46:14 +00:00
Advait Jain
aaf6a303ca
Delete install_bazel.sh now that the workflows are updated with #1853 (#1856)
BUG=#1852
2023-03-28 23:52:00 +00:00
Mike Bernico
995eb251d2
Updated CI to use bazelisk and install bazel into /usr/local/bin. (#1853)
BUG=fixes #1852
2023-03-28 05:34:44 +00:00
TANMAY DAS
75f52901eb
Update dockerfile for hexagon. (#1841) 2023-03-22 17:44:47 -07:00
TANMAY DAS
ea72c8f262
Update hexagon and xtensa to install numpy. (#1838)
Tested the changes locally 

For hexagon
```
docker run --rm -v `pwd`:/tmp/tflite-micro ghcr.io/tflm-bot/hexagon:0.3 /bin/bash -c "cd /tmp && tflite-micro/tensorflow/lite/micro/tools/ci_build/test_hexagon.sh tflite-micro/"
```

For xtensa
```
docker run --env XTENSA_TOOLS_VERSION=RI-2020.4-linux --rm -v `pwd`:/tmp/tflite-micro ghcr.io/tflm-bot/xtensa:0.5 /bin/bash -c "cd /tmp && tflite-micro/tensorflow/lite/micro/tools/ci_build/test_xtensa_fusion_f1.sh EXTERNAL tflite-micro/"
```

BUG=http://b/274709808
2023-03-22 06:19:09 +00:00
jwithers
89c290a404
Refactor ci tests to improve speed. (#1746)
This refactor reduces ci test time for all the tests in ci.yml to 16 to 19 minutes depending on weather. 

So our total time on pre-merge ci is going to be ~22 minutes. See bug for more details on runtimes of our current suite. We can get that down to sub 20 minutes if we can move the hifi5 xtensa test to pot-merge which is part of https://github.com/tensorflow/tflite-micro/pull/1772.

This PR will not pass our branch protection automation since it makes substantial changes to our tests. Additionally, the branch protection rules will need to change once this PR is merged.

BUG=https://issuetracker.google.com/issues/266654467
2023-02-23 23:26:18 -08:00
jwithers
cb606d5f0d
refactored for workflow_call and links to issues (#1641)
Updated the issue_on_error.py script to generate links to failed runs when creating or updating issues. Added a issue_on_error.yml workflow to be a reusable error handler and refactored the error handling block in generate_intergration_tests.yml to call it. Added error handling blocks to log_binary_size.yml as well as all the run_*.yml scripts.

BUG=https://issuetracker.google.com/issues/264308670
2023-01-26 01:43:43 +00:00
Advait Jain
4508ac2493
Remove duplicate files, improve sync script and project generation CI.
* Explicitly delete shared TFL/TFLM files prior to sync'ing so that stale files are deleted.
 * Added a bazel build to the project generation CI. This catches errors  like http://b/261106859 that were not caught with the Makefile.
 * Manually ran the sync script: `ci/sync_from_upstream_tf.sh` and included the changes as a separate commit (https://github.com/tensorflow/tflite-micro/pull/1606/commits/99c7ff8a5f2907379002603fc13c40f5077f46dc)


Tested:
 * Confirmed that the new bazel build in test_project_generation would have caught http://b/261106859 by uploading commits with the stale files and seeing that the presubmit checks fail with errors like:
```
/usr/bin/ld.gold: bazel-out/k8-fastbuild/bin/_objs/libtflm/0/common.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-fastbuild/bin/_objs/libtflm/1/common.pic.o: multiple definition of 'TfLiteOpaqueDelegateDelete'
/usr/bin/ld.gold: bazel-out/k8-fastbuild/bin/_objs/libtflm/0/common.pic.o: previous definition here
collect2: error: ld returned 1 exit status
Target //:libtflm failed to build
```

BUG=http://b/261106859
2022-12-06 21:52:47 +00:00
Advait Jain
e7bde952c8
Fix the TF --> TFLM sync
* added the new files to be sync'd to `ci/tflite_files.txt`
 * manually ran the sync script: `ci/sync_from_upstream_tf.sh`
 * update BUILD files to match changes from http://cl/488654028

Note that the changes from e6b9bd0190 are also included in this PR due to running sync script.

NO_CHECK_TFLITE_FILES=manual sync from upstream TF
BUG=http://b/259507701
2022-11-17 17:51:43 +00:00
suleshahid
a2b27b82f7
Update deprecated keyword for cfg = "host" (#1559) 2022-11-17 04:08:09 +00:00
Vamsi Krishna Manchala
6f4329480b
Revert error_reporter_macro.h
This PR will revert the error_reporter_macro.h. TFLite decided to continue to use the TF_LITE_REPORT_ERROR macro, so hiding this macro is no longer needed.

BUG=b/256646805
2022-11-15 05:09:24 +00:00
Vamsi Krishna Manchala
9799cae46d
add error_reporter_macro.h to shared files list
BUG=http://b/245802069
2022-11-07 19:17:27 +00:00
Ryan Kuester
f050eec7e3
python: fix problems with extension module build
Fix problems with the Python extension module build:

- Explicitly build against downloaded NumPy headers instead of relying on the build OS implicitly via the compiler's built-in paths, fixing #1283.
- Use tagged, verified downloads of pybind11_bazel and pybind to silence noise in the bazel output and improve tamper resistance, reproducibility, and caching.

The underlying issue was that the extension module depends on header files from numpy but that dependency was not captured in the BUILD rules.

Upstream Tensorflow's solution is too complicated to import. They manage dependencies on Python runtimes and libraries via much more extensive system of [custom rules](https://github.com/tensorflow/tensorflow/tree/master/third_party/py), designed to meet their many additional requirements.

Background:
- [pybind/pybind11](https://github.com/pybind/pybind11) is a C++ library that helps in creating our extension's interface to CPython.
- [pybind/pybind11_bazel](https://github.com/pybind/pybind11_bazel) provides Bazel rules for building pybind-based extensions, but doesn't cover the unusual case of using C headers provided in another Python module (in our case, NumPy).
- Bazel's own [bazelbuild/rules_python](https://github.com/bazelbuild/rules_python) provides rules for fetching Python dependencies from PyPI for use when *running* Python code via Bazel, but doesn't directly help with the unusual case of *building* code using headers provided by Python packages from PyPI (again, in our case, NumPy).
- The standard way, in Bazel, to build against third-party code is to create an [external repository](https://bazel.build/docs/external) by writing and calling [repository rules](https://bazel.build/extending/repo).

This PR supplies the C headers from NumPy to the build of our extension by adding a repository (via the new repository rule `tflm_py_cc_headers`) that reuses the PyPI package downloaded by rules_python and wraps it in a `cc_library` target on which the build of the extension can depend.

BUG=fixes #1283
2022-10-03 22:22:08 +00:00
Steven Toribio
cdc3a3203f
adding portable_tensor_util.cc file to TFLite sync (#1420) 2022-09-15 18:29:59 -07:00
suleshahid
868fb7e8af
Nightly sync fix. (#1381) 2022-08-29 10:09:39 -07:00
suleshahid
54a86ad082
Cleanup on the flatbuffer update.
This is to cleanup some code after the latest flatbuffer version update PR.
* Update build targets in schema files to only have the original builds, :schema_fbs and :schema_py.
* Fix checking in of schema in nightly sync.
* Remove unneeded lines (of a deleted file) in copyright and license checks.


Bugs:
BUG= [243587789](https://buganizer.corp.google.com/issues/243587789)
BUG= [243588297](https://buganizer.corp.google.com/issues/243588297)
BUG= [243716132](https://buganizer.corp.google.com/issues/243716132)
2022-08-26 00:03:26 +00:00