From 9f6937e0d1d60ff60238c8c949438fc8209d2da7 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 6 Feb 2019 07:07:57 -0800 Subject: [PATCH] [TF:XLA] Attach useful information to disabled XLA tests. PiperOrigin-RevId: 232669090 --- tensorflow/python/framework/function_test.py | 1 - tensorflow/python/framework/test_util.py | 2 +- tensorflow/python/kernel_tests/benchmark_test.py | 2 +- tensorflow/python/kernel_tests/check_ops_test.py | 8 ++++---- tensorflow/python/kernel_tests/cholesky_op_test.py | 4 +++- tensorflow/python/kernel_tests/concat_op_test.py | 5 +---- .../python/kernel_tests/control_flow_ops_py_test.py | 2 -- tensorflow/python/kernel_tests/depthtospace_op_test.py | 2 +- tensorflow/python/kernel_tests/diag_op_test.py | 4 ++-- tensorflow/python/kernel_tests/functional_ops_test.py | 5 +---- tensorflow/python/kernel_tests/gather_nd_op_test.py | 4 +--- tensorflow/python/kernel_tests/map_fn_test.py | 1 - tensorflow/python/kernel_tests/pool_test.py | 1 - tensorflow/python/kernel_tests/pooling_ops_test.py | 4 ++-- tensorflow/python/kernel_tests/reduction_ops_test_big.py | 3 ++- tensorflow/python/kernel_tests/relu_op_test.py | 2 +- tensorflow/python/kernel_tests/scan_ops_test.py | 3 +-- tensorflow/python/kernel_tests/scatter_nd_ops_test.py | 2 +- tensorflow/python/kernel_tests/spacetodepth_op_test.py | 2 +- tensorflow/python/kernel_tests/split_op_test.py | 2 +- 20 files changed, 24 insertions(+), 35 deletions(-) diff --git a/tensorflow/python/framework/function_test.py b/tensorflow/python/framework/function_test.py index f541a4fb4af..7df76efde59 100644 --- a/tensorflow/python/framework/function_test.py +++ b/tensorflow/python/framework/function_test.py @@ -284,7 +284,6 @@ class FunctionTest(test.TestCase): out, = sess.run(dlogits, {logits: x, labels: y}) self.assertAllClose(out, np.exp(prob - y)) - @test_util.disable_xla("This test never passed for XLA") def testCustomGradientError(self): dtype = dtypes.float32 diff --git a/tensorflow/python/framework/test_util.py b/tensorflow/python/framework/test_util.py index d27572f0566..1d267830ff9 100644 --- a/tensorflow/python/framework/test_util.py +++ b/tensorflow/python/framework/test_util.py @@ -1460,7 +1460,7 @@ def disable_all_xla(description): value = getattr(cls, name) if callable(value) and name.startswith( "test") and not name == "test_session": - setattr(cls, name, base_decorator(value)) + setattr(cls, name, base_decorator(description)(value)) return cls return disable_all_impl diff --git a/tensorflow/python/kernel_tests/benchmark_test.py b/tensorflow/python/kernel_tests/benchmark_test.py index a91f96cf952..3fa2054847d 100644 --- a/tensorflow/python/kernel_tests/benchmark_test.py +++ b/tensorflow/python/kernel_tests/benchmark_test.py @@ -126,7 +126,7 @@ class BenchmarkTest(test.TestCase): self.assertFalse(_ran_somebenchmark_2[0]) self.assertFalse(_ran_somebenchmark_but_shouldnt[0]) - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123744455") # GPU memory is incorrect def testReportingBenchmark(self): tempdir = test.get_temp_dir() try: diff --git a/tensorflow/python/kernel_tests/check_ops_test.py b/tensorflow/python/kernel_tests/check_ops_test.py index d5f3696a9dc..7d00919cc8a 100644 --- a/tensorflow/python/kernel_tests/check_ops_test.py +++ b/tensorflow/python/kernel_tests/check_ops_test.py @@ -889,8 +889,8 @@ class EnsureShapeTest(test.TestCase): # Dynamic shape check @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA" - ) # Dynamic shapes not supported now with XLA + @test_util.disable_xla( + "b/123337890") # Dynamic shapes not supported now with XLA def testEnsuresDynamicShape_RaisesError(self): placeholder = array_ops.placeholder(dtypes.int32) derived = math_ops.divide(placeholder, 3, name="MyDivide") @@ -904,8 +904,8 @@ class EnsureShapeTest(test.TestCase): sess.run(derived, feed_dict={placeholder: feed_val}) @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA" - ) # Dynamic shapes not supported now with XLA + @test_util.disable_xla( + "b/123337890") # Dynamic shapes not supported now with XLA def testEnsuresDynamicShape_RaisesErrorDimUnknown(self): placeholder = array_ops.placeholder(dtypes.int32) derived = placeholder / 3 diff --git a/tensorflow/python/kernel_tests/cholesky_op_test.py b/tensorflow/python/kernel_tests/cholesky_op_test.py index abb71a672c1..2305c0b568e 100644 --- a/tensorflow/python/kernel_tests/cholesky_op_test.py +++ b/tensorflow/python/kernel_tests/cholesky_op_test.py @@ -163,7 +163,9 @@ class CholeskyOpTest(test.TestCase): with self.assertRaises(ValueError): linalg_ops.cholesky(tensor3) - @test_util.disable_xla("This test never passed for XLA") # all nan on XLA + # The below invalid Cholesky call returns an error with TF Classic and just + # returns NaNs with XLA. + @test_util.disable_xla("b/123337890") def testNotInvertibleCPU(self): # The input should be invertible. with self.session(use_gpu=True): diff --git a/tensorflow/python/kernel_tests/concat_op_test.py b/tensorflow/python/kernel_tests/concat_op_test.py index a968b061270..7e377853443 100644 --- a/tensorflow/python/kernel_tests/concat_op_test.py +++ b/tensorflow/python/kernel_tests/concat_op_test.py @@ -33,7 +33,6 @@ from tensorflow.python.ops import variables from tensorflow.python.platform import test -@test_util.disable_all_xla("This test never passed for XLA") class ConcatOpTest(test.TestCase): @test_util.run_deprecated_v1 @@ -642,7 +641,6 @@ class ConcatOpTest(test.TestCase): self.assertAllEqual([[1, 2, 3, 7, 8, 9], [4, 5, 6, 10, 11, 12]], output) -@test_util.disable_all_xla("This test never passed for XLA") class ConcatOffsetTest(test.TestCase): def testBasic(self): @@ -686,8 +684,7 @@ class ConcatOffsetTest(test.TestCase): self.evaluate(off) @test_util.run_deprecated_v1 - @test_util.disable_xla( - "This test never passed for XLA") # Different error message on XLA + @test_util.disable_xla("b/123337890") # Error messages differ def testSizeMismatch(self): cdim = constant_op.constant(1, dtypes.int32) s0 = constant_op.constant([2, 3, 5], dtypes.int32) diff --git a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py index 81a530a2634..a073bb3f22c 100644 --- a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py +++ b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py @@ -2769,8 +2769,6 @@ class ControlFlowTest(test.TestCase): self.assertEqual(i_val, 3) self.assertAllClose(x_val, 1.0) - @test_util.disable_xla("This test never passed for XLA" - ) # Resource variable issue for ControlFlowV2 @test_util.run_gpu_only def testGpuResourceAccess(self): with ops.device(test.gpu_device_name()): diff --git a/tensorflow/python/kernel_tests/depthtospace_op_test.py b/tensorflow/python/kernel_tests/depthtospace_op_test.py index 97d3645b617..b7a865cf13e 100644 --- a/tensorflow/python/kernel_tests/depthtospace_op_test.py +++ b/tensorflow/python/kernel_tests/depthtospace_op_test.py @@ -295,7 +295,7 @@ class DepthToSpaceTest(test.TestCase): actual_vals, expected_vals = self.evaluate([actual, expected]) self.assertTrue(np.array_equal(actual_vals, expected_vals)) - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123553551") # Unsupported data format def testAgainstTranspose(self): self.compareToTranspose(3, 2, 3, 1, 2, "NHWC", False) self.compareToTranspose(3, 2, 3, 2, 2, "NHWC", False) diff --git a/tensorflow/python/kernel_tests/diag_op_test.py b/tensorflow/python/kernel_tests/diag_op_test.py index b8139918c59..0bf48fd228f 100644 --- a/tensorflow/python/kernel_tests/diag_op_test.py +++ b/tensorflow/python/kernel_tests/diag_op_test.py @@ -65,7 +65,7 @@ class MatrixDiagTest(test.TestCase): array_ops.matrix_diag(0) @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123337890") # Error messages differ def testInvalidShapeAtEval(self): with self.session(use_gpu=True): v = array_ops.placeholder(dtype=dtypes_lib.float32) @@ -270,7 +270,7 @@ class MatrixDiagPartTest(test.TestCase): array_ops.matrix_diag_part(0) @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123337890") # Error messages differ def testInvalidShapeAtEval(self): with self.session(use_gpu=True): v = array_ops.placeholder(dtype=dtypes_lib.float32) diff --git a/tensorflow/python/kernel_tests/functional_ops_test.py b/tensorflow/python/kernel_tests/functional_ops_test.py index 13f9acbe1bf..48e14d0f500 100644 --- a/tensorflow/python/kernel_tests/functional_ops_test.py +++ b/tensorflow/python/kernel_tests/functional_ops_test.py @@ -56,7 +56,6 @@ def simple_scoped_fn(a, x): @test_util.with_control_flow_v2 -@test_util.disable_all_xla("This test never passed for XLA") class FunctionalOpsTest(test.TestCase): @test_util.run_in_graph_and_eager_modes @@ -660,8 +659,7 @@ class FunctionalOpsTest(test.TestCase): self.assertAllEqual(Run(100., True), 5050.) @test_util.run_v1_only("b/120545219") - @test_util.disable_xla( - "This test never passed for XLA") # Different error message + @test_util.disable_xla("b/123337890") # Different error message def testWhileError(self): for use_gpu in (True, False): with ops.Graph().as_default() as g: @@ -938,7 +936,6 @@ class FunctionalOpsTest(test.TestCase): # TODO(akshayka): Replace `function.Defun` with tf.contrib.eager.defun` in the # below test cases. -@test_util.disable_all_xla("This test never passed for XLA") class PartitionedCallTest(test.TestCase): @test_util.run_deprecated_v1 diff --git a/tensorflow/python/kernel_tests/gather_nd_op_test.py b/tensorflow/python/kernel_tests/gather_nd_op_test.py index 76ae2fcb72f..ad8376b48c8 100644 --- a/tensorflow/python/kernel_tests/gather_nd_op_test.py +++ b/tensorflow/python/kernel_tests/gather_nd_op_test.py @@ -34,7 +34,6 @@ from tensorflow.python.ops import variables from tensorflow.python.platform import test -@test_util.disable_all_xla("This test never passed for XLA") class GatherNdTest(test.TestCase): def _testSimpleDtype(self, dtype): @@ -57,7 +56,7 @@ class GatherNdTest(test.TestCase): self._testSimpleDtype("|S") # byte strings in python2 + 3 @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123337890") # Error messages differ def testEmptyIndicesAndParamsOKButJustEmptyParamsFails(self): with self.session(use_gpu=True): params = np.ones((3, 3), dtype=np.float32) @@ -360,7 +359,6 @@ class GatherNdTest(test.TestCase): self.assertAllEqual(expected_grads, ops.convert_to_tensor(grads).eval()) -@test_util.disable_all_xla("This test never passed for XLA") class GatherNdOpBenchmark(test.Benchmark): def benchmark_gather_nd_op(self): diff --git a/tensorflow/python/kernel_tests/map_fn_test.py b/tensorflow/python/kernel_tests/map_fn_test.py index a31db416a2e..41d99ea3790 100644 --- a/tensorflow/python/kernel_tests/map_fn_test.py +++ b/tensorflow/python/kernel_tests/map_fn_test.py @@ -49,7 +49,6 @@ def simple_scoped_fn(a, x): @test_util.with_control_flow_v2 -@test_util.disable_all_xla("This test never passed for XLA") class MapFnTest(test.TestCase): @test_util.run_in_graph_and_eager_modes diff --git a/tensorflow/python/kernel_tests/pool_test.py b/tensorflow/python/kernel_tests/pool_test.py index 367c94dd1e6..78e786f01ca 100644 --- a/tensorflow/python/kernel_tests/pool_test.py +++ b/tensorflow/python/kernel_tests/pool_test.py @@ -303,7 +303,6 @@ class PoolingTest(test.TestCase): self.assertLess(err, err_tolerance) @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA") # Much larger error def testGradient1D(self): with self.session(use_gpu=test.is_gpu_available()): for padding in ["SAME", "VALID"]: diff --git a/tensorflow/python/kernel_tests/pooling_ops_test.py b/tensorflow/python/kernel_tests/pooling_ops_test.py index 546b406c20f..0cd6495d812 100644 --- a/tensorflow/python/kernel_tests/pooling_ops_test.py +++ b/tensorflow/python/kernel_tests/pooling_ops_test.py @@ -730,7 +730,7 @@ class PoolingTest(test.TestCase): t = nn_ops.max_pool( t, ksize=ksize, strides=strides, padding="SAME").eval() - @test_util.disable_xla("b/123338077") + @test_util.disable_xla("b/123338077") # Passes with XLA def testDepthwiseMaxPoolInvalidConfigs(self): self._testDepthwiseMaxPoolInvalidConfig( [1, 2, 2, 4], [1, 2, 2, 2], [1, 1, 1, 2], @@ -1821,7 +1821,7 @@ class PoolingTest(test.TestCase): padding="SAME") @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123337890") # Error messages differ def testOpEdgeCases(self): with self.session(use_gpu=test.is_gpu_available()) as sess: pool_funcs = [nn_ops.max_pool, nn_ops.avg_pool] diff --git a/tensorflow/python/kernel_tests/reduction_ops_test_big.py b/tensorflow/python/kernel_tests/reduction_ops_test_big.py index 1e8524f72a9..73bba54a464 100644 --- a/tensorflow/python/kernel_tests/reduction_ops_test_big.py +++ b/tensorflow/python/kernel_tests/reduction_ops_test_big.py @@ -21,16 +21,17 @@ from __future__ import print_function import numpy as np from tensorflow.python.framework import ops +from tensorflow.python.framework import test_util from tensorflow.python.ops import math_ops from tensorflow.python.platform import test - class BaseReductionTest(test.TestCase): def _tf_reduce(self, x, reduction_axes, keepdims): raise NotImplementedError() +@test_util.disable_all_xla("b/123864762") # Test times out class BigReductionTest(BaseReductionTest): """Test reductions for sum and boolean all over a wide range of shapes.""" diff --git a/tensorflow/python/kernel_tests/relu_op_test.py b/tensorflow/python/kernel_tests/relu_op_test.py index 3b8924904c5..ca02aa6e4e6 100644 --- a/tensorflow/python/kernel_tests/relu_op_test.py +++ b/tensorflow/python/kernel_tests/relu_op_test.py @@ -86,7 +86,7 @@ class ReluTest(test.TestCase): self.assertAllClose(np_relu, tf_relu) self.assertShapeEqual(np_relu, tf_relu) - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123338077") # Passes with XLA def testReluInt8x4BadShape(self): if not test.is_gpu_available(cuda_only=True): self.skipTest("No GPU available") diff --git a/tensorflow/python/kernel_tests/scan_ops_test.py b/tensorflow/python/kernel_tests/scan_ops_test.py index 4e15894fb4a..2a3021f9821 100644 --- a/tensorflow/python/kernel_tests/scan_ops_test.py +++ b/tensorflow/python/kernel_tests/scan_ops_test.py @@ -70,7 +70,6 @@ def handle_options(func, x, axis, exclusive, reverse): return x -@test_util.disable_all_xla("This test never passed for XLA") class CumsumTest(test.TestCase): valid_dtypes = [ @@ -135,6 +134,7 @@ class CumsumTest(test.TestCase): self._compareAll(x, axis) @test_util.run_deprecated_v1 + @test_util.disable_xla("b/123860949") # The computation is constant folded def testLarge(self): for dtype in self.valid_dtypes: x = np.ones([1000000], dtype=dtype) / 1024 @@ -194,7 +194,6 @@ class CumsumTest(test.TestCase): self._compareGradient([5, 10], axis, exclusive, reverse) -@test_util.disable_all_xla("This test never passed for XLA") class CumprodTest(test.TestCase): valid_dtypes = [ diff --git a/tensorflow/python/kernel_tests/scatter_nd_ops_test.py b/tensorflow/python/kernel_tests/scatter_nd_ops_test.py index 88f7b27b77e..5bc301b6136 100644 --- a/tensorflow/python/kernel_tests/scatter_nd_ops_test.py +++ b/tensorflow/python/kernel_tests/scatter_nd_ops_test.py @@ -296,7 +296,7 @@ class StatefulScatterNdTest(test.TestCase): updates).get_shape().as_list(), shape) @test_util.run_v1_only("b/120545219") - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123337890") # Error messages differ def testResVarInvalidOutputShape(self): res = variables.Variable( initial_value=lambda: array_ops.zeros(shape=[], dtype=dtypes.float32), diff --git a/tensorflow/python/kernel_tests/spacetodepth_op_test.py b/tensorflow/python/kernel_tests/spacetodepth_op_test.py index 7f3c381fa16..69243afb69c 100644 --- a/tensorflow/python/kernel_tests/spacetodepth_op_test.py +++ b/tensorflow/python/kernel_tests/spacetodepth_op_test.py @@ -285,7 +285,7 @@ class SpaceToDepthTest(test.TestCase): actual_vals, expected_vals = self.evaluate([actual, expected]) self.assertTrue(np.array_equal(actual_vals, expected_vals)) - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123553551") # Unsupported data format def testAgainstTranspose(self): self.compareToTranspose(3, 2, 3, 1, 2, "NHWC", False) self.compareToTranspose(1, 2, 3, 2, 2, "NHWC", False) diff --git a/tensorflow/python/kernel_tests/split_op_test.py b/tensorflow/python/kernel_tests/split_op_test.py index 80004db833c..42b4d1b7782 100644 --- a/tensorflow/python/kernel_tests/split_op_test.py +++ b/tensorflow/python/kernel_tests/split_op_test.py @@ -373,7 +373,7 @@ class SplitOpTest(test.TestCase): assert s1.shape.as_list() == [1] @test_util.run_deprecated_v1 - @test_util.disable_xla("This test never passed for XLA") + @test_util.disable_xla("b/123337890") # Error messages differ def testNonexistentDimTensor(self): x = array_ops.placeholder(dtypes.int32) values = np.zeros([5, 30])