Commit Graph

183 Commits

Author SHA1 Message Date
T.J. Alumbaugh
60be0c3c0e Restore functionality of --define=tflite_with_ruy=true
PiperOrigin-RevId: 317677225
Change-Id: If6533fdfeb21f676dd4b77a536b1aca894a03003
2020-06-22 10:49:06 -07:00
Karim Nosir
2a96849f47 Update source files with used includes.
PiperOrigin-RevId: 316589177
Change-Id: I0aba0ed1cf9ff478e7890fa53a7749bf844bd26d
2020-06-15 18:42:14 -07:00
T.J. Alumbaugh
2635f0495e Permit runtime opt-in for caching of prepacked matrices in GEMMs.
PiperOrigin-RevId: 314832291
Change-Id: Id0362e33e4d65908a4899d54989658fcfbf7f04c
2020-06-04 17:10:17 -07:00
Jared Duke
5515595afa Remove explicit abseil usage from core TFLite runtime
These abseil deps aren't critical, so remove them to avoid potential
conflicts with client libraries that also have abseil deps.

PiperOrigin-RevId: 314831735
Change-Id: I793947aa45e37421df6eaa46fa00d5cb8250bfcb
2020-06-04 17:05:49 -07:00
Lev Proleev
a26381f3dc Add NNAPI delegate support for Fill
PiperOrigin-RevId: 314116176
Change-Id: I8216b776ec823ff9c0696410091291f6b2d3a385
2020-06-01 05:53:24 -07:00
T.J. Alumbaugh
0b59eaf0bf Provide builtin_op_kernels target with Ruy and GEMV caching unconditionally enabled
PiperOrigin-RevId: 311776871
Change-Id: I948ea5524fdcf17c36e6219fb1ae18fafdecee4e
2020-05-15 12:14:43 -07:00
Jared Duke
7d40f2c389 Fix bazel TFLM compilation w/ TF_LITE_STATIC_MEMORY
Ensure dynamic string utils aren't compiled when this build define is
present.

PiperOrigin-RevId: 311626904
Change-Id: Ica229bf337019f0f446fdb94aaf42c6b7e7c749e
2020-05-14 16:27:45 -07:00
Benoit Jacob
75d1fdd15d Let the test use the new ruy::ReferenceMul.
PiperOrigin-RevId: 310340723
Change-Id: I3302cb48344bd0ca490aee367b6483366436f675
2020-05-07 05:41:11 -07:00
Benoit Jacob
3b3d320385 Use the new ruy API for caching constant matrices.
PiperOrigin-RevId: 309220053
Change-Id: I0d1f0040cd84aade4c9f9e84c240909865e818bc
2020-04-30 07:22:40 -07:00
Jaesung Chung
cf9d79b432 Move hash table op kernels out of experimental directory
PiperOrigin-RevId: 307999605
Change-Id: Ib59a2979db8f59c84f0c5c3ce6b25f320cd0e917
2020-04-23 01:18:54 -07:00
Jared Duke
34784ac94b Annotate kernel tests compatible w/ XNNPACK
PiperOrigin-RevId: 307128900
Change-Id: Ia5525209ecd29d5407b8b597d01001851ea57d88
2020-04-17 15:46:39 -07:00
Karim Nosir
4af24c8817 Separate Reshape test model in a separate file.
PiperOrigin-RevId: 306737444
Change-Id: I25cf6d02dc88545768422e91748230073c9aa5ca
2020-04-15 16:04:44 -07:00
A. Unique TensorFlower
7a386e1a23 Remove build_for_embedded flag from cpu_backend_context.
PiperOrigin-RevId: 306464817
Change-Id: Id9a1ff1edce2b7bd0341963576aa2060c3e41899
2020-04-14 10:23:59 -07:00
A. Unique TensorFlower
0dfd23a641 Enable building TFLite Micro runtime for embedded systems under Bazel.
PiperOrigin-RevId: 305537308
Change-Id: Ia2a35cc06872709b27ca551316567edd4b241baa
2020-04-08 13:03:33 -07:00
Benoit Jacob
3376402afd Reference ruy from its new location as a separate GitHub project.
PiperOrigin-RevId: 304653289
Change-Id: I2a3ce84177665a4d7f455d455c0e7d71d48a68e9
2020-04-03 11:17:08 -07:00
Benoit Jacob
d0a0a22b98 Move ruy's code to a ruy/ subdirectory.
The motivation is that having source files in the repository root runs into a number of corner cases with copybara setups and with external CMake build systems, so enclosing all code in ruy/ avoids that while generally making our setup much more similar to that of other related projects (TensorFlow, IREE).

