[ROCm] Unit-test updates for the ROCm platform.
This commit mostly either enables or disables unittests on the ROCM platform, details listed below * adding/removing no_rocm tag for tests in the //tensorflow/compiler/mlir dir * enabling / disabling subtests within //tensorflow/core/grappler/optimizers:constant_folding_test for the ROCm platform * disabling a subtest within //tensorflow/core/distributed_runtime:collective_param_resolver_distributed_test fir the ROCm platform * adding no_rocm tag to tests that are failing on the ROCm platform * minor bug fix to ensure that the //tensorflow/compiler/mlir/tensorflow:error_util_test passes on a consistent basis
This commit is contained in:
parent
6072451f8b
commit
32b7183acd
@ -12,7 +12,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
|
||||
_default_test_file_exts = ["mlir", ".pbtxt", ".td"]
|
||||
_default_driver = "@llvm-project//mlir:run_lit.sh"
|
||||
_default_size = "small"
|
||||
_default_tags = ["no_rocm"]
|
||||
_default_tags = []
|
||||
|
||||
# These are patterns which we should never match, for tests, subdirectories, or
|
||||
# test input data files.
|
||||
|
@ -5,6 +5,11 @@ package(licenses = ["notice"])
|
||||
glob_lit_tests(
|
||||
data = [":test_utilities"],
|
||||
driver = "@llvm-project//mlir:run_lit.sh",
|
||||
tags_override = {
|
||||
"legalize-tf.mlir": ["no_rocm"],
|
||||
"optimize.mlir": ["no_rocm"],
|
||||
"prepare-tf.mlir": ["no_rocm"],
|
||||
},
|
||||
test_file_exts = ["mlir"],
|
||||
)
|
||||
|
||||
|
@ -8,6 +8,12 @@ glob_lit_tests(
|
||||
":test_utilities",
|
||||
],
|
||||
driver = "@llvm-project//mlir:run_lit.sh",
|
||||
tags_override = {
|
||||
"add.pbtxt": ["no_rocm"],
|
||||
"conv_2d.pbtxt": ["no_rocm"],
|
||||
"fake_quant_per_channel.pbtxt": ["no_rocm"],
|
||||
"ophint_lstm.pbtxt": ["no_rocm"],
|
||||
},
|
||||
test_file_exts = [
|
||||
"pbtxt",
|
||||
],
|
||||
|
@ -934,7 +934,6 @@ cc_library(
|
||||
tf_cc_test(
|
||||
name = "error_util_test",
|
||||
srcs = ["utils/error_util_test.cc"],
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":error_util",
|
||||
"//tensorflow/compiler/xla:test",
|
||||
|
@ -5,6 +5,10 @@ package(licenses = ["notice"])
|
||||
glob_lit_tests(
|
||||
data = [":test_utilities"],
|
||||
driver = "@llvm-project//mlir:run_lit.sh",
|
||||
tags_override = {
|
||||
"optimize.mlir": ["no_rocm"],
|
||||
"tf_optimize.mlir": ["no_rocm"],
|
||||
},
|
||||
test_file_exts = ["mlir"],
|
||||
)
|
||||
|
||||
|
@ -315,7 +315,7 @@ TEST_F(DeviceResDistTest, Workers2Devices2) {
|
||||
ValidateCollectiveParams(num_workers, num_devices);
|
||||
}
|
||||
|
||||
#ifndef GOOGLE_CUDA
|
||||
#if !GOOGLE_CUDA && !TENSORFLOW_USE_ROCM
|
||||
namespace {
|
||||
// A mock NcclReducer for testing group runtime details initialization with CPU
|
||||
// builds. The only meaningful function in this class is
|
||||
|
@ -551,9 +551,9 @@ TEST_F(ConstantFoldingTest, ConstantPushDownBiasAdd) {
|
||||
TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_ScalarConst) {
|
||||
for (string data_format : {
|
||||
"NHWC",
|
||||
#if GOOGLE_CUDA
|
||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
"NCHW"
|
||||
#endif // GOOGLE_CUDA
|
||||
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
}) {
|
||||
MulConvPushDownTest(
|
||||
/*input_shape=*/data_format == "NHWC" ? TensorShape{4, 10, 10, 3}
|
||||
@ -569,9 +569,9 @@ TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_ScalarConst) {
|
||||
TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_SingletonConst) {
|
||||
for (string data_format : {
|
||||
"NHWC",
|
||||
#if GOOGLE_CUDA
|
||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
"NCHW"
|
||||
#endif // GOOGLE_CUDA
|
||||
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
}) {
|
||||
for (auto mul_const_input_shape :
|
||||
{TensorShape{1}, TensorShape{1, 1, 1, 1}}) {
|
||||
@ -590,9 +590,9 @@ TEST_F(ConstantFoldingTest,
|
||||
MulConvPushDownTest_Conv2D_SingletonConst_ShapeMismatch) {
|
||||
for (string data_format : {
|
||||
"NHWC",
|
||||
#if GOOGLE_CUDA
|
||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
"NCHW"
|
||||
#endif // GOOGLE_CUDA
|
||||
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
}) {
|
||||
MulConvPushDownTest(
|
||||
/*input_shape=*/data_format == "NHWC" ? TensorShape{4, 10, 10, 3}
|
||||
@ -608,9 +608,9 @@ TEST_F(ConstantFoldingTest,
|
||||
TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_3x1x3Const) {
|
||||
for (auto data_format : {
|
||||
"NHWC",
|
||||
#if GOOGLE_CUDA
|
||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
"NCHW"
|
||||
#endif // GOOGLE_CUDA
|
||||
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
}) {
|
||||
MulConvPushDownTest(
|
||||
/*input_shape=*/{3, 3, 3, 3},
|
||||
@ -635,7 +635,7 @@ TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_NHWC_VectorLikeConst) {
|
||||
}
|
||||
}
|
||||
|
||||
#if GOOGLE_CUDA
|
||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_NCHW_VectorLikeConst) {
|
||||
for (auto mul_const_input_shape :
|
||||
{TensorShape{3}, TensorShape{3, 1, 1}, TensorShape{1, 3, 1, 1}}) {
|
||||
@ -649,14 +649,14 @@ TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_NCHW_VectorLikeConst) {
|
||||
/*expect_folded=*/false);
|
||||
}
|
||||
}
|
||||
#endif // GOOGLE_CUDA
|
||||
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
|
||||
TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_3x1Const) {
|
||||
for (auto data_format : {
|
||||
"NHWC",
|
||||
#if GOOGLE_CUDA
|
||||
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
"NCHW"
|
||||
#endif // GOOGLE_CUDA
|
||||
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
|
||||
}) {
|
||||
MulConvPushDownTest(
|
||||
/*input_shape=*/{3, 3, 3, 3},
|
||||
@ -668,6 +668,9 @@ TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv2D_3x1Const) {
|
||||
}
|
||||
}
|
||||
|
||||
// This test fails on ROCm platform with two vaue miscompare
|
||||
// TODO(rocm) : analysze and fix the cause of the failure and re-enable test
|
||||
#ifndef TENSORFLOW_USE_ROCM
|
||||
TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv3D_NDHWC_1x1x3Const) {
|
||||
MulConvPushDownTest(
|
||||
/*input_shape=*/{3, 3, 3, 3, 3},
|
||||
@ -678,6 +681,7 @@ TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv3D_NDHWC_1x1x3Const) {
|
||||
/*data_format=*/"NDHWC",
|
||||
/*expect_folded=*/true);
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_F(ConstantFoldingTest, MulConvPushDownTest_Conv3D_NCDHW_3x1x1x1Const) {
|
||||
MulConvPushDownTest(
|
||||
|
@ -143,6 +143,7 @@ py_test(
|
||||
shard_count = 4,
|
||||
srcs_version = "PY2AND3",
|
||||
tags = [
|
||||
"no_rocm",
|
||||
"no_windows",
|
||||
],
|
||||
deps = [
|
||||
@ -159,6 +160,7 @@ py_test(
|
||||
python_version = "PY3",
|
||||
srcs_version = "PY2AND3",
|
||||
tags = [
|
||||
"no_rocm",
|
||||
"no_windows",
|
||||
],
|
||||
deps = [
|
||||
|
@ -3197,6 +3197,7 @@ tf_py_test(
|
||||
size = "small",
|
||||
srcs = ["ops/collective_ops_test.py"],
|
||||
python_version = "PY3",
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":client_testlib",
|
||||
":collective_ops",
|
||||
@ -6425,6 +6426,7 @@ tf_py_test(
|
||||
size = "small",
|
||||
srcs = ["framework/convert_to_constants_test.py"],
|
||||
python_version = "PY3",
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
"client_testlib",
|
||||
"framework_test_lib",
|
||||
@ -6449,7 +6451,10 @@ tf_py_test(
|
||||
size = "small",
|
||||
srcs = ["lib/io/file_io_test.py"],
|
||||
python_version = "PY3",
|
||||
tags = ["no_windows"],
|
||||
tags = [
|
||||
"no_rocm",
|
||||
"no_windows",
|
||||
],
|
||||
deps = [
|
||||
":client_testlib",
|
||||
":errors",
|
||||
|
@ -926,6 +926,7 @@ py_test(
|
||||
srcs = ["wrappers/framework_test.py"],
|
||||
python_version = "PY3",
|
||||
srcs_version = "PY2AND3",
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":debug_data",
|
||||
":framework",
|
||||
@ -1146,6 +1147,7 @@ py_test(
|
||||
srcs = ["cli/debugger_cli_common_test.py"],
|
||||
python_version = "PY3",
|
||||
srcs_version = "PY2AND3",
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":debugger_cli_common",
|
||||
"//tensorflow/python:framework_test_lib",
|
||||
|
@ -177,6 +177,7 @@ py_test(
|
||||
srcs = ["distribute_lib_test.py"],
|
||||
python_version = "PY3",
|
||||
srcs_version = "PY2AND3",
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":combinations",
|
||||
":distribute_lib",
|
||||
|
@ -113,6 +113,7 @@ tf_py_test(
|
||||
tags = [
|
||||
"no_cuda_on_cpu_tap",
|
||||
"no_pip",
|
||||
"no_rocm",
|
||||
"no_windows",
|
||||
],
|
||||
deps = [
|
||||
@ -165,6 +166,7 @@ tf_py_test(
|
||||
tags = [
|
||||
"no_cuda_on_cpu_tap",
|
||||
"no_pip",
|
||||
"no_rocm",
|
||||
"no_windows",
|
||||
],
|
||||
deps = [":feature_column_v2_test_main_lib"],
|
||||
|
@ -43,6 +43,7 @@ tf_py_test(
|
||||
size = "medium",
|
||||
srcs = ["applications_test.py"],
|
||||
shard_count = 36,
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":applications",
|
||||
"//tensorflow/python:client_testlib",
|
||||
|
@ -650,7 +650,10 @@ tf_py_test(
|
||||
srcs = ["gru_test.py"],
|
||||
python_version = "PY3",
|
||||
shard_count = 4,
|
||||
tags = ["notsan"], # http://b/62136390
|
||||
tags = [
|
||||
"no_rocm",
|
||||
"notsan", # http://b/62136390
|
||||
],
|
||||
deps = [
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/keras",
|
||||
@ -666,6 +669,7 @@ tf_py_test(
|
||||
python_version = "PY3",
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"no_rocm",
|
||||
"noasan", # times out b/63678675
|
||||
"notsan", # http://b/62189182
|
||||
],
|
||||
|
@ -157,6 +157,7 @@ tf_py_test(
|
||||
srcs = ["pooling_test.py"],
|
||||
main = "pooling_test.py",
|
||||
python_version = "PY3",
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":pooling",
|
||||
"//tensorflow/python:array_ops",
|
||||
|
@ -136,6 +136,7 @@ tf_py_test(
|
||||
python_version = "PY3",
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"no_rocm",
|
||||
"no_windows",
|
||||
],
|
||||
deps = [
|
||||
|
@ -1093,6 +1093,7 @@ py_test(
|
||||
srcs = ["ragged_map_fn_op_test.py"],
|
||||
python_version = "PY3",
|
||||
srcs_version = "PY2AND3",
|
||||
tags = ["no_rocm"],
|
||||
deps = [
|
||||
":ragged", # fixdeps: keep
|
||||
":ragged_factory_ops",
|
||||
|
@ -32,6 +32,7 @@ py_test(
|
||||
"no_oss_py2",
|
||||
"no_oss_py35",
|
||||
"no_pip",
|
||||
"no_rocm",
|
||||
],
|
||||
deps = [
|
||||
"//tensorflow/python:client_testlib",
|
||||
|
@ -26,6 +26,7 @@ py_test(
|
||||
tags = [
|
||||
"no_oss_py2",
|
||||
"no_pip",
|
||||
"no_rocm",
|
||||
"no_windows", # numpy prints differently on windows.
|
||||
"noasan",
|
||||
"nomsan",
|
||||
|
Loading…
Reference in New Issue
Block a user