| commit | 3e165401461010a9e9381bccf0e71691d63edc8b | [log] [tgz] |
|---|---|---|
| author | Tommy Chiang <[email protected]> | Wed Sep 03 10:26:02 2025 |
| committer | Chromeos LUCI <[email protected]> | Mon Sep 08 08:14:47 2025 |
| tree | 87c7f1d942290c0e0ced3b39df448b2db41cfc9c | |
| parent | bd51e8709222b4003e2123b7f98ce5b2846fe93e [diff] |
tflite: Fix native handle deallocation size mismatch The default new/delete memory management will act based on the given type. However, since native_handle_t contains zero-length (dynamic size) array, which new/delete cannot handle properly. Thus, instead of relying on the default deleter in the unique_ptr, which use delete, this CL create a custom deleter that use malloc/free to match the C behavior, which makes memory size management easier. BUG=b:442765928 TEST=bazelisk test --config=host_clang '//android:hardware_buffer_test' Change-Id: I84364f4149a2da99742a40f201af3a17d9541d44 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tflite/+/6908322 Auto-Submit: Tommy Chiang <[email protected]> Tested-by: Tommy Chiang <[email protected]> Reviewed-by: Shik Chen <[email protected]> Commit-Queue: Shik Chen <[email protected]>
This repository hosts the core ChromeOS TFLite components, enabling on-device machine learning (ODML) workloads accelerated by NPU.
The corresponding ebuild can be found at: tensorflow-9999.ebuild
Patches are stored in the patch/ directory and explicitly listed in WORKSPACE.bazel. A helper script, ./script/patcher.py, is included to facilitate patch management within a TFLite workspace.
The typical workflow:
Eject (Download) TensorFlow Source Code
Download the TensorFlow source code into a local git repository with patches applied as individual commits:
./script/patcher.py eject
This creates a new local git repository at tensorflow/.
Modify the TensorFlow Repository
Make changes to the tensorflow/ repository as needed, following standard git workflows. Optionally, include a PATCH_NAME= tag in commit messages to specify the filename of the corresponding patch.
Seal the Repository
Regenerate the patch files and update the WORKSPACE.bazel file:
./script/patcher.py seal
This updates the patches in the patch/ directory and reflects the changes in WORKSPACE.bazel.
It's preferred to submit changes to upstream TensorFlow first and cherry-pick them as patches. This helps minimize divergence and makes TensorFlow updates easier.