aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/shape_inference.cc
Commit message (Collapse)AuthorAge
* [XLA] Add documentation and HLO-level support for multi-value sort.Gravatar Michael Kuperstein2018-10-09
| | | | | | No support in any of the backends, and not yet exposed through XlaBuilder. PiperOrigin-RevId: 216465753
* [XLA] Migrate from gtl::FlatSet to absl::flat_hash_setGravatar Benjamin Kramer2018-10-01
| | | | PiperOrigin-RevId: 215324035
* Improve error message in transpose shape inference.Gravatar Tayo Oguntebi2018-10-01
| | | | PiperOrigin-RevId: 215294817
* It is more computationally efficient to represent resize bilinear as aGravatar Blake Hechtman2018-09-20
| | | | | | depthwise convolution instead of a full convolution now that it exists in XLA. PiperOrigin-RevId: 213896333
* Add support for grouped convolutions to the HloEvaluator.Gravatar Adrian Kuegel2018-09-05
| | | | | | | | | Add a missing check to InferConvolveShape(), the output feature dimension needs to be divisible by feature_group_count. Also fix some tests which took a const reference to the return value of a function which doesn't return a reference. PiperOrigin-RevId: 211592011
* [XLA] Make kConvolution, kDot HLO attributes mandatoryGravatar David Majnemer2018-09-04
| | | | | | | | HLO transformations would forget to propagate the feature depth attribute. Making these attributes mandatory, while slightly less convenient for tests, makes HLO transformations more robust. PiperOrigin-RevId: 211490160
* [XLA] Rename all (Mutable)ArraySlice to absl::Span.Gravatar Tim Shen2018-08-30
| | | | PiperOrigin-RevId: 210998142
* Remove (Mutable)ArraySlice implementation and alias them to absl::Span.Gravatar Tim Shen2018-08-30
| | | | | | | | There are several API migrations happening: * ArraySlice's sub-slice constructor => .subspan * MutableArraySlice's container pointer constructor => absl::MakeSpan PiperOrigin-RevId: 210946124
* [XLA] Make explicit that negative interior_padding is not allowed.Gravatar Justin Lebar2018-08-28
| | | | | | Also add testcases that negative convolution dilation is rejected. PiperOrigin-RevId: 210657224
* [XLA] Add the xla interface for CollectivePermute.Gravatar A. Unique TensorFlower2018-08-28
| | | | PiperOrigin-RevId: 210576458
* Removed redundant std::string -> string conversions.Gravatar A. Unique TensorFlower2018-08-28
| | | | PiperOrigin-RevId: 210565027
* [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] Tighten up shape inference rulesGravatar David Majnemer2018-08-23
| | | | | | | | | kRoundNearestAfz should be treated like kCeil and kFloor. kClz is only reasonable on integral types, not floating point or predicate types. kAbs and kSign are only reasonable on signed types and complex. PiperOrigin-RevId: 209978375
* [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
* [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
* Improve gather ergonomics by renaming fields.Gravatar Sanjoy Das2018-08-16
| | | | | | | | | | | | | This CL renames the various inputs to the Gather HLO to be more mnemonic by making it more obviously a batch dynamic-slice. The replacements I made are: s/elided_window_dims/collapsed_slice_dims/g s/window_bounds/slice_sizes/g s/gather_dims_to_operand_dims/start_index_map/g s/gather_indices/start_indices/g s/output_window_dims/offset_dims/g PiperOrigin-RevId: 209051067
* Add a feature_group_size parameter to the Convolution HLO op.Gravatar Adrian Kuegel2018-08-16
| | | | | | | This is a first step towards supporting grouped convolutions, which are a generalization of depthwise convolution. PiperOrigin-RevId: 208950311
* [XLA] Add the xla interface for AllToAll.Gravatar A. Unique TensorFlower2018-08-08
| | | | PiperOrigin-RevId: 207971529
* [XLA] Introduce variadic version of reduce.Gravatar Michael Kuperstein2018-08-02
| | | | | | This defines the semantics, and adds parser and shape inference support. Since support is not plumbed through the rest of the compiler here, multi-output reduce is still rejected by the HLO verifier, and is not exposed through XlaBuilder. PiperOrigin-RevId: 207148035
* [XLA] Add Scatter HLO.Gravatar A. Unique TensorFlower2018-08-01
| | | | PiperOrigin-RevId: 207045468
* [XLA] Shape inference should verify the shapes of sort keys and sort values ↵Gravatar Michael Kuperstein2018-07-17
| | | | | | match. PiperOrigin-RevId: 204974328
* Implement lgamma for XLAGravatar A. Unique TensorFlower2018-07-16
| | | | | | | | | | | Add support for Real and Imag for real floating point types. Compute the Lgamma function using Lanczos' approximation from "A Precision Approximation of the Gamma Function". SIAM Journal on Numerical Analysis series B. Vol. 1: lgamma(z + 1) = (log(2) + log(pi)) / 2 + (z + 1/2) * log(t(z)) - t(z) + A(z) t(z) = z + kLanczosGamma + 1/2 A(z) = kBaseLanczosCoeff + sigma(k = 1, n, kLanczosCoefficients[i] / (z + k)) PiperOrigin-RevId: 204815805
* [TF:XLA] Split select HLO into array- and tuple-select.Gravatar A. Unique TensorFlower2018-07-03
| | | | | | | | | | | | Array select and tuple-select already are handled separately in all backends and HLO passes: Array select is an elementwise operation. The shapes of the to operands have the same dimensions. Tuple select does not define its own output, but instead forwards the true- or false- operand based on a scalar predicate operand. This CL reflects this by adding a new kTupleSelect HLO. The XLA builder interface stays the same and dispatches based on the operand shapes. No change in the operation semantics. This CL just splits the existing select operation into two opcodes and preserves the existing semantics. HLO cost analysis is fixed to handle the two ops appropriately. PiperOrigin-RevId: 203180342
* Change Send and Recv HLOs to take a token operand.Gravatar Mark Heffernan2018-07-02
| | | | | | Send and Recv HLOs now have an additional required operand which must be token-shaped. XLA client interface for these operations is unchanged and will be updated in follow up CLs. PiperOrigin-RevId: 202993121
* [XLA] Add key-value version of Sort HLO.Gravatar Michael Kuperstein2018-06-29
| | | | | | This is only currently implemented in the evaluator backend, and even that implementation is partial - the key and value type must match. PiperOrigin-RevId: 202673122
* Rename HLO opcode kGenerateToken to kAfterAll.Gravatar Mark Heffernan2018-06-25
| | | | | | | | Long term I think we want to require kAfterAll to take at least one token as operand so it cannot generate a token out of thin air, so kGenerateToken is no longer an appropriate name. Instead, a primordial token would be supplied some how in the entry computation, perhaps as a parameter, and then threaded to any side-effecting ops. NFC. PiperOrigin-RevId: 202079040
* [TF:XLA] Add Xor HLO operation.Gravatar A. Unique TensorFlower2018-06-21
| | | | | | This avoids lowering xor in terms of other bitwise ops and all backends have instructions for it anyway. PiperOrigin-RevId: 201597493
* Performance microtweaks: Pass by reference rather than by value; pre-reserve ↵Gravatar A. Unique TensorFlower2018-06-19
| | | | | | capacity when total vectoroid size is known. PiperOrigin-RevId: 201172723
* 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
* Cleanup shape_inference.Gravatar A. Unique TensorFlower2018-06-08
| | | | PiperOrigin-RevId: 199876297
* Add kGenerateToken HLO instruction.Gravatar Mark Heffernan2018-06-08
| | | | | | | | | | The new HLO instruction serves two purposes. (1) It generates a new token value. This is the only way to create tokens. (2) The operation is variadic, taking zero or more token operands. The operation acts as a join of its operands. I considered initially using a kConstant constant as a method to create new tokens, but this ran into problems because of expectations in backends regarding constants and their materialization. This CL enables creation of generate-token instructions, but the new instruction is not supported yet in any backend. PiperOrigin-RevId: 199836205
* 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
* [XLA] s/tensorflow::Status/Status/.Gravatar Justin Lebar2018-05-11
| | | | | | | These are type aliases of one another; we'd like to be consistent and use the shorter one. PiperOrigin-RevId: 196322955
* [XLA] Add log1p/expm1Gravatar David Majnemer2018-05-09
| | | | | | | A new HLO seems prudent as it allows implementations to use fancy techniques to compute accurate results for small inputs. PiperOrigin-RevId: 196078115
* Replaced calls to tensorflow::StringPiece::ToString with std::string ↵Gravatar A. Unique TensorFlower2018-05-07
| | | | | | | | | | conversions. That is, instances of sp.ToString() are replaced with std::string(sp). This will allow tensorflow::StringPiece::ToString to be removed, which is necessary before it can be replaced with absl::string_view. PiperOrigin-RevId: 195689392
* Initial addition of CLZ HLOGravatar Jacques Pienaar2018-04-18
| | | | | | | * Adds the HLO op and lowering on CPU/GPU/evaluator; * This does not update the operation semantics; PiperOrigin-RevId: 193461989
* [XLA] Redesign: implement Tuple and GetTupleElement.Gravatar A. Unique TensorFlower2018-03-27
| | | | PiperOrigin-RevId: 190698245
* [XLA] Redesign: implement and test ternary ops.Gravatar A. Unique TensorFlower2018-03-26
| | | | PiperOrigin-RevId: 190561679
* [XLA] Redesign: implement and test unary and binary ops.Gravatar A. Unique TensorFlower2018-03-26
| | | | | | | | Also, - Templatized ComputeAndCompareRX and CreateRXParameter so that they accept XlaBuilder and XlaOp. - Clear data held by an XlaBuilder when Build() is called, otherwise errors will occur when the builder is reused. PiperOrigin-RevId: 190534245
* [XLA] Add XlaBuilder. This is the first step of implementing the ↵Gravatar A. Unique TensorFlower2018-03-14
| | | | | | client-service interface redesign. Implemented ops: Add, Call, Constant, Parameter. PiperOrigin-RevId: 189061445
* Add more debugging output, filtering by int_type in XLA test, more tests.Gravatar Jacques Pienaar2018-03-09
| | | | PiperOrigin-RevId: 188513895
* Fix typo in error messageGravatar Sanjoy Das2018-03-08
| | | | PiperOrigin-RevId: 188425637
* Fix ShapeUtil::CompatibleIgnoringElementType for scalar vs tuple comparisionGravatar A. Unique TensorFlower2018-03-07
| | | | | | | Previously if the lhs was a scalar and the rhs was a tuple of arbitrary shape it reported them as compatible what is clearly wrong. PiperOrigin-RevId: 188155575
* Make shape inference error messages more consistent.Gravatar Eli Bendersky2018-03-02
| | | | PiperOrigin-RevId: 187662562
* Generalize the gather_indices dimension that stores indicesGravatar Sanjoy Das2018-02-26
| | | | | | | | | This is now exposed as a index_vector_dim dimension number. Also fixed an off-by-one error in ValidateGatherDimensionNumbers in the expression computing output_shape_rank. PiperOrigin-RevId: 187040748