PiperOrigin-RevId: 303448881
Change-Id: Id099055cba4d3c50ae60171d645614b57a8d3ee7
2020-03-27 19:02:51 -07:00
A. Unique TensorFlower
a4c2fcf05b Add indirection layer for selecting cmath functions from global namespace.
There can be functions beyond round() that aren't present within the std::
namespace depending on libstdc++ version. This CL adds an indirection layer
using a new TF_MICRO_USE_GLOBAL_CMATH_FUNCTIONS flag to select these functions
and converts TfLiteRound() to use this layer.

Other similar indirections will be added in future CLs.

PiperOrigin-RevId: 303425632
Change-Id: Idfe14924329827f71742ab6aedfd6ead9bcb0dbb
2020-03-27 16:06:11 -07:00
T.J. Alumbaugh
828fe43cf3 Add BatchMatMul built-in op for TF Lite
PiperOrigin-RevId: 302489633
Change-Id: Ie4ad2abad069b1e5bc654fc51caf0bcbc99b714f
2020-03-23 12:22:47 -07:00
Nupur Garg
b2a5472997 Creates framework_lib target.
PiperOrigin-RevId: 301656623
Change-Id: Ied2158a67bfb0fa29753d201610d2967f57d3504
2020-03-18 13:38:47 -07:00
A. Unique TensorFlower
84d930ffe9 Creates framework_lib target.
PiperOrigin-RevId: 301503499
Change-Id: I81b5bda1df702eaefbceaddcbed26a71c345a313
2020-03-17 19:30:02 -07:00
Nupur Garg
3404ca7b5d Creates framework_lib target.
PiperOrigin-RevId: 301492628
Change-Id: I5f819766e3a1437cfd1ffa28acb57958900e7e39
2020-03-17 18:06:10 -07:00
Haoliang Zhang
30f3741ddf Export min_runtime_version in MLIR converter
This change fixes the issue for missing min_runtime_version in flatbuffers exported by MLIR converter. Specifically:

*Export `min_runtime_version` in metadata of flatbuffer (fixed-length byte array).

*Update all related mlir tests to have metadata.

PiperOrigin-RevId: 299894972
Change-Id: Ic79f3ab05b593882362f5baf62493861961acbe3
2020-03-09 12:02:29 -07:00
Karim Nosir
1e6d025cc6 Add version of kernels with alwayslink and use it for shared libraries rule
PiperOrigin-RevId: 298964539
Change-Id: I7eb86adc4b080b42163e3ece76d14a1eec65b5df
2020-03-04 16:18:17 -08:00
Jian Li
7f6685951b Add another integer LSTM reference runtime for special hardware platform. Its quantization will be added separately.
PiperOrigin-RevId: 296320108
Change-Id: Ifb3a22667322a5af49426b5a1fc4066a50beac51
2020-02-20 16:11:17 -08:00
Thai Nguyen
d438021edc Set op version in TFLite kernel tests
PiperOrigin-RevId: 294566530
Change-Id: I02556caac28598c4ba41c4368502d3f5933884ce
2020-02-11 18:21:17 -08:00
T.J. Alumbaugh
bc1459f360 Automated rollback of commit 060114773f
PiperOrigin-RevId: 293811737
Change-Id: I5978fd6f9b0b119f88a87b8e98a8c204a5690545
2020-02-07 07:49:01 -08:00
T.J. Alumbaugh
060114773f Enable TFLITE_WITH_RUY_GEMV when Ruy is enabled
PiperOrigin-RevId: 293629152
Change-Id: I4ca1ab9babd47abb223c165ff7c327e6f94b667e
2020-02-06 11:05:01 -08:00
David Rim
446a9fc0fc Add hybrid per-channel quantization support to depthwise conv
PiperOrigin-RevId: 291860219
Change-Id: Ie25be28e858c790e4c1dcdce85ac8aab4b6b8f06
2020-01-27 21:08:49 -08:00
Pete Warden
adf6e22e4a Enable visualization script to work from pip install
Current the visualization script for TensorFlow Lite files only works if you build through Bazel. To make it more accessible, this change uses Flatbuffer's new Python interface to extract the information from the file, rather than calling out to an external tool. It also adds some tests.
A lot of the changes here are related to upgrading to the latest version of Flatbuffers, which has an impact on other parts of the code.

PiperOrigin-RevId: 291255530
Change-Id: I28a64a182e6197a58926d02c41988e4791c60fce
2020-01-23 15:20:03 -08:00
Yunlu Li
82a7f1a471 Make Densify op working.
PiperOrigin-RevId: 291249962
Change-Id: Ib1cbb27e7069d007c115a0be20d43e96512d736f
2020-01-23 14:58:33 -08:00
Renjie Liu
e4fe5890d7 Handle l2_norm kernel for input all zeros scenario.
PiperOrigin-RevId: 291086946
Change-Id: I1f63ccc0041cb4056631439fd9f2db38d71f1aee
2020-01-22 20:21:06 -08:00
Tiezhen WANG
4044d5dcb4 TFLM: Fix double-promotion error.
Some of these double promotion is not obvious as va_args implicitly promotes float to double.

PiperOrigin-RevId: 290926630
Change-Id: Iea51ea6aea069d1b8dcd43f6ad056f3e54a28157
2020-01-22 04:12:43 -08:00
Smit Hinsu
0b2d7049ac Enable visualization script to work from pip install
Current the visualization script for TensorFlow Lite files only works if you build through Bazel. To make it more accessible, this change uses Flatbuffer's new Python interface to extract the information from the file, rather than calling out to an external tool. It also adds some tests.
A lot of the changes here are related to upgrading to the latest version of Flatbuffers, whi...

PiperOrigin-RevId: 290887928
Change-Id: I90403c1f4233f472ee5d7c4d21eed8233cb7d008
2020-01-21 21:54:42 -08:00
A. Unique TensorFlower
8e65693af7 TFLM: Fix double-promotion error.
Some of these double promotion is not obvious as va_args implicitly promotes float to double.

PiperOrigin-RevId: 290883516
Change-Id: I23fc883afaac7876f881c85f15d5f21dd7bf4f43
2020-01-21 21:15:58 -08:00
Tiezhen WANG
884ec0ff06 TFLM: Fix double-promotion error.
Some of these double promotion is not obvious as va_args implicitly promotes float to double.

PiperOrigin-RevId: 290881894
Change-Id: I58a67bb4770e5a5a1a2ccfda59de515625e91df1
2020-01-21 20:57:43 -08:00
Pete Warden
1219c0ba8d Enable visualization script to work from pip install
Current the visualization script for TensorFlow Lite files only works if you build through Bazel. To make it more accessible, this change uses Flatbuffer's new Python interface to extract the information from the file, rather than calling out to an external tool. It also adds some tests.
A lot of the changes here are related to upgrading to the latest version of Flatbuffers, which has an impact on other parts of the code.

