This, combined with inlining the methods of NodeMap also gives a ~4.8% speedup of grappler on a large inference graph.
PiperOrigin-RevId: 304515494
Change-Id: Ia834d2019a142b470333dc8dd4b8151694a6510d
1. Use flat_hash_{map,set}, keyed on string_view, in shape inference code and a few grappler utility functions.
2. Get rid of an unnecessary graph copy in remapper.
Speeds up constant folding by about 6.6% and remapper by ~20% on a large inference graph. Total speedup for grappler optimization is about 4.6%
PiperOrigin-RevId: 304428686
Change-Id: I1b83916f2080fa1f86130b250828518faaa03362
Change NodeMap to use absl::node_hash_map instead of std::unordered_map.
On a particular model with 215k nodes and 255k edges, I measure a 25% speedup of the Grappler MetaOptimizer overall.
PiperOrigin-RevId: 299413265
Change-Id: I741e8f22fa8169044d3d51b81e08d20df301d506
Change NodeMap to use absl::node_hash_map instead of std::unordered_map.
On a particular model with 215k nodes and 255k edges, I measure a 25% speedup of the Grappler MetaOptimizer overall.
PiperOrigin-RevId: 299200501
Change-Id: Ib105f9e8a60318b4559db4b3d9c0bd92f0934ba1
This is motivated by making this more similar to the internal build system.
PiperOrigin-RevId: 278584449
Change-Id: I0545dbb8c0b03af44eac7dc0f90acba8eb036710
Current implementation if ReplaceInputs is half done/broken. Add UpdateFanouts functions that properly takes care of control dependencies, and updates internal state.
PiperOrigin-RevId: 219884693
1. Split GrapView into GraphView and MutableGraphView with separate {Input/Output}Port types with different node pointer constness.
2. Properly use GraphView and MutableGraphView in graph properties, and get rid of const_cast.
3. Remove const_cast in function optimizer.
4. Migrate GraphView to absl containers and hash
PiperOrigin-RevId: 219488040
MutableGraphView was implemented so that the view could be updated when new nodes are added or connections changed. The current passes do not require it only because they do not do any optimization on already optimized nodes, but optimizations like MapFusion require it.
PiperOrigin-RevId: 206046420
Generalize the GetTailOfXXXChain to a more generic graph walker that takes a predicate functor that controls when to stop.
PiperOrigin-RevId: 176577743
cuda_deps.
Fix #includes and deps of contrib/verbs:verbs_util, in particular
removing an unnecessary #include of gpu_util.h that relied on a
transitive dependency through :devices.
PiperOrigin-RevId: 169732234
Splits out a shared object (//tensorflow/libtensorflow_framework.so) with core TensorFlow functionality but neither ops nor kernels. This object does include registries for ops, kernels, filesystems, etc. The expectation is that shared objects containing custom ops will have a runtime dependency on this framework shared object: TensorFlow will load the custom op shared object, and the custom op shared object will use the symbols from the framework shared object to register its ops/kernels/etc. rather than (as before this change) relying on those symbols being in the global symbol table.
In this mode, TensorFlow artifacts (_pywrap_tensorflow.so for Python, libtensorflow.so for the C API; currently excluding Android artifacts) will depend on the framework shared object, which will be packaged with the Python pip package and other language distributions. This means that custom ops targeting the framework shared object will work in any language (C++, Java, Go; previously custom ops in these languages required custom Bazel builds).
Adds a config option which reproduces the old behavior (--config=monolithic), which for Python means building a monolithic pywrap_tensorflow shared object and loading its symbols into the global symbol table (with RTLD_GLOBAL). As before, there will be no extra-Bazel custom op support for other languages when compiling in this mode.
Does not change behavior on Windows; the cmake build is still monolithic.
Requires using tf_cc_binary, tf_cc_test, and (rarely) tf_cc_shared_object rules to link in the framework shared object when adding new TensorFlow build rules.
PiperOrigin-RevId: 169572746