aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/common_runtime/scoped_allocator_mgr.h
Commit message (Collapse)AuthorAge
* Add ScopedAllocatorOptimizer in support of CollectiveReduce.Gravatar A. Unique TensorFlower2018-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The efficiency of CollectiveReduce is greatly improved by merging multiple parallel reductions over smaller tensors into a single reduction over a larger tensor that is the concatentation of the smaller tensors. Because CollectiveReduce is essentially an element-wise array operation which operates on a 1-D reshape of the input tensor it is eligible for a ScopedAllocation optimization. The optimization works by looking for serially independent instances of CollectiveReduce that lie within the same name-scope tier and have the same control-flow (e.g. loop) embedding structure. Where two or more such nodes are found the upstream nodes that generate their inputs are modified to write their outputs into consecutive regions of a single tensor buffer maintained by a ScopedAllocator. The multiple CollectiveReduce nodes are then replaced by a single CollectiveReduce that operates in-place on the backing buffer. The effectiveness of the optimization depends on there being candidate CollectiveReduce nodes with these characteristics that become eligible for execution at close to the same time. If the name scope is too large, and includes nodes that become execution eligible at very different times, this graph rewrite could result in a slowdown. Note that this optimization is experimental: it is not guaranteed to work, especially for ops other than CollectiveReduce. PiperOrigin-RevId: 198089642
* Add new Ops for ScopedAllocator and the associated Concat and Split. TheGravatar Ayush Dubey2018-03-22
| | | | | | | | | ScopedAllocatorOp allocates a large backing tensor whose slices may be concatenated or splitted with ScopedAllocatorConcatOp and ScopedAllocatorSplitOp respectively. These ops should only be added via Grappler optimizations on the dataflow graph provided by the user. PiperOrigin-RevId: 190097586
* Add ScopedAllocator and ScopedAllocatorMgr.Gravatar Ayush Dubey2018-03-14
A ScopedAllocator is a new memory allocator which manages slices of a large tensor. ScopedAllocatorMgr manages all scoped allocators per device. The ScopedAllocatorMgr comprises of multiple ScopedAllocatorContainers, one per step id. If a step terminates abnormally, the corresponding ScopedAllocatorContainer will clean up all allocated memory in that step. PiperOrigin-RevId: 189051914