aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/grappler/op_types.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-05-25 12:54:49 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-25 12:57:18 -0700
commit0b522fd22b986704d1056254961cc7988ae182eb (patch)
tree472c18f77c5e6b2c1dae0f1aacd6234f5e53436b /tensorflow/core/grappler/op_types.h
parentae0eb1b7f81f6d98e0503b9568c72feaa805e655 (diff)
Add ScopedAllocatorOptimizer in support of CollectiveReduce.
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
Diffstat (limited to 'tensorflow/core/grappler/op_types.h')
-rw-r--r--tensorflow/core/grappler/op_types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/core/grappler/op_types.h b/tensorflow/core/grappler/op_types.h
index 915da21fad..e7f39981c0 100644
--- a/tensorflow/core/grappler/op_types.h
+++ b/tensorflow/core/grappler/op_types.h
@@ -38,6 +38,7 @@ bool IsBiasAddGrad(const NodeDef& node);
bool IsBitcast(const NodeDef& node);
bool IsCast(const NodeDef& node);
bool IsCheckNumerics(const NodeDef& node);
+bool IsCollective(const NodeDef& node);
bool IsComplex(const NodeDef& node);
bool IsComplexAbs(const NodeDef& node);
bool IsConj(const NodeDef& node);