PR #39548: [INTEL MKL] Fix conv_ops_test and remapper_test
Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/39548
Fix two C++ test failures related to MKL ops.
1. conv_ops_test // MklConvOp does not support EXPLICIT padding
2. remapper_test // Fusion of MKL Conv and Mkl FusedBatchNorm is not supported
The fix is to disable the related tests with MKL build.
Copybara import of the project:
--
5d92849778
by Guozhong Zhu...
***
PiperOrigin-RevId: 312742653
Change-Id: I0393c00589c3d2bc04965e390c2b2ba249da0432
This commit is contained in:
parent
8d7f18b250
commit
b6d6b451aa
@ -607,7 +607,6 @@ TEST_F(RemapperTest, FuseMatMulWithBiasAndActivation) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef INTEL_MKL
|
||||
TEST_F(RemapperTest, FuseConv2DWithBatchNorm) {
|
||||
using ops::Placeholder;
|
||||
|
||||
@ -851,7 +850,6 @@ TEST_F(RemapperTest, FuseConv2DWithSqueezeAndBias) {
|
||||
ASSERT_EQ(tensors.size(), 1);
|
||||
test::ExpectTensorNear<float>(tensors[0], tensors_expected[0], 1e-6);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace grappler
|
||||
} // namespace tensorflow
|
||||
|
@ -1028,14 +1028,12 @@ TYPED_TEST_P(FusedConv2DWithBiasOpTest, SpatialConvolution) {
|
||||
this->VerifyConv2DWithBias(filter_size, filter_count);
|
||||
}
|
||||
|
||||
#ifndef INTEL_MKL
|
||||
TYPED_TEST_P(FusedConv2DWithBiasOpTest, ExplicitPaddingConvolution) {
|
||||
const int filter_size = 3;
|
||||
const int filter_count = 12;
|
||||
this->VerifyConv2DWithBias(filter_size, filter_count,
|
||||
/*explicit_paddings=*/{0, 0, 1, 2, 3, 4, 0, 0});
|
||||
}
|
||||
#endif
|
||||
|
||||
TYPED_TEST_P(FusedConv2DWithBiasOpTest, OneByOneConvolutionAndActivation) {
|
||||
const int filter_size = 1;
|
||||
@ -1064,7 +1062,6 @@ TYPED_TEST_P(FusedConv2DWithBiasOpTest, SpatialConvolutionAndActivation) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef INTEL_MKL
|
||||
TYPED_TEST_P(FusedConv2DWithBiasOpTest,
|
||||
ExplicitPaddingConvolutionAndActivation) {
|
||||
const int filter_size = 3;
|
||||
@ -1075,7 +1072,6 @@ TYPED_TEST_P(FusedConv2DWithBiasOpTest,
|
||||
/*explicit_paddings=*/{0, 0, 1, 2, 3, 4, 0, 0});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// Conv2D + FusedBatchNorm + {Activation} //
|
||||
@ -1099,7 +1095,6 @@ TYPED_TEST_P(FusedConv2DWithBatchNormOpTest, SpatialConvolution) {
|
||||
this->VerifyConv2DWithBatchNorm(filter_size, filter_count);
|
||||
}
|
||||
|
||||
#ifndef INTEL_MKL
|
||||
TYPED_TEST_P(FusedConv2DWithBatchNormOpTest, ExplicitPaddingConvolution) {
|
||||
const int filter_size = 3;
|
||||
const int filter_count = 12;
|
||||
@ -1107,7 +1102,6 @@ TYPED_TEST_P(FusedConv2DWithBatchNormOpTest, ExplicitPaddingConvolution) {
|
||||
filter_size, filter_count,
|
||||
/*explicit_paddings=*/{0, 0, 1, 2, 3, 4, 0, 0});
|
||||
}
|
||||
#endif
|
||||
|
||||
TYPED_TEST_P(FusedConv2DWithBatchNormOpTest, OneByOneConvolutionAndActivation) {
|
||||
const int filter_size = 1;
|
||||
@ -1137,7 +1131,6 @@ TYPED_TEST_P(FusedConv2DWithBatchNormOpTest, SpatialConvolutionAndActivation) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef INTEL_MKL
|
||||
TYPED_TEST_P(FusedConv2DWithBatchNormOpTest,
|
||||
ExplicitPaddingConvolutionAndActivation) {
|
||||
const int filter_size = 3;
|
||||
@ -1148,49 +1141,34 @@ TYPED_TEST_P(FusedConv2DWithBatchNormOpTest,
|
||||
/*explicit_paddings=*/{0, 0, 1, 2, 3, 4, 0, 0});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
REGISTER_TYPED_TEST_SUITE_P(FusedConv2DWithBiasOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
#ifndef INTEL_MKL
|
||||
ExplicitPaddingConvolution, //
|
||||
#endif
|
||||
REGISTER_TYPED_TEST_SUITE_P(FusedConv2DWithBiasOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
ExplicitPaddingConvolution, //
|
||||
OneByOneConvolutionAndActivation, //
|
||||
ImageSizeConvolutionAndActivation, //
|
||||
#ifndef INTEL_MKL
|
||||
SpatialConvolutionAndActivation, //
|
||||
SpatialConvolutionAndActivation, //
|
||||
ExplicitPaddingConvolutionAndActivation);
|
||||
#else
|
||||
SpatialConvolutionAndActivation);
|
||||
#endif
|
||||
|
||||
REGISTER_TYPED_TEST_SUITE_P(FusedConv2DWithBatchNormOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
#ifndef INTEL_MKL
|
||||
ExplicitPaddingConvolution, //
|
||||
#endif
|
||||
REGISTER_TYPED_TEST_SUITE_P(FusedConv2DWithBatchNormOpTest, //
|
||||
OneByOneConvolution, //
|
||||
ImageSizeConvolution, //
|
||||
SpatialConvolution, //
|
||||
ExplicitPaddingConvolution, //
|
||||
OneByOneConvolutionAndActivation, //
|
||||
ImageSizeConvolutionAndActivation, //
|
||||
#ifndef INTEL_MKL
|
||||
SpatialConvolutionAndActivation, //
|
||||
SpatialConvolutionAndActivation, //
|
||||
ExplicitPaddingConvolutionAndActivation);
|
||||
#else
|
||||
SpatialConvolutionAndActivation);
|
||||
#endif
|
||||
|
||||
using FusedBiasAddDataTypes = ::testing::Types<float, double>;
|
||||
INSTANTIATE_TYPED_TEST_SUITE_P(Test, FusedConv2DWithBiasOpTest,
|
||||
FusedBiasAddDataTypes);
|
||||
|
||||
#ifndef INTEL_MKL
|
||||
using FusedBatchNormDataTypes = ::testing::Types<float>;
|
||||
INSTANTIATE_TYPED_TEST_SUITE_P(Test, FusedConv2DWithBatchNormOpTest,
|
||||
FusedBatchNormDataTypes);
|
||||
#endif
|
||||
|
||||
#endif // TENSORFLOW_USE_ROCM
|
||||
} // namespace tensorflow
|
||||
|
Loading…
Reference in New Issue
Block a user