Adds TF2 layer tests witn new FE in precommit (#13311)

* marks tf2 keras tests as precommit for new FE

* adds tf2 layers tests for new FE in precommit

* removes redundant tabulations

* review changes

* fix field name

* fix syntax error

* removes failing tests

* removes failed test

* removes failed test
This commit is contained in:
Ruslan Nugmanov 2022-10-08 15:40:34 +02:00 committed by GitHub
parent 1e5ff24834
commit 80b6086bab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 61 additions and 49 deletions

View File

@ -458,6 +458,15 @@ jobs:
displayName: 'TensorFlow 1 Layer Tests - TF FE'
continueOnError: false
- script: |
python3 -m pip install -r $(LAYER_TESTS_DIR)/requirements.txt
export PYTHONPATH=$(REPO_DIR)/tools/mo/:$(LAYER_TESTS_DIR):$PYTHONPATH
export OV_FRONTEND_PATH=$(INSTALL_DIR)/runtime/lib/intel64
export TEST_DEVICE=CPU
$(RUN_PREFIX) python3 -m pytest $(LAYER_TESTS_DIR)/tensorflow2_keras_tests/ --use_new_frontend -m precommit_tf_fe --junitxml=$(INSTALL_TEST_DIR)/TEST-tf2_fe.xmlTEST
displayName: 'TensorFlow 2 Layer Tests - TF FE'
continueOnError: false
- script: |
python3 -m pip install -r $(LAYER_TESTS_DIR)/requirements.txt
export PYTHONPATH=$(LAYER_TESTS_DIR):$PYTHONPATH

View File

@ -44,8 +44,8 @@ class TestKerasActivation(CommonTF2LayerTest):
input_type=tf.float32),
dict(activation_func="sigmoid", input_names=["x1"], input_shapes=[[5, 4, 8, 3]],
input_type=tf.float32),
dict(activation_func="softmax", input_names=["x1"], input_shapes=[[5, 4, 8]],
input_type=tf.float32),
pytest.param(dict(activation_func="softmax", input_names=["x1"], input_shapes=[[5, 4, 8]],
input_type=tf.float32), marks=pytest.mark.precommit_tf_fe),
dict(activation_func="softsign", input_names=["x1"], input_shapes=[[5, 4]],
input_type=tf.float32),
dict(activation_func="swish", input_names=["x1"], input_shapes=[[5, 4, 8]],

View File

@ -46,9 +46,9 @@ class TestKerasAvgPool2D(CommonTF2LayerTest):
dict(pool_size=(5, 5), strides=None, padding='same', data_format='channels_last',
input_names=["x1"],
input_shapes=[[3, 4, 5, 6]], input_type=tf.float32),
dict(pool_size=(5, 5), strides=(3, 3), padding='valid', data_format='channels_last',
input_names=["x1"],
input_shapes=[[3, 7, 6, 5]], input_type=tf.float32)]
pytest.param(dict(pool_size=(5, 5), strides=(3, 3), padding='valid', data_format='channels_last',
input_names=["x1"],
input_shapes=[[3, 7, 6, 5]], input_type=tf.float32), marks=pytest.mark.precommit_tf_fe)]
@pytest.mark.parametrize("params", test_data_extended_float32)
@pytest.mark.nightly

View File

