| Commit message (Collapse) | Author | Age |
|
|
|
| |
PiperOrigin-RevId: 215324035
|
|
|
|
|
|
|
|
| |
Unlike Printf, StrFormat does not require type-length qualifiers, e.g
%z, %ll. Nor does it require that you call c_str() to print strings.
So these are fixed up here as well.
PiperOrigin-RevId: 210435915
|
|
|
|
|
|
|
| |
Unfortunately this has to be one big patch, because e.g. absl::StrCat
doesn't accept a TF StringPiece, but as soon as we switch to
absl::string_view, we have to switch away from all of the TF functions.
PiperOrigin-RevId: 209957896
|
|
|
|
|
|
| |
Same for WrapUnique.
PiperOrigin-RevId: 209531124
|
|
|
|
| |
PiperOrigin-RevId: 197331197
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, xla::DeviceMemoryAllocator::Allocate returned a
stream_executor::DeviceMemoryBase. This is morally equivalent to a raw
pointer: It's on you the user to call Deallocate().
Unfortunately we ~never got this right. Essentially all users of
Allocate() call it in a loop, and TF_RETURN_IF_ERROR within the loop.
If any of these allocations fails (mostly commonly, due to OOM), we leak
everything we've allocated up until then.
This patch changes our API so that it returns an owning pointer. Now
things mostly Just Work.
Also worth calling out: The lambda in CpuExecutable::ExecuteOnStream
passed to ExecuteComputeFunction almost certainly had multithreaded
use-after-free bugs. This patch fixes them.
PiperOrigin-RevId: 196000535
|
|
|
|
|
|
|
| |
Previously, we returned a plain ShapedBuffer. But this doesn't capture
our semantics: It's up to the callee to free this ShapedBuffer.
PiperOrigin-RevId: 193854051
|
|
|
|
|
|
|
|
|
| |
These are already notionally equivalent to T* and unique_ptr<T>, so
having a unique_ptr of a {Scoped,}ShapedBuffer is pretty redundant.
Also clean up the ScopedShapedBuffer API a bit.
PiperOrigin-RevId: 193599773
|
|
|
|
| |
PiperOrigin-RevId: 193301997
|
|
|
|
|
|
| |
moving memory ownership instead of copying.
PiperOrigin-RevId: 185871648
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
179277894 by gunan:
Run buildifier on build file.
--
179275101 by meheff:
Replace DeviceMemoryBase with ShapedBuffer in XLA interfaces.
Executable, TransferManager, and AllocationTracker now use ShapedBuffer to hold device memory addresses holding XLA data. Most of the change is straight-forward with the exception of AllocationTracker which was mostly rewritten (and simplified) and some refactoring in the CPU executable.
Also, have ShapedBuffer hold on-host and on-device Shapes which are the shapes of the representation of the data on the host and device, respectively. This is necessary because with cl/178624364 the on-host and on-device shape may no longer be equal.
--
179265385 by A. Unique TensorFlower:
Return error rather than CHECK fail in Executable::ExecuteOnStreamWrapper
--
179264551 by dandelion:
Internal fixes.
--
PiperOrigin-RevId: 179277894
|
|
|
|
|
|
|
|
| |
Use ShapedBuffer to allocate required memory for the shape, then transfer the
literal to the allocated addresses on each replica. Also, add Allocate() method
to ShapedBuffer.
PiperOrigin-RevId: 177900588
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specified by ShapedBuffer rather than DeviceMemoryBase. This is part of a broader replacement of DeviceMemoryBase->ShapedBuffer in several XLA interfaces. With this change TransferManager no longer has to allocate memory to transfer tuples to the device. The existing methods using DeviceMemoryBase will be removed in a followup cl.
Various related changes:
* Make the transfer_manager_test an xla_test so that it runs on all the platforms.
* Make several of the TransferManager methods protected.
* Change ScopedShapedBuffer::Allocate to only allocate device memory buffers, and not fill in the tuple index table. The index table is filled in by the transfer manager. This is a cleaner separation of concerns.
PiperOrigin-RevId: 176015628
|
|
|
|
| |
PiperOrigin-RevId: 175729221
|
|
|
|
| |
PiperOrigin-RevId: 175571632
|
|
|
|
| |
PiperOrigin-RevId: 175304150
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Simplify shape traversal visitors in ShapeUtil and ShapeTree. Add a non-Status form because most uses of the traversal methods do not use it, and remove is_leaf parameter from ShapeTree.ForEach* as it is not frequently used.
PiperOrigin-RevId: 158201574
|
|
XLA is a compiler-based linear algebra execution engine that targets CPUs, GPUs and custom accelerators.
XLA is still experimental; we are releasing it early to get the community involved.
Change: 143990941
|