Commit Graph

14 Commits

Author SHA1 Message Date
A. Unique TensorFlower
fd87e24980 Adding total-order comparison support in proto and HloInstruction.
Specifically a comparison type attribute is added to Hlo proto so that total
order comparison can be explicitly specified. A comparison expander pass is
added to all compilers to expand total order comparison into equivalent
implementations through type conversion.

PiperOrigin-RevId: 325820826
Change-Id: I7beceb2f751ddc0be7c6b7a74037e562e7580b62
2020-08-10 09:40:29 -07:00
Justin Lebar
06212424cd [XLA] Rename OPAQUE to OPAQUE_TYPE.
The identifier `OPAQUE` is used as a macro in windows.h.

This should (at least partially) fix .

Textual HLO remains unchanged (i.e. it still uses "opaque").  The parser now
accepts either "opaque_type" or "opaque".

PiperOrigin-RevId: 245055351
2019-04-24 09:41:01 -07:00
David Majnemer
e40ffed186 [TF2XLA] Add support for nextafter
This implementation matches the C++ function's behavior:
- nextafter(-0, +0) -> +0
- nextafter(+0, -0) -> -0
- nextafter(-0, -0) -> -0
- nextafter(+0, +0) -> +0

Regardless of the current FTZ or DAZ mode, this implementation will return a
subnormal if "from" is 0 but "to" is non-zero.

PiperOrigin-RevId: 230806902
2019-01-24 16:04:38 -08:00
A. Unique TensorFlower
6d51473954 Support previously added 'truncate' attribute on floating datatype casts to apply in tf2xla as well.
PiperOrigin-RevId: 229593179
2019-01-16 11:48:07 -08:00
Peter Hawkins
937ff1b4cf [XLA] Add complex128 support.
Minimally tested at the moment (tested via the TF tests).

PiperOrigin-RevId: 228931680
2019-01-11 13:11:43 -08:00
Mark Heffernan
b55e7a9a82 Change Shape parsing from regexp matcher to parser.
Previously in the HLO parser/lexer shapes were tokens which were identified using a complicated regular expression. This made augmenting the textual form of shape difficult such as would be necessary for dynamic shapes or tiling. To avoid ambiguity and other problems a couple changes were made to HLO textual form, as well as some related clean up:

(1) Do not redundantly print the shape inside of the constant HLO instruction's "operand" field. Previously, constant instructions we printed like:

    S32[2,2] constant(S32[2,2] {{1,2},{3,4}})

  Now this is printed as:

    S32[2,2] constant({{1,2},{3,4}})

  This avoids an ambiguity where the values of the literal can be misinterpreted as a layout. Also, the shape was printed inconsistently: only when the rank was greater than one.

(2) Remove ShapeUtil::ParseShapeString, replace with ParseShape function in hlo parser.

(3) Merge hlo_token.h into hlo_lexer.h. It is only used by the lexer and parser which include that file and avoids potential confusion with the token HLO type

(4) Fix b/112302613 by removing the unused Shape field in the sharding attribute of HLO text.

(5) As part of this change primitive element types are now keywords which simplifies parsing. The fallout is that a bunch of values in HLO text named "token" had to be renamed. Also, change the HLO name sanitizer to avoid these primitive type keywords.

PiperOrigin-RevId: 225546437
2018-12-14 08:37:21 -08:00
Mark Heffernan
e1296c15a3 Fix assumptions that a Shape must be a tuple or an array.
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
2018-06-13 14:24:30 -07:00
Justin Lebar
b5a1ac0dba [XLA] Inline definitions of NativeToPrimitiveType<T>.
These functions are hot in the evaluator, and that's silly, because
they're pure constants.  Just inline them.

PiperOrigin-RevId: 182889992
2018-01-22 23:34:04 -08:00
Yunxing Dai
bc4d2043b6 Add bfloat support to XLA.
This is necessary in providing bfloat support in GPU backend.
RELNOTES: bfloat support is now added to XLA infra.
PiperOrigin-RevId: 175564791
2017-11-13 12:00:51 -08:00
Peter Hawkins
1a70297c95 Automated g4 rollback of changelist 175252067
PiperOrigin-RevId: 175401676
2017-11-11 07:50:10 -08:00
Yunxing Dai
64d9aa1ace Add bfloat support to XLA.
This is necessary in providing bfloat support in GPU backend.
RELNOTES: bfloat support is now added to XLA infra.
PiperOrigin-RevId: 175252067
2017-11-10 16:14:41 -08:00
A. Unique TensorFlower
f226eb3717 [XLA] Adds a C64 type to XLA, with actual compilation support coming soon.
PiperOrigin-RevId: 173172916
2017-10-23 14:54:43 -07:00
A. Unique TensorFlower
53cb26d05a Merge changes from github.
END_PUBLIC

---
Commit c2b8927f2 authored by Dandelion Man?<dandelion@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Fix another d3v4 regression in the graph visualizer.

PiperOrigin-RevId: 156343038

---
Commit 170f0b350 authored by Peter Hawkins<phawkins@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
[TF:XLA] Add XLA implementation of ResourceStridedSliceAssign.

PiperOrigin-RevId: 156341053

---
Commit 1390dd68f authored by Vijay Vasudevan<vrv@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
When Op Type is not registered, log the hostname of the machine that
it is running on in the error message, since the message could be routed
back during a failure on a remote binary, and it is hard to tell which
machine it came from.

Ideally, we'd somehow log the name of the binary running instead, but
we don't have a function to get that right now.

PiperOrigin-RevId: 156337679

---
Commit 9ca8a151b authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Internal change.

PiperOrigin-RevId: 156335942

---
Commit 40255434c authored by Martin Wicke<wicke@google.com>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
Deprecate contrib/learn/dataframe. To be removed June 15.

PiperOrigin-RevId: 156333930

---
Commit 7f71b7fbe authored by A. Unique TensorFlower<gardener@tensorflow.org>
Committed by TensorFlower Gardener<gardener@tensorflow.org>:
BEGIN_PUBLIC
Automated g4 rollback of changelist 156123287

PiperOrigin-RevId: 156503903
2017-05-18 18:06:21 -07:00
Peter Hawkins
1e67c90e2c Initial open-source release of XLA: Accelerated Linear Algebra.
XLA is a compiler-based linear algebra execution engine that targets CPUs, GPUs and custom accelerators.

XLA is still experimental; we are releasing it early to get the community involved.
Change: 143990941
2017-01-09 12:26:35 -08:00