@ -46,9 +46,9 @@ class TestKerasBatchNormalization(CommonTF2LayerTest):
scale=False,
input_names=["x1"], input_shapes=[[3, 4, 5]],
input_type=tf.float32),
dict(axis=-1, momentum=0.0, epsilon=1e-5, center=True, scale=True,
input_names=["x1"], input_shapes=[[3, 4, 5, 6]],
input_type=tf.float32),
pytest.param(dict(axis=-1, momentum=0.0, epsilon=1e-5, center=True, scale=True,
input_names=["x1"], input_shapes=[[3, 4, 5, 6]],
input_type=tf.float32), marks=pytest.mark.precommit_tf_fe),
dict(axis=[2, 1, 4], momentum=0.99, epsilon=1e-2, center=False,
scale=True,
input_names=["x1"], input_shapes=[[3, 4, 5, 6, 7]],

View File

@ -47,10 +47,10 @@ class TestKerasConv1D(CommonTF2LayerTest):
dict(conv_params=dict(filters=27, kernel_size=3, padding="valid", dilation_rate=3),
input_names=["x"],
input_shapes=[[5, 7, 6]], input_type=tf.float32),
dict(conv_params=dict(filters=27, kernel_size=3, padding="valid", dilation_rate=3,
activation="swish",
use_bias=True), input_names=["x"], input_shapes=[[5, 7, 6]],
input_type=tf.float32),
pytest.param(dict(conv_params=dict(filters=27, kernel_size=3, padding="valid", dilation_rate=3,
activation="swish",
use_bias=True), input_names=["x"], input_shapes=[[5, 7, 6]],
input_type=tf.float32), marks=pytest.mark.precommit_tf_fe),
dict(conv_params=dict(filters=10, kernel_size=5, padding="same", dilation_rate=4,
activation="softmax",
use_bias=False), input_names=["x"], input_shapes=[[5, 7, 8]],

View File

@ -48,15 +48,15 @@ class TestKerasConv1DTranspose(CommonTF2LayerTest):
pytest.param(dict(
params=dict(filters=20, kernel_size=7, padding="valid", data_format="channels_first"),
input_names=["x"], input_shapes=[[5, 7, 8]], input_type=tf.float32),
marks=pytest.mark.xfail(reason="49505")),
marks=pytest.mark.xfail(reason="49505")),
dict(params=dict(filters=10, kernel_size=5, padding="same", strides=3), input_names=["x"],
input_shapes=[[5, 7, 8]], input_type=tf.float32),
dict(params=dict(filters=20, kernel_size=7, padding="valid", strides=4), input_names=["x"],
input_shapes=[[5, 7, 8]], input_type=tf.float32),
dict(params=dict(filters=27, kernel_size=3, padding="valid", dilation_rate=3),
input_names=["x"],
input_shapes=[[5, 7, 6]], input_type=tf.float32),
pytest.param(dict(params=dict(filters=27, kernel_size=3, padding="valid", dilation_rate=3),
input_names=["x"],
input_shapes=[[5, 7, 6]], input_type=tf.float32), marks=pytest.mark.precommit_tf_fe),
dict(params=dict(filters=20, kernel_size=7, padding="valid", data_format="channels_first"),
input_names=["x"],
input_shapes=[[5, 7, 8]], input_type=tf.float32),

View File

@ -52,10 +52,10 @@ class TestKerasConv2DTranspose(CommonTF2LayerTest):
dict(conv_params=dict(filters=10, kernel_size=5, padding="same", dilation_rate=4),
input_names=["x"],
input_shapes=[[3, 9, 7, 8]], input_type=tf.float32),
dict(conv_params=dict(filters=27, kernel_size=3, padding="valid", dilation_rate=3,
activation="sigmoid",
use_bias=False), input_names=["x"], input_shapes=[[3, 9, 7, 6]],
input_type=tf.float32),
pytest.param(dict(conv_params=dict(filters=27, kernel_size=3, padding="valid", dilation_rate=3,
activation="sigmoid",
use_bias=False), input_names=["x"], input_shapes=[[3, 9, 7, 6]],
input_type=tf.float32), marks=pytest.mark.precommit_tf_fe),
dict(conv_params=dict(filters=10, kernel_size=5, padding="same", dilation_rate=4,
use_bias=True),
input_names=["x"], input_shapes=[[3, 9, 7, 8]], input_type=tf.float32)

View File

@ -30,8 +30,8 @@ class TestKerasCropping2D(CommonTF2LayerTest):
dict(cropping=(1, 2), input_names=["x"], input_shapes=[[2, 3, 7, 5]],
input_type=tf.float32),
dict(cropping=((2, 1), (3, 2)), input_names=["x"], input_shapes=[[5, 7, 9, 7]],
input_type=tf.float32)]
pytest.param(dict(cropping=((2, 1), (3, 2)), input_names=["x"], input_shapes=[[5, 7, 9, 7]],
input_type=tf.float32), marks=pytest.mark.precommit_tf_fe)]
@pytest.mark.parametrize("params", test_data_float32)
@pytest.mark.nightly

View File