PiperOrigin-RevId: 290788860
Change-Id: I4db3442110c48e01da2b5696b693562c806735fd
2020-01-21 11:47:07 -08:00
Benoit Jacob
2d0f88b953 Port TFLite from the gemmlowp profiler to the ruy profiler.
PiperOrigin-RevId: 289703792
Change-Id: I1ed5411efe2d683d31c08b1bbf654c3281c68711
2020-01-14 12:19:32 -08:00
Jaesung Chung
e07863b456 Add segment_sum op to Tensorflow Lite
PiperOrigin-RevId: 289377531
Change-Id: Ie8aa95ca9d6b32eb2c5eb8a11c96d6ed3b3464d9
2020-01-12 22:02:42 -08:00
Jaesung Chung
57b4fbbfdb Make Hashtable ops in TFLite compatible with MLIR converter
PiperOrigin-RevId: 288628649
Change-Id: Ie7dbd06e1e277e33da5d08993d27d08920837f3a
2020-01-07 21:08:42 -08:00
Jian Li
032e687a02 Move LSTM tensor index to a separate header and share it in inference kernel and logging kernel.
PiperOrigin-RevId: 287238230
Change-Id: I42ccb09f33be006254f2fe3f9372ee8b80598df9
2019-12-26 16:31:25 -08:00
Yunlu Li
58719c1a68 Add Densify op.
PiperOrigin-RevId: 285982093
Change-Id: Ida0f58ce622cb627653ac7898a2c5d427ac0cbfe
2019-12-17 08:14:24 -08:00
Feng Liu
ff2f4e3bcc Add a debugging op to verify numericals at runtime.
The this op takes a built-in option `tolerance`, and if the error of the two
operands is larger than this threshold value, a failure will return and the
error message will display the mismatched location.

NO_IFTTT=this is the first time the op is added, so by default it is in version 1.
PiperOrigin-RevId: 285299738
Change-Id: I93e33303d92d4ccdfa7b47f25423cb5dccb27598
2019-12-12 16:48:26 -08:00
A. Unique TensorFlower
1be7afb1c6 Implement a build_defs.bzl shim to simplify new platform porting.
This shim accepts a flag, `build_for_embedded`, which enables additional rules besides `native.cc_library` to build the sources specified in the TFLM build graph.

PiperOrigin-RevId: 285291476
Change-Id: Ie65a81cff5083b32c5c3f84845c26b02060b481f
2019-12-12 16:05:22 -08:00
Karim Nosir
a25083703b Reduce memory overhead for mirror pad and parallelize execution
PiperOrigin-RevId: 284989744
Change-Id: Ic2669e93eceaa244f70d22492f9faa50725e296b
2019-12-11 08:27:04 -08:00
Robert David
ff731ce2f3 Use Eigen in ApplyTanhToVector and ApplySigmoidToVector.
Remove the "override" that did this already in hybrid LSTM.

The Eigen implementation has slightly worse accuracy, but is implemented using SIMD.

PiperOrigin-RevId: 282857162
Change-Id: Iddd383d163773e8ca72ee51e02d2cb7cb249a82f
2019-11-27 17:13:25 -08:00
Robert David
9e2427c588 Inline and optimize ApplyActivationToVector function.
Also implement missing activations.

PiperOrigin-RevId: 282848506
Change-Id: Iddba8efd6d28b2777347ebccdf8e410f6f65adb2
2019-11-27 16:12:58 -08:00
Jared Duke
4ce6a9b7a4 Rename lite/c/c_api_internal.h to lite/c/common.h
The C types in lite/c/c_api_internal.h are not actually internal,
rather, they are common types used throughout the C++ and C APIs.
Rename the header accordingly.

PiperOrigin-RevId: 282494601
Change-Id: Ia784f35724d774db256ffcbbcdc5bb00e6574417
2019-11-25 21:49:25 -08:00
Jaesung Chung
3c725ae67b Add hash table resource implementation into TFLite
PiperOrigin-RevId: 282460990
Change-Id: If489e2ab2d3e9ad2b4899f4ec055e611def6696d
2019-11-25 16:54:58 -08:00
Mihai Maruseac
a36c12b7c7 Add hash table resource implementation into TFLite
PiperOrigin-RevId: 281997222
Change-Id: I8680e454fd4de99d4a2d51ef651df97d52253f0b
2019-11-22 12:07:19 -08:00
Jaesung Chung
160a61ef50 Add hash table resource implementation into TFLite
PiperOrigin-RevId: 281909097
Change-Id: I1498a20749c85e42d75cbd73ee1035c66db6e369
2019-11-21 23:13:23 -08:00