Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust RNN tests to changes in openvinotoolkit/openvino#18138 #678

Merged
merged 4 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const std::vector<bool> linear_before_reset{true};

const std::vector<InferenceEngine::Precision> net_precisions = {InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16};
const std::vector WRBLayerTypes = {ngraph::helpers::InputLayerType::CONSTANT};

// ------------- Smoke shapes -------------
const std::vector<size_t> smoke_batches_01{1, 2};
Expand All @@ -82,6 +83,9 @@ INSTANTIATE_TEST_CASE_P(smoke_GRUCellCommon_01,
::testing::Values(activations),
::testing::ValuesIn(clips),
::testing::ValuesIn(linear_before_reset),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(net_precisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
GRUCellTest::getTestCaseName);
Expand All @@ -99,6 +103,9 @@ INSTANTIATE_TEST_CASE_P(smoke_GRUCellCommon_02_FP32,
::testing::Values(activations),
::testing::ValuesIn(clips),
::testing::ValuesIn(linear_before_reset),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
GRUCellTest::getTestCaseName);
Expand All @@ -112,6 +119,9 @@ INSTANTIATE_TEST_CASE_P(smoke_GRUCellCommon_02_FP16,
::testing::Values(activations),
::testing::ValuesIn(clips),
::testing::ValuesIn(linear_before_reset),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::Values(InferenceEngine::Precision::FP16),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
GRUCellTest::getTestCaseName);
Expand All @@ -130,6 +140,9 @@ INSTANTIATE_TEST_CASE_P(GRUCell_LPCNet,
::testing::Values(activations),
::testing::ValuesIn(clips),
::testing::ValuesIn(linear_before_reset),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(net_precisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
GRUCellTest::getTestCaseName);
Expand All @@ -144,6 +157,9 @@ const auto benchmark_params = ::testing::Combine(::testing::Values(should_decomp
::testing::Values(activations),
::testing::Values(clips[0]),
::testing::Values(linear_before_reset[0]),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::Values(net_precisions[0]),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace LayerTestsDefinitions {

using ngraph::helpers::InputLayerType;

class CUDNNGRUSequenceTest : public UnsymmetricalComparer<GRUSequenceTest> {
public:
void SetUp() override {
Expand Down Expand Up @@ -74,6 +76,7 @@ class LPCNetCUDNNGRUSequenceTest : public UnsymmetricalComparer<GRUSequenceTest>
bool linear_before_reset;
SequenceTestsMode mode;
ov::op::RecurrentSequenceDirection direction;
InputLayerType WRBType;
InferenceEngine::Precision netPrecision;
std::tie(mode,
seq_lengths,
Expand All @@ -83,6 +86,7 @@ class LPCNetCUDNNGRUSequenceTest : public UnsymmetricalComparer<GRUSequenceTest>
clip,
linear_before_reset,
direction,
WRBType,
netPrecision,
targetDevice) = this->GetParam();
size_t num_directions = direction == ov::op::RecurrentSequenceDirection::BIDIRECTIONAL ? 2 : 1;
Expand All @@ -98,6 +102,7 @@ class LPCNetCUDNNGRUSequenceTest : public UnsymmetricalComparer<GRUSequenceTest>
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {inputShapes[0], inputShapes[1]});

ASSERT_EQ(InputLayerType::CONSTANT, WRBType);
std::vector<ov::Shape> WRB = {inputShapes[3], inputShapes[4], inputShapes[5], inputShapes[2]};
auto gru_sequence =
ngraph::builder::makeGRU(ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes(params)),
Expand Down Expand Up @@ -168,6 +173,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::ValuesIn(clip),
::testing::ValuesIn(linear_before_reset),
::testing::ValuesIn(direction),
::testing::Values(InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
GRUSequenceTest::getTestCaseName);
Expand All @@ -188,6 +194,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::ValuesIn(clip),
::testing::ValuesIn(linear_before_reset),
::testing::ValuesIn(direction),
::testing::Values(InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
GRUSequenceTest::getTestCaseName);
Expand All @@ -207,6 +214,7 @@ INSTANTIATE_TEST_CASE_P(LPCNetCUDNNGRUSequenceShapeTest,
::testing::ValuesIn(clip),
::testing::ValuesIn(linear_before_reset),
::testing::ValuesIn(direction),
::testing::Values(InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
GRUSequenceTest::getTestCaseName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const bool should_decompose = false;
const std::vector<std::string> activations{"sigmoid", "tanh", "tanh"};
const std::vector<InferenceEngine::Precision> netPrecisions = {InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16};
const std::vector WRBLayerTypes = {ngraph::helpers::InputLayerType::CONSTANT};

// ------------- Smoke shapes -------------
const std::vector<size_t> smoke_batch{1, 5};
Expand All @@ -84,6 +85,9 @@ INSTANTIATE_TEST_CASE_P(smoke_LSTMCell_01,
::testing::ValuesIn(smoke_input_sizes_01),
::testing::Values(activations),
::testing::ValuesIn(smoke_clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -99,6 +103,9 @@ INSTANTIATE_TEST_CASE_P(smoke_LSTMCell_02,
::testing::ValuesIn(smoke_input_sizes_02),
::testing::Values(activations),
::testing::ValuesIn(smoke_clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -122,6 +129,9 @@ INSTANTIATE_TEST_CASE_P(LSTMCell_Tacotron2_dec_01,
::testing::Values(tacotron2_dec_01.input_size),
::testing::Values(activations),
::testing::Values(tacotron2_dec_01.clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -136,6 +146,9 @@ INSTANTIATE_TEST_CASE_P(LSTMCell_Tacotron2_dec_02,
::testing::Values(tacotron2_dec_02.input_size),
::testing::Values(activations),
::testing::Values(tacotron2_dec_02.clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -150,6 +163,9 @@ INSTANTIATE_TEST_CASE_P(LSTMCell_Tacotron2_enc_01,
::testing::Values(tacotron2_enc_01.input_size),
::testing::Values(activations),
::testing::Values(tacotron2_enc_01.clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -165,6 +181,9 @@ INSTANTIATE_TEST_CASE_P(LSTMCell_OV_Doc_01,
::testing::Values(ov_doc_01.input_size),
::testing::Values(activations),
::testing::Values(ov_doc_01.clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -179,6 +198,9 @@ INSTANTIATE_TEST_CASE_P(LSTMCell_Big_01,
::testing::Values(big_01.input_size),
::testing::Values(activations),
::testing::Values(big_01.clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -193,6 +215,9 @@ INSTANTIATE_TEST_CASE_P(LSTMCell_Big_02,
::testing::Values(big_02.input_size),
::testing::Values(activations),
::testing::Values(big_02.clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand All @@ -207,6 +232,9 @@ INSTANTIATE_TEST_CASE_P(LSTMCell_Big_03,
::testing::Values(big_03.input_size),
::testing::Values(activations),
::testing::Values(big_03.clip),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(WRBLayerTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDNNLSTMCellTest::getTestCaseName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ INSTANTIATE_TEST_CASE_P(smoke_LSTMSequence_01,
::testing::Values(activations),
::testing::Values(no_clip),
::testing::ValuesIn(sequenceDirections),
::testing::Values(ngraph::helpers::InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDALSTMSequenceTest::getTestCaseName);
Expand All @@ -88,6 +89,7 @@ INSTANTIATE_TEST_CASE_P(smoke_LSTMSequence_02,
::testing::Values(activations),
::testing::Values(no_clip),
::testing::ValuesIn(sequenceDirections),
::testing::Values(ngraph::helpers::InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDALSTMSequenceTest::getTestCaseName);
Expand All @@ -104,6 +106,7 @@ INSTANTIATE_TEST_CASE_P(LSTMSequence_Tacotron2_decoder_01,
::testing::Values(activations),
::testing::Values(no_clip), // clip
::testing::Values(ov::op::RecurrentSequenceDirection::FORWARD),
::testing::Values(ngraph::helpers::InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDALSTMSequenceTest::getTestCaseName);
Expand All @@ -118,6 +121,7 @@ INSTANTIATE_TEST_CASE_P(LSTMSequence_Tacotron2_decoder_02,
::testing::Values(activations),
::testing::Values(no_clip), // clip
::testing::Values(ov::op::RecurrentSequenceDirection::FORWARD),
::testing::Values(ngraph::helpers::InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDALSTMSequenceTest::getTestCaseName);
Expand All @@ -132,6 +136,7 @@ INSTANTIATE_TEST_CASE_P(LSTMSequence_Tacotron2_encoder_01,
::testing::Values(activations),
::testing::Values(no_clip), // clip
::testing::Values(ov::op::RecurrentSequenceDirection::BIDIRECTIONAL),
::testing::Values(ngraph::helpers::InputLayerType::CONSTANT),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_NVIDIA)),
CUDALSTMSequenceTest::getTestCaseName);
Expand Down
Loading