@ -55,8 +55,8 @@ class TestKerasDense(CommonTF2LayerTest):
activation='elu', use_bias=False),
dict(input_names=["x"], input_shapes=[[5, 4]], input_type=tf.float32, units=1,
activation='sigmoid', use_bias=True),
dict(input_names=["x"], input_shapes=[[5, 4, 8]], input_type=tf.float32, units=4,
activation='tanh', use_bias=True),
pytest.param(dict(input_names=["x"], input_shapes=[[5, 4, 8]], input_type=tf.float32, units=4,
activation='tanh', use_bias=True), marks=pytest.mark.precommit_tf_fe),
dict(input_names=["x"], input_shapes=[[5, 4, 8, 8]], input_type=tf.float32, units=5,
activation='linear', use_bias=True),
dict(input_names=["x"], input_shapes=[[5, 4, 8, 6, 4]], input_type=tf.float32, units=4,

View File

@ -90,10 +90,10 @@ class TestKerasDepthwiseConv2D(CommonTF2LayerTest):
dict(input_names=["x"], input_shapes=[[5, 16, 16, 4]], input_type=tf.float32,
kernel_size=(3, 3), strides=(4, 4), padding='valid', depth_multiplier=2,
data_format='channels_first', dilation_rate=1, activation='elu', use_bias=True),
dict(input_names=["x"], input_shapes=[[5, 8, 16, 4]], input_type=tf.float32,
kernel_size=(2, 2), strides=1, padding='same', depth_multiplier=2,
data_format='channels_last',
dilation_rate=(2, 2), activation='linear', use_bias=True),
pytest.param(dict(input_names=["x"], input_shapes=[[5, 8, 16, 4]], input_type=tf.float32,
kernel_size=(2, 2), strides=1, padding='same', depth_multiplier=2,
data_format='channels_last',
dilation_rate=(2, 2), activation='linear', use_bias=True), marks=pytest.mark.precommit_tf_fe),
dict(input_names=["x"], input_shapes=[[5, 16, 8, 4]], input_type=tf.float32,
kernel_size=(2, 2), strides=(3, 3), padding='same', depth_multiplier=54,
data_format='channels_first',

View File

@ -27,8 +27,8 @@ class TestKerasEmbedding(CommonTF2LayerTest):
return tf2_net, ref_net
test_data_float32 = [
dict(input_names=["x"], input_shapes=[[5, 16]], input_type=tf.float32, input_dim=256,
output_dim=8, mask_zero=True, input_length=4),
pytest.param(dict(input_names=["x"], input_shapes=[[5, 16]], input_type=tf.float32, input_dim=256,
output_dim=8, mask_zero=True, input_length=4), marks=pytest.mark.precommit_tf_fe),
dict(input_names=["x"], input_shapes=[[5, 16]], input_type=tf.float32, input_dim=256,
output_dim=324, mask_zero=True, input_length=16),
dict(input_names=["x"], input_shapes=[[5, 16]], input_type=tf.float32, input_dim=256,

View File

@ -47,9 +47,9 @@ class TestKerasLayerNormalization(CommonTF2LayerTest):
dict(input_names=["x"], input_shapes=[[2, 3, 8]], input_type=tf.float32, axis=2,
epsilon=1e-6,
center=False, scale=True),
dict(input_names=["x"], input_shapes=[[2, 2, 3, 5]], input_type=tf.float32, axis=(1, 2, 3),
epsilon=1e-5,
center=True, scale=True)]
pytest.param(dict(input_names=["x"], input_shapes=[[2, 2, 3, 5]], input_type=tf.float32, axis=(1, 2, 3),
epsilon=1e-5,
center=True, scale=True), marks=pytest.mark.precommit_tf_fe)]
@pytest.mark.parametrize("params", test_data_float32)
@pytest.mark.nightly

View File

@ -48,7 +48,7 @@ class TestKerasLSTM(CommonTF2LayerTest):
flags=(False, False)),
dict(input_names=["x"], input_shapes=[[1, 3, 4]], input_type=tf.float32, units=3,
activation='linear', recurrent_activation='sigmoid', dropouts=(.4, .6),
flags=(False, False), use_bias=True)
flags=(False, False), use_bias=True),
]
@pytest.mark.parametrize("params", test_data_simple)

View File

@ -37,9 +37,10 @@ class TestKerasMaxPool2D(CommonTF2LayerTest):
strides=None, padding='valid', dataformat='channels_last'),
dict(input_names=["x"], input_shapes=[[5, 4, 5, 12]], input_type=tf.float32, pool_size=1,
strides=4, padding='valid', dataformat='channels_last'),
dict(input_names=["x"], input_shapes=[[5, 4, 6, 6]], input_type=tf.float32,
pool_size=(2, 3),
strides=(3, 3), padding='valid', dataformat='channels_last'),
pytest.param(dict(input_names=["x"], input_shapes=[[5, 4, 6, 6]], input_type=tf.float32,
pool_size=(2, 3),
strides=(3, 3), padding='valid', dataformat='channels_last'),
marks=pytest.mark.precommit_tf_fe),
dict(input_names=["x"], input_shapes=[[5, 4, 4, 8]], input_type=tf.float32, pool_size=2,
strides=2, padding='valid', dataformat='channels_last'),
]

View File

@ -73,7 +73,7 @@ class TestKerasMultiHeadAttention(CommonTF2LayerTest):
num_heads=1, key_dim=3, value_dim=4, dropout=0.0, use_bias=True,
output_shape=None, attention_axes=None,
return_attention_scores=True, training=False),
marks=pytest.mark.xfail(reason="45432"))
marks=[pytest.mark.xfail(reason="45432"), pytest.mark.precommit_tf_fe])
]
@pytest.mark.skip(reason='Einsum is unsupported in MO')

