[GNA] smoke_MemoryTest suite enabled for transformation=NONE (#16481)

* relative threshold for smoke_MemoryTest suite adjusted for GNA

* smoke_MemoryTest suite enabled

* GNA MemoryTest. TransformNone: input changed to [5-10]. TransformLatency is disabled.

* RR comments applied

* RR2 comments applied

* RR3 comments applied

* clang-format-9 fix

* RR4 comments applied
This commit is contained in:
Maciej Kwapulinski
2023-04-12 23:16:08 +02:00
committed by GitHub
parent 65a49e903c
commit 0e975ffbb6
4 changed files with 61 additions and 11 deletions

View File

@@ -6,10 +6,62 @@
#include <vector>
#include "ngraph_functions/builders.hpp"
#include "openvino/op/util/variable.hpp"
#include "openvino/opsets/opset11.hpp"
using namespace LayerTestsDefinitions;
using namespace ngraph;
using namespace ov::opset11;
namespace {
class MemoryTestGna : public MemoryTest {
public:
InferenceEngine::Blob::Ptr GenerateInput(const InferenceEngine::InputInfo& info) const override {
// data comparison against relative threshold works correct when input data is shifted away from 0.
// This happens also when POT generated FQ layers are added (see below) to original model.
return FuncTestUtils::createAndFillBlob(info.getTensorDesc(), 5, 5);
}
protected:
void CreateCommonFunc() override;
};
void MemoryTestGna::CreateCommonFunc() {
auto param = builder::makeParams(ngPrc, {inputShape});
const auto variable_info = VariableInfo{PartialShape::dynamic(), element::dynamic, "v0"};
auto variable = std::make_shared<Variable>(variable_info);
auto min55 = ngraph::builder::makeConstant<float>(ngPrc, {}, {-55.001678466796875f});
auto max55 = ngraph::builder::makeConstant<float>(ngPrc, {}, {55.0f});
auto min270 = ngraph::builder::makeConstant<float>(ngPrc, {}, {-270.00823974609375f});
auto max270 = ngraph::builder::makeConstant<float>(ngPrc, {}, {270.0f});
auto min325 = ngraph::builder::makeConstant<float>(ngPrc, {}, {-325.0099182128906f});
auto max325 = ngraph::builder::makeConstant<float>(ngPrc, {}, {325.0f});
auto fq_from_Par225 = std::make_shared<FakeQuantize>(param.at(0), min55, max55, min55, max55, 65536);
auto read_value = CreateReadValueOp(fq_from_Par225, variable);
auto fq_from_ReadVal = std::make_shared<FakeQuantize>(read_value, min270, max270, min270, max270, 65536);
auto add = std::make_shared<Add>(fq_from_ReadVal, fq_from_Par225);
auto fq_from_add = std::make_shared<FakeQuantize>(add, min325, max325, min325, max325, 65536);
auto assign = CreateAssignOp(fq_from_add, variable);
auto res = std::make_shared<Result>(fq_from_add);
function = std::make_shared<Function>(ResultVector{res}, SinkVector{assign}, param, "TestMemory");
}
TEST_P(MemoryTestGna, CompareWithRefs) {
Run();
}
std::vector<ngraph::helpers::MemoryTransformation> transformation{
ngraph::helpers::MemoryTransformation::NONE,
ngraph::helpers::MemoryTransformation::LOW_LATENCY_V2,
@@ -23,7 +75,7 @@ const std::vector<InferenceEngine::Precision> inputPrecisions = {InferenceEngine
const std::vector<int64_t> iterationCount{1, 3, 4, 10};
INSTANTIATE_TEST_SUITE_P(smoke_MemoryTest,
MemoryTest,
MemoryTestGna,
::testing::Combine(::testing::ValuesIn(transformation),
::testing::ValuesIn(iterationCount),
::testing::ValuesIn(inShapes),

View File

@@ -43,12 +43,9 @@ std::vector<std::string> disabledTestPatterns() {
R"(.*importExportedIENetworkConstantResultOnly.*)",
R"(.*importExportedIENetworkParameterResultOnly.*)",
// TODO: Issue 57368 (accuracy)
R"(.*smoke_MemoryTest.*LOW_LATENCY.*IS=\(1.10\).*)",
R"(.*smoke_MemoryTest.*iteration_count=3.*IS=\(1.10\).*)",
R"(.*smoke_MemoryTest.*iteration_count=4.*IS=\(1.10\).*)",
R"(.*smoke_MemoryTest.*iteration_count=10.*IS=\(1.10\).*)",
R"(.*smoke_MemoryTest.*LOW_LATENCY.*iteration_count=10.*IS=\(1.2\).*)",
// Issue 57368 (accuracy)
R"(.*smoke_MemoryTest.*transformation=LOW_LATENCY.*)",
// Not implemented yet
R"(.*Behavior.*ExecutableNetworkBaseTest.*(canSetConfigToExecNet|canSetConfigToExecNetWithIncorrectConfig).*)",
R"(.*Behavior.*OVCompiledModelBaseTest.*(canSetConfigToCompiledModel|canSetConfigToCompiledModelWithIncorrectConfig).*)",

View File

@@ -42,9 +42,13 @@ protected:
return std::make_shared<ngraph::opset6::Assign>(value, variable);
}
virtual void CreateCommonFunc();
ov::element::Type ngPrc;
ov::Shape inputShape;
private:
void CreateTIFunc();
void CreateCommonFunc();
void ApplyLowLatency();
InferenceEngine::Precision netPrecision;
@@ -52,8 +56,6 @@ private:
ngraph::helpers::MemoryTransformation transformation;
int64_t iteration_count;
ngraph::element::Type ngPrc;
InferenceEngine::SizeVector inputShape;
};
class MemoryTestV3 : public MemoryTest {

View File

@@ -52,7 +52,6 @@ namespace LayerTestsDefinitions {
eval_context["VariableContext"] = variable_context;
}
void MemoryTest::Run() {
functionRefs = ngraph::clone_function(*function);
SKIP_IF_CURRENT_TEST_IS_DISABLED()