[IE][VPU]: support new operation CEILING (#3004)

Add new Operation "Ceiling" for VPU Myriad
task: -42885
This commit is contained in:
Andrey Sokolov 2020-11-10 19:28:53 +03:00 committed by GitHub
parent b437387bd5
commit 634109acfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 1 deletions

View File

@ -19,7 +19,7 @@ set(VPU_SUPPORTED_FIRMWARES usb-ma2x8x pcie-ma248x)
# Default packages
#
set(FIRMWARE_PACKAGE_VERSION 1452)
set(FIRMWARE_PACKAGE_VERSION 1460)
set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.2")
#

View File

@ -159,6 +159,7 @@ public:
void parseLogicalNot(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
void parseGatherND(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
void parseHSwish(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
void parseCeiling(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const;
//
// Special layers

View File

@ -173,6 +173,7 @@ VPU_DECLARE_ENUM(StageType,
Swish = 135,
GatherND = 136,
HSwish = 137,
Ceiling = 138,
)
//

View File

@ -132,6 +132,7 @@ FrontEnd::FrontEnd(StageBuilder::Ptr stageBuilder, const ie::ICore* core)
{"Activation", LAYER_PARSER(parseActivation)},
{"GatherND", LAYER_PARSER(parseGatherND)},
{"HSwish", LAYER_PARSER(parseHSwish)},
{"Ceiling", LAYER_PARSER(parseCeiling)},
}} {
VPU_THROW_UNLESS(_core != nullptr, "Argument core is null");
}

View File

@ -0,0 +1,43 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <vpu/frontend/frontend.hpp>
#include <vpu/stages/post_op_stage.hpp>
#include <vector>
#include <memory>
#include <set>
namespace vpu {
namespace {
class CeilingStage final : public PostOpStage {
public:
using PostOpStage::PostOpStage;
private:
StagePtr cloneImpl() const override {
return std::make_shared<CeilingStage>(*this);
}
void serializeParamsImpl(BlobSerializer&) const override {
}
};
} // namespace
void FrontEnd::parseCeiling(const Model& model, const ie::CNNLayerPtr& layer, const DataVector& inputs, const DataVector& outputs) const {
VPU_THROW_UNLESS(inputs.size() == 1,
"Ceiling stage with name {} must have only 1 input, actually provided {} inputs",
layer->name, inputs.size());
VPU_THROW_UNLESS(outputs.size() == 1,
"Ceiling stage with name {} must have only 1 output, actually provided {} outputs",
layer->name, outputs.size());
model->addNewStage<CeilingStage>(layer->name, StageType::Ceiling, layer, inputs, outputs);
}
} // namespace vpu

View File

@ -26,6 +26,7 @@ const std::map<ActivationTypes, std::vector<std::vector<float>>> activationTypes
{SoftPlus, {}},
{Swish, {{0.05f}, {0.8f}, {1.0f}, {15.0f}}},
{HSwish, {}},
{Ceiling, {}},
};
std::map<std::vector<size_t>, std::vector<std::vector<size_t>>> basic = {

View File

@ -84,6 +84,11 @@ InferenceEngine::Blob::Ptr ActivationLayerTest::GenerateInput(const InferenceEng
data_range = 2;
break;
}
case ngraph::helpers::ActivationTypes::Ceiling: {
data_start_from = -1000;
data_range = 2000;
break;
}
default: {
data_start_from = -10;
data_range = 20;