aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_module_config.h
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2017-01-31 16:50:12 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-01-31 17:08:40 -0800
commitd45505fe0c7ab9a10f16682f54d0eb54c4776cd1 (patch)
tree729a6b4850b70818025a304eb2cacd71f26e36b6 /tensorflow/compiler/xla/service/hlo_module_config.h
parent4062c3a74fa5069b44cb67a9f2005cfa90e54ca1 (diff)
[XLA] Move fast-math flags into HLO module config.
Previously, XLA controlled the presence/absence of fast-math flags (FMF) via a command-line flag. This patch changes things so we use a new CompileOptions proto instead. This proto lives in HloModuleConfig, and is passed to the service via ExecuteRequest. This change lets us entirely remove llvm_backend_flags.{h,cc}. In addition, this change takes us from two to one fast-math flags. Previously we tried to control "unsafe FP transformations" separately from "full fast math". It turns out that LLVM is misleadingly inconsistent in how it handles these. In the backend, they are indeed two separate options that can be enabled/disabled independently. In the frontend, however, unsafe-fp-math implies all the other FMFs. As a result, it doesn't really make sense for XLA to attempt to split out these two flags, at least not until LLVM changes how it handles them. Change: 146183994
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_module_config.h')
-rw-r--r--tensorflow/compiler/xla/service/hlo_module_config.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_module_config.h b/tensorflow/compiler/xla/service/hlo_module_config.h
index f081790869..56a13d03eb 100644
--- a/tensorflow/compiler/xla/service/hlo_module_config.h
+++ b/tensorflow/compiler/xla/service/hlo_module_config.h
@@ -20,6 +20,7 @@ limitations under the License.
#include "tensorflow/compiler/xla/service/computation_layout.h"
#include "tensorflow/compiler/xla/types.h"
+#include "tensorflow/compiler/xla/xla.pb.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
namespace xla {
@@ -59,6 +60,14 @@ class HloModuleConfig {
}
int64 replica_count() const { return replica_count_; }
+ // Sets/returns settings that affect compilation of the module.
+ const CompilationOptions& compilation_options() const {
+ return compilation_options_;
+ }
+ void set_compilation_options(CompilationOptions options) {
+ compilation_options_.Swap(&options);
+ }
+
// Return a string which unambiguously represents all the fields of this data
// structure. Used for generating a cache key for storing the compiled
// executable.
@@ -85,6 +94,8 @@ class HloModuleConfig {
// The number of replicas to compile this binary for.
int64 replica_count_ = 1;
+
+ CompilationOptions compilation_options_;
};
} // namespace xla