aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_computation.cc
Commit message (Collapse)AuthorAge
* Support removing side effecting instructions with ↵Gravatar A. Unique TensorFlower2018-10-10
| | | | | | | | | | RemoveInstructionAndUnusedOperands If the caller explicitly asks to remove a side effceting instruction (e.g. all-reduce) then we should respect it instead of silently ignoring the request. PiperOrigin-RevId: 216505133
* Fixes for few issues in HloModule::CreateFromProto()Gravatar A. Unique TensorFlower2018-10-02
| | | | PiperOrigin-RevId: 215460064
* [XLA] Migrate from gtl::FlatSet to absl::flat_hash_setGravatar Benjamin Kramer2018-10-01
| | | | PiperOrigin-RevId: 215324035
* [XLA] Migrate from gtl::FlatMap to absl::flat_hash_mapGravatar Benjamin Kramer2018-10-01
| | | | PiperOrigin-RevId: 215272497
* Name fusion parameters simply "param_X".Gravatar Mark Heffernan2018-10-01
| | | | | | | | Where "X" is the parameter number. Previously, fusion parameter names including the name of the original instruction which produced the value which was confusing. PiperOrigin-RevId: 215238171
* [XLA] Make HloComputation::instruction_count() constant-time.Gravatar Michael Kuperstein2018-09-25
| | | | | | | * Use a FlatMap for instruction_iterators_, and actually remove elements from it (which is cheap for a FlatMap). * Use the size of the map (which is O(1)) rather than the size of the list (which is O(n)) for instruction_count(). PiperOrigin-RevId: 214459259
* [XLA] Allow adding extra instructions in HloComputation::CloneWithReplacementsGravatar Michael Kuperstein2018-09-17
| | | | PiperOrigin-RevId: 213316504
* Conditionally allow changing a non-fusion computation root_instruction shape.Gravatar A. Unique TensorFlower2018-09-16
| | | | PiperOrigin-RevId: 213191899
* Preserve unique ids when serializing/deserializing HLO protos.Gravatar Mark Heffernan2018-09-12
| | | | | | Re-assigning unique IDs broke serialization of HloSchedule, and keeping IDs stable improves the fidelity of the proto serialization. This change requires that instructions in HLO module protos have valid, module-scope-unique ids so change the XLA builder to hand out module-scope-unique ids. Previously, instruction ids were only unique in the computation scope. PiperOrigin-RevId: 212692339
* Add HloSchedule to HloModule.Gravatar Mark Heffernan2018-09-06
| | | | | | | | Add HloSchedule as a field on HloModule. This will enable scheduling to be a normal HLO pass and enable some passes such as copy insertion to more easily use tighter instruction live ranges based on the schedule. This change required adding HloSchedule to the "hlo" library because of circular dependencies. Nothing except for tests actually sets the schedule at the moment, but follow up cls will add a scheduling pass which will do so. PiperOrigin-RevId: 211815293
* [XLA] Rename all (Mutable)ArraySlice to absl::Span.Gravatar Tim Shen2018-08-30
| | | | PiperOrigin-RevId: 210998142
* Fix perfromance of HloComputation::ComputeChannelDependenciesGravatar A. Unique TensorFlower2018-08-28
| | | | | | | | | | | | Previously it used an std::map containing std::vector's what added a large overhead to HloComputation::MakeInstructionPostOrder when a model contained a large number of channels. The new implementation replaced it with a FlatMap and an InlineVector what eliminates a large number of allocations and improves perfromance by a lot. PiperOrigin-RevId: 210531816
* [XLA] Switch to absl::StrFormat.Gravatar Justin Lebar2018-08-27
| | | | | | | | 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
* [XLA] Use "absl::" rather than "::absl".Gravatar Justin Lebar2018-08-23
| | | | | | Also move 'using' statements into namespaces. PiperOrigin-RevId: 210055083
* [XLA] Stop including str_util.h.Gravatar Justin Lebar2018-08-23
| | | | PiperOrigin-RevId: 210049592
* [XLA] Switch from tensorflow::str_util::Join to absl::StrJoin.Gravatar Justin Lebar2018-08-23
| | | | PiperOrigin-RevId: 210018843
* [XLA] Use absl string types and functions instead of the TF versions.Gravatar Justin Lebar2018-08-23
| | | | | | | 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
* [TF:XLA] Use unique_id_ to compare computations for equality quickly.Gravatar Dimitris Vardoulakis2018-08-22
| | | | PiperOrigin-RevId: 209819199
* Handle communicating instructions in HloComputation::ComputeReachabilityGravatar A. Unique TensorFlower2018-08-21
| | | | | | | | | | | | Send&recv instructions and cross-replica-sum instructions are imposing extra dependencies via the channel id or all reduce id. This CL teaches the reachability calculation logic in hlo computation to correctly account for these "invisible" dependencies. The main purpose is to stop multi output fusion from generating dependency cyclies via communicating instructions. PiperOrigin-RevId: 209593997
* [XLA] Use absl::make_unique instead of xla::MakeUnique.Gravatar Justin Lebar2018-08-20
| | | | | | Same for WrapUnique. PiperOrigin-RevId: 209531124
* [XLA] Switch to absl versions of the c_foo functions.Gravatar Justin Lebar2018-08-20
| | | | PiperOrigin-RevId: 209502513
* Automated rollback of commit 4a41f50648929197954d892559587cb76458d306Gravatar A. Unique TensorFlower2018-08-17
| | | | PiperOrigin-RevId: 209248552
* [XLA] Switch to absl versions of the c_foo functions.Gravatar Justin Lebar2018-08-17
| | | | PiperOrigin-RevId: 209247783
* Co-allocate call operands with callee parametersGravatar Sanjoy Das2018-07-16
| | | | | | | | | | | | | Right now we give these parameters an additional allocation and then don't use it. This is interesting for the CPU backend because we use call instructions to represent fork-join parallelism (i.e. a specially annotated kCall instruction tells the CPU IR emitter to shard the called computation across CPU threads). Moreover, I need this for a principled fix to b/111116907. PiperOrigin-RevId: 204820965
* [XLA] BFloat16 propagation: add de-aliasing copies before while loop inputs.Gravatar Yuanzhong Xu2018-07-09
| | | | | | | | The while loop input and output alias each other, so as long as an input is also used by other ops that could not use BF16, the propagation pass could not change such an input/ouput to BF16 even if all uses in the while loop could use BF16. Add copies for each while loop operand. This increases the chance to propagate BF16 through the while loop; if some of these copies do not help, they will remain same-shape copies and be removed at the end. This can sometimes increase HBM usage because both BF16 and F32 copies are alive, and can sometimes reduce HBM usage. PiperOrigin-RevId: 203848348
* Minor performance improvement for ComputeReachabilityGravatar A. Unique TensorFlower2018-07-04
| | | | | | | | | We have two versions of HloReachabilityMap::SetReachabilityToUnion where one of them is slightly more efficient by not returning if the reachability have been changed or not. This change migrates the users not caring about the return value to the faster variant. PiperOrigin-RevId: 203256625
* Change Send, SendDone, Recv and RecvDone to produce tokens.Gravatar Mark Heffernan2018-07-03
| | | | | | This is a follow up to cl/202069017 which added tokens as operands to Send and Recv. PiperOrigin-RevId: 203145403
* [XLA] Avoid fusion nodes to have duplicate operands during replacing uses.Gravatar Yuanzhong Xu2018-06-25
| | | | PiperOrigin-RevId: 202049336
* [TF:XLA] Fix for HLO instruction post-order DFS and multioutput fusion.Gravatar A. Unique TensorFlower2018-06-19
| | | | | | | | | Cycles were not handled correctly when computing the postorder of an HLO computation. Add methods to multioutput fusion that allows subclasses to recompute and query the current reachability map. PiperOrigin-RevId: 201274181
* [XLA] Switch PostOrder accessors to use std::vector instead of std::list.Gravatar Benjamin Kramer2018-06-15
| | | | | | | std::list is just hilariously inefficient and the postorder list creation has been rewritten not to not depend on splicing anymore so there's no need for the list. While there remove the old unused postorder list creation code. PiperOrigin-RevId: 200743677
* Add support for TOKEN type to CPU/GPU backends.Gravatar Mark Heffernan2018-06-14
| | | | | | | | TOKENs will be used for ordering side-effecting operations. They are not materialized but can be contained in tuples and flow into and out of computations. This CL adds a trivial representation for the cpu and gpu backends to support TOKENs and modifies copy insertion to avoid making copies of tokens. This also adds a Literal TOKEN which is required for the interpreter backend. PiperOrigin-RevId: 200623120
* Make deleting HloInstruction safer.Gravatar A. Unique TensorFlower2018-06-14
| | | | PiperOrigin-RevId: 200555862
* Fix assumptions that a Shape must be a tuple or an array.Gravatar Mark Heffernan2018-06-13
| | | | | | | | | | | | A TOKEN primitive type was added with cl/199215963 and XLA also has an OPAQUE primitive type. However, in many places in XLA we assume either a tuple or array. This CL fixes many of those instances, but some may remain. Identified instances were discovered by searching for IsTuple or IsArray so the set of fixes is not exhaustive. Also opportunistically addressed a couple potential points of confusion in the ShapeUtil interface: (1) Rename ShapeUtil::HasZeroElements to ShapeUtil::IsZeroElementArray. The point of confusion here is that tuples can also have zero elements and HasZeroElements would check fail on tuple shapes. Method no longer check fails if the given shape is not an array. (2) ShapeUtil::IsNil now returns true only for empty tuples. Previously it also returned true for zero-element array types which was confusing because ShapeUtil::MakeNil creates an empty tuple. PiperOrigin-RevId: 200452672
* Remove unused variable from HloComputation::MakeInstructionPostOrderGravatar A. Unique TensorFlower2018-06-12
| | | | PiperOrigin-RevId: 200189642
* [XLA] Sanitize HloComputation and HloInstruction names.Gravatar A. Unique TensorFlower2018-06-11
| | | | PiperOrigin-RevId: 200110003
* Improve performance of HloComputation::MakeInstructionPostOrderGravatar A. Unique TensorFlower2018-06-07
| | | | | | | | | | | | Previously it used the same infrastructure as HloInstruction::Accept what caused a high overhead for large models due to the excess amount of work it have to do to support modifying the graph under iteration and due to the lack of caching on graphs with multiple sinks. The new code is a very simple implementation of an iterative DFS based topological sort. PiperOrigin-RevId: 199606688
* Introduced kDomain HLO instruction set isolation to bound connected sets of ↵Gravatar A. Unique TensorFlower2018-05-29
| | | | | | | | instructions with similar attributes (ie, sharding). This CL simply adds the infrastructure, but leaves the wire-on to a separate CL. PiperOrigin-RevId: 198503625
* Implement additional options to control the string output of HloInstruction ↵Gravatar A. Unique TensorFlower2018-05-11
| | | | | | and HloComputation. PiperOrigin-RevId: 196334340
* [XLA] Make hlo deserialization stable for HloModule by sorting by ids when ↵Gravatar A. Unique TensorFlower2018-05-09
| | | | | | | | | | creating from proto. Also, delete the HloModule parameter HloInstruction::CreateFromProto, it's not used anywhere. Also, in ToProto, set sharding to proto if there is sharding. PiperOrigin-RevId: 196049173
* Add infrastructure for a backend-specific configuration for each op. This is ↵Gravatar Bjarke Hammersholt Roune2018-05-05
| | | | | | intentionally not exposed in ComputationBuilder and is not intended for use or to be set at all prior to the last backend-specific part of compilation. PiperOrigin-RevId: 195493500
* Restructuring the HLO partitioner to fit host computation and handle kCall.Gravatar A. Unique TensorFlower2018-04-04
| | | | | | | | Pre process the input module to reassign reserved devices (like the host compute one) to new sequentially increasing device numbers, and track those in the GlobalState. This avoids having many places where we need to spread the is-special-device logic, within the HLO partitioner and its related components. Added handling for kCall, which was missing from previous implementation. PiperOrigin-RevId: 191601831
* [XLA] Use IDs instead of names to represent the edges of HLO graph in hlo.proto.Gravatar A. Unique TensorFlower2018-03-20
| | | | PiperOrigin-RevId: 189831057
* [XLA] Simplify the HLO proto: don't nest the fusion computation in an fusion ↵Gravatar A. Unique TensorFlower2018-03-20
| | | | | | HloInstructionProto. PiperOrigin-RevId: 189811729
* [XLA] Store the program shape in the HloModuleProto and HloComputationProto.Gravatar A. Unique TensorFlower2018-03-06
| | | | PiperOrigin-RevId: 188100425
* Automated g4 rollback of changelist 185623948Gravatar A. Unique TensorFlower2018-02-16
| | | | PiperOrigin-RevId: 186038783
* Automated g4 rollback of changelist 185598764Gravatar A. Unique TensorFlower2018-02-13
| | | | PiperOrigin-RevId: 185623948
* Wire in support for XLA kConditional instruction.Gravatar A. Unique TensorFlower2018-02-13
| | | | PiperOrigin-RevId: 185598764
* Internal changeGravatar Justin Lebar2018-02-02
| | | | PiperOrigin-RevId: 184239740
* [XLA] Remove '%' when printing the hlo text in short parsable mode.Gravatar A. Unique TensorFlower2017-12-14
| | | | PiperOrigin-RevId: 179138523
* [XLA] Allow omitting operands shapes and program shapes.Gravatar A. Unique TensorFlower2017-12-14
| | | | PiperOrigin-RevId: 179132435