Commit Graph

62 Commits

Author SHA1 Message Date
Sachin Joglekar
119aa03c76 Split delegate-specific interpreter tests into a separate file
PiperOrigin-RevId: 312372505
Change-Id: If366a884ce090f2ad40bdc20d266ef32eb5a1765
2020-05-19 16:06:19 -07:00
A. Unique TensorFlower
020a88ac12 Rollback to investigate failure
PiperOrigin-RevId: 311731132
Change-Id: I109ce87f13bb1b1c06b3e110bafbdf9c014c8258
2020-05-15 08:13:02 -07:00
A. Unique TensorFlower
cca62cc73b Add a new DelegateUtils::InvokeWithCPUFallback API for handling delegate failures automatically in Invoke(). This is especially useful for NNAPI usage, as drivers may evict clients.
The fallback is suitable when callers:
- Use CPU buffers only (no AHardwareBuffer or GL buffers)
- Do not store pointers to tensor data across Invoke() calls, as they are invalidated
- Do not have tensor state across multiple Invoke() calls

PiperOrigin-RevId: 311687567
Change-Id: Ib3b6fd3fb6c4e85c9512d939d8e87efea03ac4fe
2020-05-15 01:05:28 -07:00
TensorFlower Gardener
80db9e27b1 Merge pull request from frreiss:issue-s390-lite-2
PiperOrigin-RevId: 309040326
Change-Id: I568c9927db757f9c963c7606c7e58f2854011fcc
2020-04-29 09:49:02 -07:00
Marat Dukhan
5a0a2b5c99 MSVC compatibility in TFLite interpreter test
Avoid designated initializers as they are not a standard C++17 feature

PiperOrigin-RevId: 307905107
Change-Id: I2ac7e64a95e09a811b91ee8452025481cc1a5e8d
2020-04-22 15:02:22 -07:00
A. Unique TensorFlower
c5fd4efc4c Some const declarations changed to constexpr
PiperOrigin-RevId: 307629520
Change-Id: I22dcc35701417a184b77791ec3efe4a2957251bc
2020-04-21 10:21:10 -07:00
Sachin Joglekar
2b5cc29798 Introduces a new error code for delegate failure during ModifyGraphWithDelegate
PiperOrigin-RevId: 307444097
Change-Id: Ica2b25ce604cc213cb42ed652c4aa7023f5ce0bc
2020-04-20 11:53:53 -07:00
Yu-Cheng Ling
62a6012a0c Improve EnsureTensorsVectorCapacity performance.
PiperOrigin-RevId: 307325783
Change-Id: I60fa334f04da194dd31e2d5c82f7f1d68c8d3a7a
2020-04-19 20:18:47 -07:00
A. Unique TensorFlower
02b3bc3c0d Introduce protected RemoveAllDelegates API
PiperOrigin-RevId: 306406337
Change-Id: Icae8dc0774ead33d7aa37cc64b983b5228a234b1
2020-04-14 03:18:48 -07:00
Nupur Garg
993a6e4f0e Add ResizeInputTensorStrict to C++ API.
PiperOrigin-RevId: 305802949
Change-Id: I131bf9a43f086fef4301a9858ab34cea379d7040
2020-04-09 18:35:23 -07:00
Robert David
4dce625d93 Small cleanup: Use GetInput/GetOutput helper functions.
PiperOrigin-RevId: 302748640
Change-Id: I41a9612ce7160b45ac1047325a8f5a40aac785d2
2020-03-24 14:38:53 -07:00
TensorFlower Gardener
6f8e1a3c04 Merge pull request from ANSHUMAN87:multi-thread-check-correction
PiperOrigin-RevId: 294160969
Change-Id: I49fd1e2a3355a55bad8f474e0f9f503e064b1d09
2020-02-10 00:11:55 -08:00
Terry Heo
1c4d426919 Implement "Greedy by size planner" for more optimal memory allocation
http://arxiv.org/abs/2001.03288
Observed improvements:
- Mobilenet V1 has 35% has memory reduction
- Mobilenet V2 has 2% reduction
- Majority of all other tested models demonstrated ~10-15% improvement

