[XLA] Consistently apply gpu-max-kernel-unroll-factor = 1 in HloTestBase.
authorJustin Lebar <jlebar@google.com>
Sat, 19 May 2018 07:37:18 +0000 (00:37 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Sat, 19 May 2018 07:40:09 +0000 (00:40 -0700)
Previously we set it in CreateNewModule but not in
GetDebugOptionsFromFlags(), which seems wrong.

PiperOrigin-RevId: 197247863

tensorflow/compiler/xla/tests/hlo_test_base.cc

index 1259857..d964875 100644 (file)
@@ -95,10 +95,7 @@ HloTestBase::HloTestBase(se::Platform* test_platform,
 /* static */
 std::unique_ptr<HloModule> HloTestBase::CreateNewModule(const string& name) {
   HloModuleConfig config;
-  auto debug_options = HloTestBase::GetDebugOptionsForTest();
-  debug_options.set_xla_gpu_max_kernel_unroll_factor(1);
-  config.set_debug_options(debug_options);
-
+  config.set_debug_options(GetDebugOptionsForTest());
   return MakeUnique<HloModule>(name, VersionedComputationHandle(), config);
 }
 
@@ -106,6 +103,7 @@ std::unique_ptr<HloModule> HloTestBase::CreateNewModule(const string& name) {
   auto debug_options = legacy_flags::GetDebugOptionsFromFlags();
   // TODO(b/38354253): Change tests to use Parameters instead of Constants.
   debug_options.add_xla_disable_hlo_passes("constant_folding");
+  debug_options.set_xla_gpu_max_kernel_unroll_factor(1);
   return debug_options;
 }