| Commit message (Collapse) | Author | Age |
|
|
|
| |
PiperOrigin-RevId: 213693027
|
|
|
|
|
|
|
|
|
| |
Also puts a ".unoptimized" suffix on dumped HLO protobuf files
to avoid the unoptimized dumped HLO protobuf colliding with the
optimized dumped HLO protobufs when the same dump directory is
specified for both.
PiperOrigin-RevId: 212914100
|
|
|
|
|
|
| |
StringPiece and string_view are the same now, no need to convert between them.
PiperOrigin-RevId: 211195959
|
|
|
|
|
|
| |
dependencies as well.
PiperOrigin-RevId: 211038094
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 210049592
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 209686671
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
209663919 by yifeif<yifeif@google.com>:
Internal change.
--
209663914 by amitpatankar<amitpatankar@google.com>:
Fix the topk_op_test for numpy>1.15.
--
209660476 by jdduke<jdduke@google.com>:
Fix model lifetime for TensorFlow Lite C# bindings
Ensure the model's existence for the duration of the interpreter,
as per API requirements.
--
209655960 by scottzhu<scottzhu@google.com>:
Unify RNN Cell interface between TF and Keras.
--
209655731 by A. Unique TensorFlower<gardener@tensorflow.org>:
Added tests for PredictionOps and PartitionExamplesOps
--
209655291 by nolivia<nolivia@google.com>:
adding rate class so that we can save global_step/sec using tf.contrib.summary. The function takes the rate in relation to any tensors provided that the numerator and denominator are broadcastable and have dtypes that can be cast to float64
--
209654655 by kramerb<kramerb@google.com>:
[XLA] Switch from tensorflow::gtl::InlinedVector to absl::InlinedVector
This one comes with extra goodies like a move constructor.
--
209653851 by A. Unique TensorFlower<gardener@tensorflow.org>:
Internal build specification change
--
PiperOrigin-RevId: 209663919
|
|
|
|
|
|
| |
Same for WrapUnique.
PiperOrigin-RevId: 209531124
|
|
|
|
| |
PiperOrigin-RevId: 209502513
|
|
|
|
| |
PiperOrigin-RevId: 209248552
|
|
|
|
| |
PiperOrigin-RevId: 209247783
|
|
|
|
| |
PiperOrigin-RevId: 206111380
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although there was no API comment explaining what PermuteDimensions()
intended to do with layouts, the intent seems to be that if the input
shape has a layout, then
TransposeIsBitcast(input_shape, PermuteDimensions(input_shape, perm),
InversePermutation(perm))
is true.
This was not previously correct. (I can't really say what the old
behavior was, although maybe there's some clever interpretation of what
it used to do.)
PiperOrigin-RevId: 203290794
|
|
|
|
|
|
|
|
|
| |
Currently Literal classes sits in literal_util.{h,cc} instead of literal.{h,cc}.
It also contains helper functions that are better fit to be their own separate
class/namespace. This change starts this process by moving most static factory
methods to LiteralUtil namespace.
PiperOrigin-RevId: 203217065
|
|
|
|
| |
PiperOrigin-RevId: 202179928
|
|
|
|
|
|
|
|
| |
This won't catch all overflows, but will do the right thing for the "normal" flow.
Also fix layout validation to reject padded sparse layouts.
PiperOrigin-RevId: 202151215
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 199361402
|
|
|
|
| |
PiperOrigin-RevId: 198754463
|
|
|
|
|
|
|
|
| |
backend-independent offline auto-tuner for backend configurations of ops as well as automatic testing across candidate configurations.
Also add a simple Scanner class that is handy for parsing things.
PiperOrigin-RevId: 197657512
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This optimizes ShapeTree quite significantly. In particular this optimizes for the common case of querying/iterating, copying and moving ShapeTrees.
* Allocate all ShapeTreeNodes inside a single, owned, vector. This reduces the number of memory allocations and improves cache performance.
* Instead of storing children nodes as unique_ptrs, store them as indices into the owning container's vector. This allows cheap copy-construction (a std::vector POD copy) and doesn't change the fast path (dereferencing a pointer is just as fast as dereferencing a base + offset).
* Instead of a unique_ptr<Shape>, use a shared_ptr<Shape>. This removes a load of copy-construction overhead at the cost of a shared_ptr over a unique_ptr (one extra allocation).
* Instead of computing ShapeIndexes on-demand in the iterators/ForEach*, precompute them during construction time. This adds a few more bytes per ShapeTree, but now we can...
* ... store a std::pair<ShapeIndex, T> as the ShapeTreeNode's data element. This allows us to provide a std::pair<K,V>&, STL-like interface from iterators without going through any of the previous unique_ptr hacks around storage lifetimes.
* Because we no longer need to iterate from the beginning to build up the ShapeIndex, we can now offer a ::find() function to return an iterator for a ShapeIndex in O(K) time. As the iteration order is guaranteed to be pre-order, this can be used (and will be, later) to speed up the fast-path of mutating a subtree of a ShapeTree from tf2xla::ExtractSubBuffers.
* Similarly because we now have a very standard, cheap STL interface with no performance cliffs, we can hopefully improve ShapedBuffer's copy and move constructors to be cheaper.
PiperOrigin-RevId: 197548717
|
|
|
|
|
|
| |
Introducing a new LiteralOwningSlice class that is similar to LiteraSlice, but owns the root piece.
PiperOrigin-RevId: 196759785
|
|
|
|
| |
PiperOrigin-RevId: 196742598
|
|
|
|
| |
PiperOrigin-RevId: 196605347
|
|
|
|
|
|
|
| |
These are type aliases of one another; we'd like to be consistent and
use the shorter one.
PiperOrigin-RevId: 196322955
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moves methods from LiteralTestUtil::* to Literal::* where they have nothing
to do with test infrastructure.
Pares down the "void" variants of the LiteralTestUtil methods and consolidates
to the version that return success/failure such that the values can be
EXPECT_TRUE / ASSERT_TRUE asserted in the caller test cases.
This way the literal comparison functionality can be used from cc_libraries
that are not test only / cc_binary.
PiperOrigin-RevId: 196209410
|
|
|
|
|
|
|
| |
declared by xla.proto.h, but that proto doesn't actually need this type
anywhere and we are working on removing such unneeded forward declarations.
PiperOrigin-RevId: 195818397
|
|
|
|
| |
PiperOrigin-RevId: 193998684
|
|
|
|
| |
PiperOrigin-RevId: 193301997
|
|
|
|
| |
PiperOrigin-RevId: 190878279
|
|
|
|
| |
PiperOrigin-RevId: 188554206
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The bulk of change is actually in dot_operation_test to get it to the point
where it would have caught this bug. I made the following changes:
- Moved some tests under a "no layout assignment pass runs" mode. This lets
us test the layout specific aspects of the dot operation more thoroughly.
Unfortunately not many tests can be run in this mode -- for instance dot
tests that calls into Eigen won't work here because they need a specific
layout assignment for correctness. Tests that runs with layout assignment
enabled but with non-default layouts are essentially integration tests that
check that the layout assignment pass + the dot lowering work correctly.
- Changed the matrix-vector dot tests to check all 4 layouts and the
matrix-vector Ax+b fusion tests to check all 8 layouts.
- Duplicated some of the F32 tests to run for F64.
- Added some new test shapes.
PiperOrigin-RevId: 186511289
|
|
|
|
| |
PiperOrigin-RevId: 183888495
|
|
|
|
| |
PiperOrigin-RevId: 183862522
|
|
|
|
| |
PiperOrigin-RevId: 183860192
|
|
|
|
| |
PiperOrigin-RevId: 183862522
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Break build options into their own translation unit for use from local client
and to mirror ExecutableRunOptions.
* Add some ToString()s to aid debugging.
* Add HLO graph generation regex to build options.
* Add SWIG type map for ExecutableBuildOptions.
Also fix a build issue occurring on some platforms with triangular_solve.
PiperOrigin-RevId: 183837856
|
|
|
|
|
|
|
|
| |
Instead of relying on some oeprations always taking longer than others (and this
appearing in a specific order in the rendered HLO profile), pick them out by
opcode.
PiperOrigin-RevId: 183268593
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add methods for manipulating sparse literals to xla::Literal
- Make LayoutUtil::HumanString handle sparse layouts
- Make ShapeUtil::ParseShape handle sparse shapes
- Syntax for shapes has changed:
- Old way of expressing layouts still works, e.g. f32[1,2,3]{2,1,0}
- Can now make dense format explicit: f32[1,2,3]dense{2,1,0}
- Can express sparse layouts; the max_sparse_elements value is in the
braces, e.g.: f32[1,2,3]sparse{10}
- The shape should not include braces for the layout if the shape is scalar;
e.g. f32[]{} is not valid shape syntax.
- The shape should not include braces for the layout if the shape is a dense
rank-1 array; e.g. f32[10]{0} is not valid shape syntax
- Sparse literals use a dictionary-liky syntax, e.g.:
f32[2,3,4]sparse{10} {[0,1,2]: 10, [1,2,3]: 11}
- For rank-1 sparse arrays, the square brackets around indices may be omitted, e.g.:
f32[100]sparse{10} {5: 10, 20: 30}
PiperOrigin-RevId: 181813837
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds SparseIndexArray and support methods to Literal. SparseIndexArray manages
the array of sparse indices and is exposed by sparse Literals.
Also adds HloSupportChecker classes for CPU and GPU. This will be run as the
first HloPass during compilation, and verifies that the graph is supported by
the backend. Currently only verifies shapes, and that the layout is not sparse
since no backend supports sparse layouts yet.
PiperOrigin-RevId: 181244401
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL primarily does two things:
(1) Remove the protobuf-compatibility methods (eg, mutable_f32s()) from Literal. These were added to Literal as part of the migration of Literal from a proto to a c++ class. Now that Literal is a proper class, these protobuf methods make it difficult to enforce invariants and expose too much of the class' implementation details.
(2) Make shape an immutable property of Literals, and make shape and the data members holding the Literal data coherent by construction. Previously, the shape could be set arbitrarily, and the data members such as f32_ could be arbitrarily sized irrespective of the shape of the literal.
The remainder of the CL mostly deals with the fallout. Notable other changes:
- Literal is no longer a recursive data structure. To avoid copies when passing a subliteral of a tuple-shaped Literal, a LiteralView class is added which provides a read-only view of an arbitrary subliteral.
- Tuple-shaped Literals can no longer be built up incrementally so to avoid copying Literal values during construction, the following methods with move semantics are added: Literal::MoveFrom and Literal::MoveIntoTuple. These methods transfer ownership the underlying buffers enabling, for example, a literal to be moved into an element of a tuple-shaped literal with no data copying.
- Replace the internal data structure holding the actual data from a bunch of std::vectors (eg, s32s_, f32s, etc) to a single ShapeTree<char*>. This significantly simplifies accessors and makes improved support of tuple-shaped literals much easier (eg, Literal::Get<>() can now access elements in arbitrary subliterals).
Also, Literal is made movable, but not copyable. Otherwise, it is all too easy to accidentally introduce expensive copies of Literals. Literal::Clone is added to handle the case where a copy is needed (Literal::CloneToUnique already exists).
PiperOrigin-RevId: 181014890
|
|
|
|
|
|
|
| |
Returning a closed-over Tensor does not trigger a call to convert_to_tensor,
so we need to manually coerce such Tensors to graph tensors and capture them.
PiperOrigin-RevId: 179224063
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
179221620 by akshayka:
Internal cleanup: Delete extraneous print statement in test case.
--
179220917 by A. Unique TensorFlower:
[XLA:JF] Make HLO parser recognize negative padding.
--
PiperOrigin-RevId: 179221620
|
|
|
|
|
|
| |
computations.
PiperOrigin-RevId: 179211353
|
|
|
|
| |
PiperOrigin-RevId: 177526301
|
|
|
|
|
|
| |
This is necessary in providing bfloat support in GPU backend.
RELNOTES: bfloat support is now added to XLA infra.
PiperOrigin-RevId: 175564791
|
|
|
|
| |
PiperOrigin-RevId: 175401676
|
|
|
|
| |
PiperOrigin-RevId: 175277161
|