PiperOrigin-RevId: 293250794
Change-Id: I41b1f927dfbafb1b3db360522a1417c6d993a789
2020-02-04 16:08:39 -08:00
T.J. Alumbaugh
5500a989fc Interpreter destructor clears cache on external CpuBackendContext.
PiperOrigin-RevId: 292450434
Change-Id: I9f65453af83da1203f4a38458657e5ae8c4810f1
2020-01-30 16:43:42 -08:00
ANSHUMAN TRIPATHY
c8670825cc [3] Review comments handled 2020-01-27 10:15:50 +05:30
frreiss
6661cf9524 Merge branch 'master' of https://github.com/tensorflow/tensorflow into issue-s390-lite-2 2020-01-15 12:14:25 -08:00
Andrew Selle
171ba06f5e Bring back overflow detection with dummy expect implementation for windows.
Automated g4 rollback of changelist 288577610.

PiperOrigin-RevId: 289548448
Change-Id: Ic2c0d5b33d4cb5ed4c8e8e7f83278c99acc34bbd
2020-01-13 16:54:33 -08:00
Mihai Maruseac
c3f2ef42ae Automated g4 rollback of changelist 288539371.
PiperOrigin-RevId: 288577610
Change-Id: I4466fbb9bea729111d8d26806fb0afcdf1fb8a66
2020-01-07 14:56:09 -08:00
Andrew Selle
2522ce7dd5 Check for overflow in # of bytes computation of tensor allocation.
We check both for product of shape dimensions (# of elements)
and number of bytes (elements * sizeof(data_type)).

@joyalbin provided an initial adaption of the TF overflowl.h impl in
. This is cleaned up and optimized for a refactor that
occurred after.

PiperOrigin-RevId: 288539371
Change-Id: I9298de40afd22ae72da151cc457c1f0937e97d7a
2020-01-07 11:44:48 -08:00
Sachin Joglekar
1f0c9730a3 Add TfLiteContext API for delegates to preview partitioning plan
PiperOrigin-RevId: 288384492
Change-Id: I51901b5ddfc7bb8ac04594f202717f483138bb90
2020-01-06 15:11:21 -08:00
frreiss
66535979f8 Fix second instance of the same problem, and rename my_data -> data 2019-11-25 11:52:22 -08:00
frreiss
2b73edab89 Make BasicInterpreter.ThreeStepAllocate run on big-endian machines 2019-11-25 11:27:42 -08:00
Sachin Joglekar
b09bb78c5a Defines Subgraph & Interpreter API to deallocate non-persistent memory. Re-allocation happens via AllocateTensors().
PiperOrigin-RevId: 280744644
Change-Id: I0c03855dea7200739a70f75d261a1411e6cbe2e9
2019-11-15 15:22:03 -08:00
Robert David
a525e50ae6 Change reinterpret_cast to static_cast when converting between void* and T* pointers.
PiperOrigin-RevId: 277601066
Change-Id: Ia5c0e410fa7785246ded10529246058409a8a742
2019-10-30 15:48:00 -07:00
Yu-Cheng Ling
237191202d Automated rollback of commit 6b66d4a05e
PiperOrigin-RevId: 273452464
2019-10-08 03:10:29 -07:00
A. Unique TensorFlower
6b66d4a05e Implemented "Greedy by size planner" for that produces more optimal memory allocation.
- in Mobilenet V1 has 35% has memory reduction
- in Mobilenet V2 has 2% reduction
Majority of all other tested models demonstrated ~10-15% improvement.

PiperOrigin-RevId: 269423980
2019-09-16 16:07:34 -07:00
A. Unique TensorFlower
a4bfabe128 Automated rollback of commit 4f8a6dd61c
PiperOrigin-RevId: 266312143
2019-08-29 23:27:54 -07:00
A. Unique TensorFlower
4f8a6dd61c Implemented "Greedy by size planner" for that produces more optimal memory allocation.
- in Mobilenet V1 has 35% has memory reduction
- in Mobilenet V2 has 2% reduction
Majority of all other tested models demonstrated ~10-15% improvement.

PiperOrigin-RevId: 266182266
2019-08-29 11:30:15 -07:00
Jared Duke
4735b9bc02 Only prod log interpreter creation on mobile platforms
PiperOrigin-RevId: 263674744
2019-08-15 17:49:46 -07:00
Sachin Joglekar
b28755fbd2 Delegate application failure leaves interpreter in valid state.
PiperOrigin-RevId: 261351122
2019-08-02 11:50:02 -07:00
Jian Li
f92fe18d0f Reset variable to its actual zero point for quantized tensors.
PiperOrigin-RevId: 258886405
2019-07-18 18:40:22 -07:00
Sachin Joglekar
4cca406165 Set subgraph state correctly after Undoing delegates, and refactor ResizeInputTensor to be no-op if applicable.
PiperOrigin-RevId: 256432644
2019-07-03 17:34:34 -07:00
Sachin Joglekar
02af1c3823 Enables resizing inputs for delegates that don't support dynamic tensors.
PiperOrigin-RevId: 255413447
2019-06-27 09:20:33 -07:00
Sachin Joglekar
4f335270b9 Allow unresolved custom ops in InterpreterBuilder, to be resolved by delegates later.
PiperOrigin-RevId: 251533737
2019-06-04 15:58:46 -07:00
A. Unique TensorFlower
103472ebbb Reenable ZeroInterpreter test on fuchsia builds.
PiperOrigin-RevId: 249923933
2019-05-24 17:20:10 -07:00
A. Unique TensorFlower
d7aba7a001 Disable ZeroInterpreter test on fuchsia builds.
PiperOrigin-RevId: 249711098
2019-05-23 14:09:21 -07:00
TensorFlower Gardener
27cfc61581 Merge pull request from amitsrivastava78:flat_buffer
PiperOrigin-RevId: 248075161
2019-05-13 22:36:01 -07:00
A. Unique TensorFlower
c58ddf2520 Propagate half precision float through tflite
PiperOrigin-RevId: 247082214
2019-05-07 15:01:57 -07:00
A. Unique TensorFlower
1c96242ccb Implement UseNNAPI() on top of NnApiDelegate.
PiperOrigin-RevId: 246533956
2019-05-03 11:13:27 -07:00
TensorFlower Gardener
024fe4100a Merge pull request from ANSHUMAN87:interpreter-grammar-fix
PiperOrigin-RevId: 242927801
2019-04-10 13:34:39 -07:00
TensorFlower Gardener
aa63d2feb9 Merge pull request from amitsrivastava78:interpreter_tc_2
PiperOrigin-RevId: 242214108
2019-04-05 17:04:35 -07:00
ANSHUMAN TRIPATHY
07541231ee Comments updated 2019-03-31 10:29:29 +05:30
Jared Duke
2893027307 Fix some issues with model verification
PiperOrigin-RevId: 240992390
2019-03-29 09:30:09 -07:00
TensorFlower Gardener
96e08caa7d Merge pull request from amitsrivastava78:error_3
PiperOrigin-RevId: 238248906
2019-03-13 10:23:11 -07:00
Amit Srivastava
64ae9a121f Added the TCs for CopyFromBufferHandle scenario.
This was one of the TODO mentioned in the file.
2019-03-13 09:44:04 +05:30
Jared Duke
7a44d2d882 Log TensorFlow Lite interpreter creation to the console
This log is useful for diagnostics and testing.

PiperOrigin-RevId: 238061053
2019-03-12 11:49:37 -07:00
Amit Srivastava
779ba31b94 Removing the duplicates from the file.
Found the duplicates and removed them.
2019-03-11 12:33:14 +05:30
Amit Srivastava
c6155dfa41 Fixed warning in graph_info_test.cc
Warning removed from the file.
2019-03-09 06:54:49 +05:30
Amit Srivastava
511802356a Fixed the warning in the file
Removed the warning from the file
2019-03-06 15:07:07 +05:30
A. Unique TensorFlower
701ad58880 Merged commit includes the following changes:
230445097  by A. Unique TensorFlower<gardener@tensorflow.org>:
    Automated rollback of changelist 230438242.

230444163  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Add missing right parenthesis in tf.Session doc.

--
230443190  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Adding a capture_resource_var_by_value argument to Defun in which resource variable could be captured as var_handle instead of var value. This is useful for TPU inference where we don't want copy variable from CPU to TPU.

--
230442585  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Update docstring to reflect MultiDeviceIterator now supported
    in eager execution.

--
230441663  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Internal changes.

--
230439505  by A. Unique TensorFlower<gardener@tensorflow.org>:

    Interpreter conversion of new schema quantization to new CAPI quantization

--
230438242  by A. Unique TensorFlower<gardener@tensorflow.org>:

    n/a

--

PiperOrigin-RevId: 230445097
2019-01-22 19:39:56 -08:00