Define OP version in report by first occurrence in opset instead of type_info (#5177)
This commit is contained in:
parent
7a634490dc
commit
76fd791363
@ -27,9 +27,6 @@ LayerTestsCommon::LayerTestsCommon() : threshold(1e-2f) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LayerTestsCommon::Run() {
|
void LayerTestsCommon::Run() {
|
||||||
auto &s = Summary::getInstance();
|
|
||||||
s.setDeviceName(targetDevice);
|
|
||||||
|
|
||||||
auto crashHandler = [](int errCode) {
|
auto crashHandler = [](int errCode) {
|
||||||
auto &s = Summary::getInstance();
|
auto &s = Summary::getInstance();
|
||||||
s.saveReport();
|
s.saveReport();
|
||||||
@ -38,6 +35,9 @@ void LayerTestsCommon::Run() {
|
|||||||
};
|
};
|
||||||
signal(SIGSEGV, crashHandler);
|
signal(SIGSEGV, crashHandler);
|
||||||
|
|
||||||
|
auto &s = Summary::getInstance();
|
||||||
|
s.setDeviceName(targetDevice);
|
||||||
|
|
||||||
if (FuncTestUtils::SkipTestsConfig::currentTestIsDisabled()) {
|
if (FuncTestUtils::SkipTestsConfig::currentTestIsDisabled()) {
|
||||||
s.updateOPsStats(function, PassRate::Statuses::SKIPPED);
|
s.updateOPsStats(function, PassRate::Statuses::SKIPPED);
|
||||||
GTEST_SKIP() << "Disabled test due to configuration" << std::endl;
|
GTEST_SKIP() << "Disabled test due to configuration" << std::endl;
|
||||||
|
@ -67,12 +67,15 @@ private:
|
|||||||
static size_t saveReportTimeout;
|
static size_t saveReportTimeout;
|
||||||
static bool extendReport;
|
static bool extendReport;
|
||||||
static bool saveReportWithUniqueName;
|
static bool saveReportWithUniqueName;
|
||||||
static const char* outputFolder;
|
static const char *outputFolder;
|
||||||
|
std::vector<ngraph::OpSet> opsets;
|
||||||
|
|
||||||
friend class SummaryDestroyer;
|
friend class SummaryDestroyer;
|
||||||
|
|
||||||
|
std::string getOpVersion(const ngraph::NodeTypeInfo &type_info);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Summary() = default;
|
Summary();
|
||||||
|
|
||||||
~Summary() = default;
|
~Summary() = default;
|
||||||
|
|
||||||
|
@ -23,6 +23,16 @@ void SummaryDestroyer::initialize(Summary *p) {
|
|||||||
p_instance = p;
|
p_instance = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Summary::Summary() {
|
||||||
|
opsets.push_back(ngraph::get_opset1());
|
||||||
|
opsets.push_back(ngraph::get_opset2());
|
||||||
|
opsets.push_back(ngraph::get_opset3());
|
||||||
|
opsets.push_back(ngraph::get_opset4());
|
||||||
|
opsets.push_back(ngraph::get_opset5());
|
||||||
|
opsets.push_back(ngraph::get_opset6());
|
||||||
|
opsets.push_back(ngraph::get_opset7());
|
||||||
|
}
|
||||||
|
|
||||||
Summary &Summary::getInstance() {
|
Summary &Summary::getInstance() {
|
||||||
if (!p_instance) {
|
if (!p_instance) {
|
||||||
p_instance = new Summary();
|
p_instance = new Summary();
|
||||||
@ -69,6 +79,15 @@ void Summary::updateOPsStats(const ngraph::NodeTypeInfo &op, const PassRate::Sta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Summary::getOpVersion(const ngraph::NodeTypeInfo &type_info) {
|
||||||
|
for (size_t i = 0; i < opsets.size(); i++) {
|
||||||
|
if (opsets[i].contains_type(type_info)) {
|
||||||
|
return std::to_string(i+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "undefined";
|
||||||
|
}
|
||||||
|
|
||||||
std::map<std::string, PassRate> Summary::getOpStatisticFromReport() {
|
std::map<std::string, PassRate> Summary::getOpStatisticFromReport() {
|
||||||
pugi::xml_document doc;
|
pugi::xml_document doc;
|
||||||
|
|
||||||
@ -138,14 +157,6 @@ void Summary::saveReport() {
|
|||||||
|
|
||||||
std::string outputFilePath = outputFolder + std::string(CommonTestUtils::FileSeparator) + filename;
|
std::string outputFilePath = outputFolder + std::string(CommonTestUtils::FileSeparator) + filename;
|
||||||
|
|
||||||
std::vector<ngraph::OpSet> opsets;
|
|
||||||
opsets.push_back(ngraph::get_opset1());
|
|
||||||
opsets.push_back(ngraph::get_opset2());
|
|
||||||
opsets.push_back(ngraph::get_opset3());
|
|
||||||
opsets.push_back(ngraph::get_opset4());
|
|
||||||
opsets.push_back(ngraph::get_opset5());
|
|
||||||
opsets.push_back(ngraph::get_opset6());
|
|
||||||
opsets.push_back(ngraph::get_opset7());
|
|
||||||
std::set<ngraph::NodeTypeInfo> opsInfo;
|
std::set<ngraph::NodeTypeInfo> opsInfo;
|
||||||
for (const auto &opset : opsets) {
|
for (const auto &opset : opsets) {
|
||||||
const auto &type_info_set = opset.get_type_info_set();
|
const auto &type_info_set = opset.get_type_info_set();
|
||||||
@ -165,7 +176,7 @@ void Summary::saveReport() {
|
|||||||
char timeNow[80];
|
char timeNow[80];
|
||||||
|
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
// cpplint require to use localtime_r instead which is not available in C++14
|
// cpplint require to use localtime_r instead which is not available in C++11
|
||||||
timeinfo = localtime(&rawtime); // NOLINT
|
timeinfo = localtime(&rawtime); // NOLINT
|
||||||
|
|
||||||
strftime(timeNow, sizeof(timeNow), "%d-%m-%Y %H:%M:%S", timeinfo);
|
strftime(timeNow, sizeof(timeNow), "%d-%m-%Y %H:%M:%S", timeinfo);
|
||||||
@ -188,16 +199,16 @@ void Summary::saveReport() {
|
|||||||
|
|
||||||
pugi::xml_node opsNode = root.append_child("ops_list");
|
pugi::xml_node opsNode = root.append_child("ops_list");
|
||||||
for (const auto &op : opsInfo) {
|
for (const auto &op : opsInfo) {
|
||||||
std::string name = std::string(op.name) + "-" + std::to_string(op.version);
|
std::string name = std::string(op.name) + "-" + getOpVersion(op);
|
||||||
pugi::xml_node entry = opsNode.append_child(name.c_str());
|
pugi::xml_node entry = opsNode.append_child(name.c_str());
|
||||||
(void)entry;
|
(void) entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
pugi::xml_node resultsNode = root.child("results");
|
pugi::xml_node resultsNode = root.child("results");
|
||||||
pugi::xml_node currentDeviceNode = resultsNode.append_child(summary.deviceName.c_str());
|
pugi::xml_node currentDeviceNode = resultsNode.append_child(summary.deviceName.c_str());
|
||||||
std::unordered_set<std::string> opList;
|
std::unordered_set<std::string> opList;
|
||||||
for (const auto &it : stats) {
|
for (const auto &it : stats) {
|
||||||
std::string name = std::string(it.first.name) + "-" + std::to_string(it.first.version);
|
std::string name = std::string(it.first.name) + "-" + getOpVersion(it.first);
|
||||||
opList.insert(name);
|
opList.insert(name);
|
||||||
pugi::xml_node entry = currentDeviceNode.append_child(name.c_str());
|
pugi::xml_node entry = currentDeviceNode.append_child(name.c_str());
|
||||||
entry.append_attribute("passed").set_value(it.second.passed);
|
entry.append_attribute("passed").set_value(it.second.passed);
|
||||||
@ -209,7 +220,7 @@ void Summary::saveReport() {
|
|||||||
|
|
||||||
if (extendReport && file) {
|
if (extendReport && file) {
|
||||||
auto opStataFromReport = summary.getOpStatisticFromReport();
|
auto opStataFromReport = summary.getOpStatisticFromReport();
|
||||||
for (auto& item : opStataFromReport) {
|
for (auto &item : opStataFromReport) {
|
||||||
pugi::xml_node entry;
|
pugi::xml_node entry;
|
||||||
if (opList.find(item.first) == opList.end()) {
|
if (opList.find(item.first) == opList.end()) {
|
||||||
entry = currentDeviceNode.append_child(item.first.c_str());
|
entry = currentDeviceNode.append_child(item.first.c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user