aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_opcode.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-06-16 17:15:50 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-16 17:19:28 -0700
commit9d2a432ce74eab4c439fe8c60389e4da9d6c92b2 (patch)
treed094564097a0e399ea5c32ae30d7863128c018e7 /tensorflow/compiler/xla/service/hlo_opcode.cc
parent8e7c2c180c4b75768c707d66c9080ee06ee72773 (diff)
Add plumbing for a ReducePrecision operation.
This CL is the first part of a series that adds a ReducePrecision operation for experimenting with the effects of reduced-precision storage of intermediate values. ReducePrecision is a Unary operation parameterized on floating-point exponent and mantissa bit sizes, and rounds the input data as if it were converted to a floating-point value with the given bit sizes and then converted back to "normal" F32 data. Using arbitrary parameterized values to describe the lower-precision value type, rather than hardcoding this as a reduction to IEEE f16, allows us to do more flexible experiments -- e.g., "Is this training error due to the reduced mantissa precision, or due to the reduced exponent range?" or "Is this a smooth degradation with reduced precision or is there a sudden drop at some value?" -- which may suggest software mitigations for the effects. This version of the CL adds the kReducePrecision instruction opcode, and the overall plumbing to support the operation. To allow testing, it includes an exceptionally simple implementation of the actual operation that returns "unimplemented" except for the exponent and mantissa bit sizes where it is a complete no-op. PiperOrigin-RevId: 159295615
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_opcode.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_opcode.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_opcode.cc b/tensorflow/compiler/xla/service/hlo_opcode.cc
index 342c43dc5a..4d68d0d088 100644
--- a/tensorflow/compiler/xla/service/hlo_opcode.cc
+++ b/tensorflow/compiler/xla/service/hlo_opcode.cc
@@ -116,6 +116,8 @@ string HloOpcodeString(HloOpcode opcode) {
return "recv";
case HloOpcode::kReduce:
return "reduce";
+ case HloOpcode::kReducePrecision:
+ return "reduce-precision";
case HloOpcode::kReduceWindow:
return "reduce-window";
case HloOpcode::kRemainder: