History log of /external/tensorflow/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7d64e124103c8334b7d8b127cd2eff786959d185 06-Jan-2018 Mark Heffernan <meheff@google.com> Remove protobuf-compatibility methods from the Literal class.

This CL primarily does two things:

(1) Remove the protobuf-compatibility methods (eg, mutable_f32s()) from Literal. These were added to Literal as part of the migration of Literal from a proto to a c++ class. Now that Literal is a proper class, these protobuf methods make it difficult to enforce invariants and expose too much of the class' implementation details.

(2) Make shape an immutable property of Literals, and make shape and the data members holding the Literal data coherent by construction. Previously, the shape could be set arbitrarily, and the data members such as f32_ could be arbitrarily sized irrespective of the shape of the literal.

The remainder of the CL mostly deals with the fallout. Notable other changes:

- Literal is no longer a recursive data structure. To avoid copies when passing a subliteral of a tuple-shaped Literal, a LiteralView class is added which provides a read-only view of an arbitrary subliteral.

- Tuple-shaped Literals can no longer be built up incrementally so to avoid copying Literal values during construction, the following methods with move semantics are added: Literal::MoveFrom and Literal::MoveIntoTuple. These methods transfer ownership the underlying buffers enabling, for example, a literal to be moved into an element of a tuple-shaped literal with no data copying.

- Replace the internal data structure holding the actual data from a bunch of std::vectors (eg, s32s_, f32s, etc) to a single ShapeTree<char*>. This significantly simplifies accessors and makes improved support of tuple-shaped literals much easier (eg, Literal::Get<>() can now access elements in arbitrary subliterals).

Also, Literal is made movable, but not copyable. Otherwise, it is all too easy to accidentally introduce expensive copies of Literals. Literal::Clone is added to handle the case where a copy is needed (Literal::CloneToUnique already exists).

PiperOrigin-RevId: 181014890
/external/tensorflow/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc
70062d11bf11d6579bfdbc87c3350a0074a12ae8 13-Dec-2017 A. Unique TensorFlower <gardener@tensorflow.org> Rename Stream::BlockHostUntilDoneWithStatus to BlockHostUntilDone.

PiperOrigin-RevId: 178951330
/external/tensorflow/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc
383a3226a9ad08ac507a3fbd6c220c5c1e15a540 12-Dec-2017 A. Unique TensorFlower <gardener@tensorflow.org> Use BlockHostUntilDoneWithStatus in various places.

PiperOrigin-RevId: 178723711
/external/tensorflow/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc
fca13de37711720fa7e5fe181f23b1625e0c9d60 06-Dec-2017 A. Unique TensorFlower <gardener@tensorflow.org> [XLA] Change default argument to explicit 0 for default address space. NFC

There is a FIXME in llvm::DataLayout::getPointerSize .

PiperOrigin-RevId: 178046949
/external/tensorflow/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc
06deeea373c93ea36547648481c5daf4dc56126f 27-Sep-2017 Mark Heffernan <meheff@google.com> For tuple-shaped data, change ShapedBuffer (an abstraction holding on-device data of a given shape) to also hold an array of pointers representing the tuple structure in the device memory. Previously ShapedBuffer only held array-shaped data at the leaves of the tuple shape. Construction of these array-of-pointers is handled by TransferManager which has to construct array-of-pointers anyway to transfer literals to the device. This change makes ShapedBuffer match the native representative of tuple-shaped data passed into XLA computations. This is the first step to migrating XLA interfaces away from using naked device memory pointers (DeviceMemoryBase) to using more expressive ShapedBuffers instead.

This change enables tuple-shaped parameters in computations run through the LocalClient interface.

Also, change LocalClient interfaces to return ScopedShapedBuffers as these are generally easier to deal with ownership-wise that ShapedBuffers. They are analogous to std::unique_ptr, while ShapedBuffers are analogous to bare pointers.

This change includes a couple other cleanups found along the way:

* move cpu/gpu/interpreter transfer managers into their respective directories under xla/service.

* Make the generic transfer manager take a pointer size. Previously it would just use sizeof(void*) which might not be exactly what is needed.

PiperOrigin-RevId: 170133015
/external/tensorflow/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc