Commit Graph

11 Commits

Author SHA1 Message Date
Gaurav Jain
c74b95e771 Remove experimental mirroring policy APIs.
Mirroring has been enabled by default for a long time. All the runtime
code that inspected the flag has long been removed. This is just
cleaning up some leftover code.

PiperOrigin-RevId: 328421064
Change-Id: I193b67f1f12f96ebb8b6822a780d88f4b82e77af
2020-08-25 16:00:49 -07:00
Yujing Zhang
206d6af149 Add lazy_remote_inputs_copy to TFE_ContextOptions to control lazy remote tensor copy. Disable it by default.
PiperOrigin-RevId: 279212487
Change-Id: Ie46de71fd2902b79281e6257ff28c06d9aaa73d4
2019-11-07 18:35:44 -08:00
Derek Murray
73e53d6343 Make DeviceMgr a pure virtual interface with StaticDeviceMgr as its only implementation.
This is a precursor to haoyuzhang@'s work on supporting dynamic device managers.

PiperOrigin-RevId: 266514057
2019-08-30 22:55:53 -07:00
Gaurav Jain
e75d8dc058 Add mirroring for remote tensor handles
When executing on a remote worker, we may have to copy the TensorHandle
for each executed op. To avoid duplicated work, we expand the
TensorHandle to keep track of mirrors which are tied to the lifetime of
the TensorHandle. If a mirror already exists on a remote worker, no
additional copy is needed.

The change consists of the following:
- Add map of remote mirrors in TensorHandle.
- Add `mirror` boolean argument to EagerCopyToDevice which indicates to try
  configuring a mirror if possible.
- Add Device argument to RemoteAddress to handle mirrors.
- Expose a ContextMirroringPolicy for the EagerContext. We plan to add
  additional policies in the future, such as local tensor mirroring.
- Rename ContextDevicePlacementPolicy variables to be consistent with
  ContextMirroringPolicy.

PiperOrigin-RevId: 253945140
2019-06-19 00:39:29 -07:00
Gaurav Jain
6b1371de93 Remove legacy EagerContext constructor
PiperOrigin-RevId: 253598769
2019-06-17 10:10:59 -07:00
Akshay Modi
eee7e2f0c5 Refcount the EagerContext.
Currently, the only place we increase the refcount is in remote tensor handle
destructors.

Unfortunately, since tensorhandle/context lifetime is tied to python objects, it did not seem possible to enforce deletion of the context to be after the deletion of all tensor handles. This also means that if you remote tensors, you will not be able to delete the EagerContext. This is mostly fine, since we don't support deletion of eager contexts in any case, and we only run into this issue during python teardown.

PiperOrigin-RevId: 246178464
2019-05-01 13:42:06 -07:00
Jared Duke
2d1a3052e1 Wire TFLite thread count to the eager context
PiperOrigin-RevId: 226214825
2018-12-19 17:25:20 -08:00
Brennan Saeta
1dab0d8792 Automated rollback of commit 50e5b015be
PiperOrigin-RevId: 223011511
2018-11-27 10:19:20 -08:00
A. Unique TensorFlower
50e5b015be Automated rollback of commit 809ed3c835
PiperOrigin-RevId: 222646553
2018-11-23 14:58:26 -08:00
Brennan Saeta
809ed3c835 [Core]: Use unique_ptr in DeviceMgr
In order to take advantage of the type system to help enforce ownership, this
change refactors DeviceMgr to use std::unique_ptr<Device> instead of Device*'s.
It also updates all callers to use the new types.

PiperOrigin-RevId: 222645861
2018-11-23 14:39:51 -08:00
Austin Anderson
61c6c84964 Migrate TensorFlow Lite out of tensorflow/contrib
This change moves //tensorflow/contrib/lite to //tensorflow/lite in preparation
for TensorFlow 2.0's deprecation of contrib/. If you refer to TF Lite build
targets or headers, you will need to update them manually. If you use TF Lite
from the TensorFlow python package, "tf.contrib.lite" now points to "tf.lite".
Please update your imports as soon as possible.

For more details, see https://groups.google.com/a/tensorflow.org/forum/#!topic/tflite/iIIXOTOFvwQ

@angersson and @aselle are conducting this migration. Please contact them if
you have any further questions.

PiperOrigin-RevId: 219536476
2018-10-31 14:20:28 -07:00