View File

@ -97,7 +97,7 @@ class TestKerasRNN(CommonTF2LayerTest):
cell="SimpleRNNCell", return_sequences=False,
return_state=False, go_backwards=False,
stateful=False, unroll=False, time_major=True,
)
),
]
@pytest.mark.parametrize("params", test_data_others)

View File

@ -31,8 +31,8 @@ class TestKerasRoll(CommonTF2LayerTest):
input_type=tf.float16),
dict(shift=[11, -8], axis=[-1, -2], input_names=["x1"], input_shapes=[[3, 4, 3, 1]],
input_type=tf.int32),
dict(shift=[7, -2, 5], axis=[0, -1, -1], input_names=["x1"], input_shapes=[[5, 2, 3, 7]],
input_type=tf.int64),
pytest.param(dict(shift=[7, -2, 5], axis=[0, -1, -1], input_names=["x1"], input_shapes=[[5, 2, 3, 7]],
input_type=tf.int64), marks=pytest.mark.precommit_tf_fe),
pytest.param(
dict(shift=[1, -2], axis=[0, 1], input_names=["x1"], input_shapes=[[2, 4, 3, 5]],
input_type=tf.float32),

View File

@ -114,9 +114,10 @@ class TestKerasSeparableConv2D(CommonTF2LayerTest):
dict(input_names=["x1"], input_shapes=[[5, 17, 14, 3]], input_type=tf.float32,
filters=3, kernel_size=(2, 1), strides=1, padding='valid', data_format='channels_last',
dilation_rate=1, depth_multiplier=1, activation='relu', use_bias=True),
dict(input_names=["x1"], input_shapes=[[1, 14, 12, 2]], input_type=tf.float32,
filters=4, kernel_size=(2, 2), strides=1, padding='valid', data_format='channels_last',
dilation_rate=2, depth_multiplier=3, activation='relu', use_bias=False),
pytest.param(dict(input_names=["x1"], input_shapes=[[1, 14, 12, 2]], input_type=tf.float32,
filters=4, kernel_size=(2, 2), strides=1, padding='valid', data_format='channels_last',
dilation_rate=2, depth_multiplier=3, activation='relu', use_bias=False),
marks=pytest.mark.precommit_tf_fe),
]
@pytest.mark.parametrize("params", test_data_different_bias)

View File

@ -44,8 +44,9 @@ class TestKerasUpSampling2D(CommonTF2LayerTest):
# Tests for bilinear interpolation
test_data_bilinear = [
dict(input_names=["x1"], input_shapes=[[1, 6, 2, 1]], input_type=tf.float32,
size=(3, 1), data_format='channels_last', interpolation='bilinear'),
pytest.param(dict(input_names=["x1"], input_shapes=[[1, 6, 2, 1]], input_type=tf.float32,
size=(3, 1), data_format='channels_last', interpolation='bilinear'),
marks=pytest.mark.precommit_tf_fe),
dict(input_names=["x1"], input_shapes=[[1, 3, 1, 6]], input_type=tf.float32,
size=(5, 2), data_format='channels_last', interpolation='bilinear'),
]

View File

@ -26,8 +26,8 @@ class TestKerasZeroPadding2D(CommonTF2LayerTest):
padding=2, data_format='channels_last'),
dict(input_names=["x1"], input_shapes=[[3, 2, 4, 6]], input_type=tf.float32,
padding=(3, 0), data_format='channels_last'),
dict(input_names=["x1"], input_shapes=[[1, 3, 8, 7]], input_type=tf.float32,
padding=((5, 1), (3, 4)), data_format='channels_last'),
pytest.param(dict(input_names=["x1"], input_shapes=[[1, 3, 8, 7]], input_type=tf.float32,
padding=((5, 1), (3, 4)), data_format='channels_last'), marks=pytest.mark.precommit_tf_fe),
]
@pytest.mark.parametrize("params", test_data_channels_last)

View File

@ -107,7 +107,7 @@ class TestMapFN(CommonTF2LayerTest):
fn_output_signature=(tf.int32, tf.int32, tf.int32), back_prop=True,
input_names=["x1", "x2", "x3"],
input_shapes=[[2, 1, 3, 4], [2, 1, 3, 4], [2, 1, 3, 4]]),
marks=pytest.mark.xfail(reason="61587"))
marks=[pytest.mark.xfail(reason="61587"), pytest.mark.precommit_tf_fe])
]
@pytest.mark.parametrize("params", test_multiple_inputs_outputs_int32)