CPU plugin namespaces and files renaming (#10248)

This commit is contained in:
Vladislav Volkov
2022-02-17 23:48:26 +03:00
committed by GitHub
parent 7fa9d07a1f
commit b6a75d7d91
329 changed files with 1820 additions and 1444 deletions

View File

@@ -220,17 +220,17 @@ Typical transformation pipeline described below.
### Step 1. Common optimizations
This step is optional for LPT but typically is presented in OpenVINO™ plugins. The step doesn't use any LPT transformation. Firstly, the step disables dequantization operations constant folding on constant subgraph on weights to prevent the lost of dequantization info on the next plugin transformations. After that, it optimizes nGraph function and convert operations to operation set 1. Typically, usage of this step is the simplest way to meet LPT requirements for the input quantized model. If plugin can guarantee that LPT input requirements are met, then this step can be skipped.
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_common
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_common
### Step 2. Low precision transformations execution
This step is mandatory. It configures and runs LPT transformations.
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_execution
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_execution
### Step 3. Plugin-specific transformations
This step is optional. It modifies the nGraph function to a device-specific operation set.
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_device
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_device
## Result model overview
@@ -298,14 +298,14 @@ Low Precision Transformations can be customizable. Build-in customization option
### Operation precision restrictions
This option defines precisions which allowed for the operation input ports. The option value is passed as input argument for `LowPrecision` constructor. For example:
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_supported_precisions
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_supported_precisions
In provided example in result model `Convolution` operation inputs must have specific precisions: `u8` (unsigned int8) precision on input 0 (on activations) and `i8` (signed int8) precision on input 1 (on weights).
### Operation per tensor quantization restrictions
This option defines if operation supports per-tensor quantization only. The option value is passed as input argument for `LowPrecision` constructor. For example:
@snippet snippets/lpt_mkldnn_plugin.cpp per_tensor_quantization
@snippet snippets/lpt_intel_cpu_plugin.cpp per_tensor_quantization
In provided example in result model `Convolution` operations must have per-tensor quantization on input 0 (on activations).
@@ -316,4 +316,4 @@ This option defines if each LPT transformation updates precision or not. The opt
Plugin specific customization can be implemented via nGraph transformation callbacks. For example: asymmetric quantization support can be easily customizable via `LayerTransformation::isAsymmetricQuantization` and `WeightableLayerTransformation::isAsymmetricOnWeights` methods usage in callbacks. For example:
@snippet snippets/lpt_mkldnn_plugin.cpp asymmetric_quantization
@snippet snippets/lpt_intel_cpu_plugin.cpp asymmetric_quantization

View File

@@ -44,7 +44,7 @@ The original model key features:
Transformations are run with the following parameters:
@snippet snippets/lpt_mkldnn_plugin.cpp lpt_markup_pipeline
@snippet snippets/lpt_intel_cpu_plugin.cpp lpt_markup_pipeline
## 1. MarkupCanBeQuantized
The transformation marks operations that cannot be quantized. No attributes are required before the transformation.

View File

@@ -214,7 +214,7 @@ onnx_size_op_single
onnx_size_op_graph_end
onnx_size_op_graph_middle
# /openvino/src/plugins/intel_cpu/mkldnn_graph.cpp:747
# /openvino/src/plugins/intel_cpu/graph.cpp:747
# Output blob byte size is not equal network output byte size (64!=216)." thrown in the test body.
onnx_model_quant_conv_linear_3d

View File

@@ -20,7 +20,7 @@ file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h
${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp)
addVersionDefines(${CMAKE_CURRENT_SOURCE_DIR}/src/mkldnn_plugin.cpp CI_BUILD_NUMBER)
addVersionDefines(${CMAKE_CURRENT_SOURCE_DIR}/src/plugin.cpp CI_BUILD_NUMBER)
add_subdirectory(thirdparty)

View File

@@ -2,16 +2,16 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_async_infer_request.h"
#include "async_infer_request.h"
#include <memory>
MKLDNNPlugin::MKLDNNAsyncInferRequest::MKLDNNAsyncInferRequest(const InferenceEngine::IInferRequestInternal::Ptr& inferRequest,
ov::intel_cpu::MKLDNNAsyncInferRequest::MKLDNNAsyncInferRequest(const InferenceEngine::IInferRequestInternal::Ptr& inferRequest,
const InferenceEngine::ITaskExecutor::Ptr& taskExecutor,
const InferenceEngine::ITaskExecutor::Ptr& callbackExecutor)
: InferenceEngine::AsyncInferRequestThreadSafeDefault(inferRequest, taskExecutor, callbackExecutor) {
static_cast<MKLDNNInferRequestBase*>(inferRequest.get())->SetAsyncRequest(this);
}
MKLDNNPlugin::MKLDNNAsyncInferRequest::~MKLDNNAsyncInferRequest() {
ov::intel_cpu::MKLDNNAsyncInferRequest::~MKLDNNAsyncInferRequest() {
StopAndWait();
}

View File

@@ -7,9 +7,10 @@
#include <string>
#include <map>
#include <cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp>
#include "mkldnn_infer_request.h"
#include "infer_request.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNAsyncInferRequest : public InferenceEngine::AsyncInferRequestThreadSafeDefault {
public:
@@ -19,4 +20,6 @@ public:
~MKLDNNAsyncInferRequest();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -8,7 +8,8 @@
#include <functional>
#include "lru_cache.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class CacheEntryBase {
public:
@@ -68,4 +69,6 @@ public:
public:
ImplType _impl;
};
}// namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -15,7 +15,8 @@
* @attention This cache implementation IS NOT THREAD SAFE!
*/
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
template<typename Key, typename Value>
class LruCache {
@@ -103,4 +104,5 @@ private:
size_t _capacity;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,6 +4,6 @@
#include "multi_cache.h"
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
std::atomic_size_t MultiCache::_typeIdCounter{0};

View File

@@ -9,7 +9,8 @@
#include <atomic>
#include "cache_entry.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
/**
* @brief Class that represent a preemptive cache for different key/value pair types.
@@ -81,4 +82,5 @@ MultiCache::EntryPtr<KeyType, ValueType> MultiCache::getEntry() {
using MultiCachePtr = std::shared_ptr<MultiCache>;
using MultiCacheCPtr = std::shared_ptr<const MultiCache>;
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -18,7 +18,8 @@
#include "openvino/runtime/properties.hpp"
#include <cpu/x64/cpu_isa_traits.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
using namespace InferenceEngine;
@@ -260,4 +261,6 @@ void Config::readDebugCapsProperties() {
}
#endif // CPU_DEBUG_CAPS
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -11,7 +11,8 @@
#include <string>
#include <map>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
struct Config {
Config();
@@ -71,4 +72,5 @@ struct Config {
bool isNewApi = true;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -9,19 +9,20 @@
#include <mkldnn_types.h>
#include <dnnl_types.h>
#include <common/memory_desc_wrapper.hpp>
#include "mkldnn_memory.h"
#include "cpu_memory.h"
#include "nodes/common/cpu_memcpy.h"
#include "nodes/common/cpu_convert.h"
#include "mkldnn/ie_mkldnn.h"
#include "cpu_shape.h"
#include "memory_desc/dnnl_blocked_memory_desc.h"
#include "nodes/mkldnn_reorder_node.h"
#include "nodes/reorder.h"
#include "memory_desc/cpu_memory_desc.h"
using namespace InferenceEngine;
using namespace mkldnn;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
namespace {
inline void setSubnormalsToZero(float *data, size_t size) {
uint32_t *u32data = reinterpret_cast<uint32_t *>(data);
@@ -239,4 +240,5 @@ void DnnlMemoryMngr::notifyUpdate() {
}
}
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,7 +6,7 @@
#include "ie_layouts.h"
#include "memory_desc/cpu_memory_desc.h"
#include "mkldnn_extension_utils.h"
#include "extension_utils.h"
#include "memory_desc/cpu_memory_desc_utils.h"
#include <mkldnn.hpp>
#include <mkldnn_types.h>
@@ -29,7 +29,8 @@
*
*/
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNMemory;
@@ -268,4 +269,5 @@ private:
using MKLDNNMemoryPtr = std::shared_ptr<MKLDNNMemory>;
using MKLDNNMemoryCPtr = std::shared_ptr<const MKLDNNMemory>;
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,7 +6,7 @@
#include "utils/general_utils.h"
#include "memory_desc/cpu_memory_desc_utils.h"
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
bool Shape::isCompatible(const VectorDims &vecDims) const {
if (getRank() != vecDims.size()) {

View File

@@ -11,7 +11,8 @@
#include <ngraph/partial_shape.hpp>
#include "cpu_types.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class Shape {
public:
@@ -215,4 +216,6 @@ private:
VectorDims maxDims;
VectorDims dims;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,7 +6,8 @@
#include <vector>
#include <string>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
using Dim = std::size_t;
using VectorDims = std::vector<Dim>;
@@ -486,4 +487,6 @@ std::string algToString(const Algorithm alg) {
return "Undefined";
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -9,7 +9,8 @@
#include <vector>
#include <string>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
using Dim = std::size_t;
using VectorDims = std::vector<Dim>;
@@ -240,4 +241,6 @@ Type TypeFromName(const std::string& type);
std::string NameFromType(const Type type);
std::string algToString(const Algorithm alg);
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,7 +4,7 @@
#include <ie_common.h>
#include "mkldnn_descriptor.h"
#include "descriptor.h"
mkldnn::primitive_desc_iterator MKLDNNDescriptor::createPrimitiveDescriptorIterator(const mkldnn::engine &engine,
const mkldnn::primitive_attr &attr) const {

View File

@@ -66,7 +66,7 @@ Example:
OV_CPU_BLOB_DUMP_NODE_TYPE='Convolution Reorder' binary ...
```
> **NOTE**: see **enum Type** in [mkldnn_node.h](../mkldnn_node.h) for list of the types
> **NOTE**: see **enum Type** in [node.h](../node.h) for list of the types
## Filter by name
To dump blobs only for nodes with name matching specified regex:

View File

@@ -2,14 +2,15 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_edge.h"
#include "mkldnn_node.h"
#include "mkldnn_extension_utils.h"
#include "edge.h"
#include "node.h"
#include "extension_utils.h"
#include <blob_factory.hpp>
#include <nodes/mkldnn_input_node.h>
#include "nodes/input.h"
using namespace mkldnn;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
MKLDNNEdge::MKLDNNEdge(const MKLDNNNodePtr &parent, const MKLDNNNodePtr &child, int pr_port, int ch_port) :
parent(parent), child(child), parent_port(pr_port), child_port(ch_port) {}
@@ -552,4 +553,5 @@ bool MKLDNNEdge::inPlace(LOOK look) {
return false;
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -8,13 +8,14 @@
#include "cpu_shape.h"
#include "memory_desc/cpu_memory_desc.h"
#include "nodes/node_config.h"
#include "mkldnn_weights_cache.hpp"
#include "weights_cache.hpp"
#include <map>
#include <memory>
#include <vector>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNNode;
class MKLDNNEdge;
@@ -106,4 +107,6 @@ private:
friend class MKLDNNGraph;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -33,7 +33,7 @@ public:
}
};
MKLDNNPlugin::CPUTargetMachine::CPUTargetMachine(dnnl::impl::cpu::x64::cpu_isa_t host_isa)
ov::intel_cpu::CPUTargetMachine::CPUTargetMachine(dnnl::impl::cpu::x64::cpu_isa_t host_isa)
: TargetMachine(), h(new jit_snippet()), isa(host_isa) {
// data movement
jitters[ngraph::opset1::Parameter::get_type_info_static()] = CREATE_EMITTER(NopEmitter);
@@ -59,65 +59,65 @@ MKLDNNPlugin::CPUTargetMachine::CPUTargetMachine(dnnl::impl::cpu::x64::cpu_isa_t
// jitters[ngraph::opset1::FakeQuantize::get_type_info_static()] = CREATE_EMITTER(); // not supported
// binary
jitters[ngraph::opset1::Add::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_add_emitter);
jitters[ngraph::opset1::Divide::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_divide_emitter);
jitters[ngraph::opset1::Equal::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_equal_emitter);
jitters[ngraph::opset1::FloorMod::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_floor_mod_emitter);
jitters[ngraph::opset1::Greater::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_greater_emitter);
jitters[ngraph::opset1::GreaterEqual::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_greater_equal_emitter);
jitters[ngraph::opset1::Less::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_less_emitter);
jitters[ngraph::opset1::LessEqual::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_less_equal_emitter);
jitters[ngraph::opset1::LogicalAnd::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_logical_and_emitter);
jitters[ngraph::opset1::LogicalOr::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_logical_or_emitter);
jitters[ngraph::opset1::LogicalXor::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_logical_xor_emitter);
jitters[ngraph::opset1::Maximum::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_maximum_emitter);
jitters[ngraph::opset1::Minimum::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_minimum_emitter);
jitters[ngraph::opset1::Mod::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_mod_emitter);
jitters[ngraph::opset1::Multiply::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_multiply_emitter);
jitters[ngraph::opset1::NotEqual::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_not_equal_emitter);
jitters[ngraph::snippets::op::PowerStatic::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_power_static_emitter);
jitters[ngraph::opset1::Power::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_power_dynamic_emitter);
jitters[ngraph::opset1::PRelu::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_prelu_emitter);
jitters[ngraph::opset1::SquaredDifference::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_squared_difference_emitter);
jitters[ngraph::opset1::Subtract::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_subtract_emitter);
jitters[ngraph::opset1::Xor::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_logical_xor_emitter);
jitters[ngraph::opset1::Add::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_add_emitter);
jitters[ngraph::opset1::Divide::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_divide_emitter);
jitters[ngraph::opset1::Equal::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_equal_emitter);
jitters[ngraph::opset1::FloorMod::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_floor_mod_emitter);
jitters[ngraph::opset1::Greater::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_greater_emitter);
jitters[ngraph::opset1::GreaterEqual::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_greater_equal_emitter);
jitters[ngraph::opset1::Less::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_less_emitter);
jitters[ngraph::opset1::LessEqual::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_less_equal_emitter);
jitters[ngraph::opset1::LogicalAnd::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_logical_and_emitter);
jitters[ngraph::opset1::LogicalOr::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_logical_or_emitter);
jitters[ngraph::opset1::LogicalXor::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_logical_xor_emitter);
jitters[ngraph::opset1::Maximum::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_maximum_emitter);
jitters[ngraph::opset1::Minimum::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_minimum_emitter);
jitters[ngraph::opset1::Mod::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_mod_emitter);
jitters[ngraph::opset1::Multiply::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_multiply_emitter);
jitters[ngraph::opset1::NotEqual::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_not_equal_emitter);
jitters[ngraph::snippets::op::PowerStatic::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_power_static_emitter);
jitters[ngraph::opset1::Power::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_power_dynamic_emitter);
jitters[ngraph::opset1::PRelu::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_prelu_emitter);
jitters[ngraph::opset1::SquaredDifference::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_squared_difference_emitter);
jitters[ngraph::opset1::Subtract::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_subtract_emitter);
jitters[ngraph::opset1::Xor::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_logical_xor_emitter);
// unary
jitters[ngraph::opset1::Abs::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_abs_emitter);
jitters[ngraph::opset1::Abs::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_abs_emitter);
// jitters[ngraph::opset1::Acos::get_type_info_static()] = CREATE_EMITTER(); // not supported
// jitters[ngraph::opset1::Asin::get_type_info_static()] = CREATE_EMITTER(); // not supported
// jitters[ngraph::opset1::Atan::get_type_info_static()] = CREATE_EMITTER(); // not supported
// jitters[ngraph::opset1::Ceiling::get_type_info_static()] = CREATE_EMITTER(); // not supported
jitters[ngraph::opset1::Clamp::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_clamp_emitter);
jitters[ngraph::opset1::Clamp::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_clamp_emitter);
// jitters[ngraph::opset1::Cos::get_type_info_static()] = CREATE_EMITTER(); // not supported
// jitters[ngraph::opset1::Cosh::get_type_info_static()] = CREATE_EMITTER(); // not supported
jitters[ngraph::opset1::Elu::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_elu_emitter);
jitters[ngraph::opset1::Erf::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_erf_emitter);
jitters[ngraph::opset1::Exp::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_exp_emitter);
jitters[ngraph::opset1::Elu::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_elu_emitter);
jitters[ngraph::opset1::Erf::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_erf_emitter);
jitters[ngraph::opset1::Exp::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_exp_emitter);
// jitters[ngraph::opset1::Floor::get_type_info_static()] = CREATE_EMITTER(); // not supported
// jitters[ngraph::opset1::Log::get_type_info_static()] = CREATE_EMITTER(); // not supported
jitters[ngraph::opset1::LogicalNot::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_logical_not_emitter);
jitters[ngraph::opset1::Negative::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_negative_emitter);
jitters[ngraph::opset1::Relu::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_relu_emitter);
jitters[ngraph::opset1::LogicalNot::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_logical_not_emitter);
jitters[ngraph::opset1::Negative::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_negative_emitter);
jitters[ngraph::opset1::Relu::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_relu_emitter);
// jitters[ngraph::opset1::Sign::get_type_info_static()] = CREATE_EMITTER(); // not supported
jitters[ngraph::opset1::Sigmoid::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_sigmoid_emitter);
jitters[ngraph::opset1::Sigmoid::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_sigmoid_emitter);
// jitters[ngraph::opset1::Sin::get_type_info_static()] = CREATE_EMITTER(); // not supported
// jitters[ngraph::opset1::Sinh::get_type_info_static()] = CREATE_EMITTER(); // not supported
jitters[ngraph::opset1::Sqrt::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_sqrt_emitter);
jitters[ngraph::opset1::Sqrt::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_sqrt_emitter);
// jitters[ngraph::opset1::Tan::get_type_info_static()] = CREATE_EMITTER(); // not supported
jitters[ngraph::opset1::Tanh::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_tanh_emitter);
jitters[ngraph::opset1::Tanh::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_tanh_emitter);
jitters[ngraph::op::v4::HSwish::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_hswish_emitter);
jitters[ngraph::op::v4::HSwish::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_hswish_emitter);
// jitters[ngraph::opset1::HardSigmoid::get_type_info_static()] = CREATE_EMITTER(); // not supported
// jitters[ngraph::opset1::Selu::get_type_info_static()] = CREATE_EMITTER(); // not supported
jitters[ngraph::op::v0::Gelu::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_gelu_v0_emitter);
jitters[ngraph::op::v7::Gelu::get_type_info_static()] = CREATE_EMITTER(MKLDNNPlugin::jit_gelu_v7_emitter);
jitters[ngraph::op::v0::Gelu::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_gelu_v0_emitter);
jitters[ngraph::op::v7::Gelu::get_type_info_static()] = CREATE_EMITTER(ov::intel_cpu::jit_gelu_v7_emitter);
jitters[ngraph::snippets::op::Kernel::get_type_info_static()] = CREATE_EMITTER(KernelEmitter);
jitters[ngraph::snippets::op::Tile::get_type_info_static()] = CREATE_EMITTER(TileEmitter);
}
size_t MKLDNNPlugin::CPUTargetMachine::get_lanes() const {
size_t ov::intel_cpu::CPUTargetMachine::get_lanes() const {
switch (isa) {
case dnnl::impl::cpu::x64::avx2 : return dnnl::impl::cpu::x64::cpu_isa_traits<dnnl::impl::cpu::x64::avx2>::vlen / sizeof(float);
case dnnl::impl::cpu::x64::sse41 : return dnnl::impl::cpu::x64::cpu_isa_traits<dnnl::impl::cpu::x64::sse41>::vlen / sizeof(float);
@@ -126,14 +126,14 @@ size_t MKLDNNPlugin::CPUTargetMachine::get_lanes() const {
}
}
bool MKLDNNPlugin::CPUTargetMachine::is_supported() const {
bool ov::intel_cpu::CPUTargetMachine::is_supported() const {
return dnnl::impl::cpu::x64::mayiuse(isa);
}
code MKLDNNPlugin::CPUTargetMachine::get_snippet() const {
code ov::intel_cpu::CPUTargetMachine::get_snippet() const {
h->create_kernel();
return h->jit_ker();
}
MKLDNNPlugin::CPUGenerator::CPUGenerator(dnnl::impl::cpu::x64::cpu_isa_t isa_) : Generator(std::make_shared<CPUTargetMachine>(isa_)) {
ov::intel_cpu::CPUGenerator::CPUGenerator(dnnl::impl::cpu::x64::cpu_isa_t isa_) : Generator(std::make_shared<CPUTargetMachine>(isa_)) {
}

View File

@@ -9,7 +9,8 @@
#include "snippets/generator.hpp"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class CPUTargetMachine : public ngraph::snippets::TargetMachine {
public:
@@ -30,4 +31,5 @@ public:
~CPUGenerator() = default;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,7 +6,8 @@
#include "jit_emitter.hpp"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class jit_emu_vcvtneps2bf16 : public jit_emitter {
public:
@@ -71,4 +72,5 @@ private:
size_t aux_vecs_count() const override { return 2; }
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -5,7 +5,7 @@
#include "jit_eltwise_emitters.hpp"
#include <cpu/x64/jit_uni_eltwise.hpp>
#include <ngraph/opsets/opset1.hpp>
#include <nodes/mkldnn_eltwise_node.h>
#include <nodes/eltwise.h>
using namespace InferenceEngine;
using namespace mkldnn::impl::utils;
@@ -13,7 +13,8 @@ using namespace mkldnn::impl;
using namespace mkldnn::impl::cpu::x64;
using namespace Xbyak;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
/// ADD ///
jit_add_emitter::jit_add_emitter(jit_generator *host, cpu_isa_t host_isa, const std::shared_ptr<ngraph::Node>& node, Precision exec_prc)
@@ -1776,4 +1777,5 @@ size_t jit_erf_emitter::aux_vecs_count() const {
return 5ul;
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,9 +6,9 @@
#include <cpu/x64/jit_generator.hpp>
#include "jit_emitter.hpp"
#include "mkldnn_node.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class jit_add_emitter : public jit_emitter {
public:
@@ -520,7 +520,7 @@ public:
private:
void emit_impl(const std::vector<size_t>& in, const std::vector<size_t>& out,
const std::vector<size_t>& pool, const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override;
const ov::intel_cpu::emitter_context *emit_context) const override;
template <mkldnn::impl::cpu::x64::cpu_isa_t isa>
void emit_isa(const std::vector<size_t> &in_vec_idxs, const std::vector<size_t> &out_vec_idxs) const;
@@ -551,4 +551,5 @@ private:
size_t aux_vecs_count() const override;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -10,7 +10,8 @@ using namespace mkldnn::impl::cpu;
using namespace mkldnn::impl;
using namespace Xbyak;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
size_t jit_emitter::get_max_vecs_count() const {
return one_of(host_isa_, cpu::x64::avx512_common, cpu::x64::avx512_core) ? 32 : 16;
@@ -218,4 +219,5 @@ void jit_emitter::emit_code(const std::vector<size_t> &in_idxs, const std::vecto
emitter_postamble();
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -9,11 +9,12 @@
#include "snippets/snippets_isa.hpp"
#include "snippets/generator.hpp"
#include "mkldnn_node.h"
#include <node.h>
#include <set>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
enum emitter_in_out_map {
vec_to_vec,
@@ -153,4 +154,5 @@ private:
const std::vector<size_t>&, const std::vector<size_t> &) const {}
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -15,7 +15,8 @@ using namespace mkldnn::impl::cpu::x64;
using namespace Xbyak;
using namespace Xbyak::util;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
/// LOAD ///
jit_load_emitter::jit_load_emitter(jit_generator *host, cpu_isa_t host_isa,
@@ -35,7 +36,7 @@ size_t jit_load_emitter::aux_gprs_count() const {
void jit_load_emitter::emit_impl(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs,
const std::vector<size_t> &pool_vec_idxs, const std::vector<size_t> &pool_gpr_idxs,
const emitter_context *emit_context) const {
const auto* load_emitter_context = dynamic_cast<const MKLDNNPlugin::load_emitter_context*>(emit_context);
const auto* load_emitter_context = dynamic_cast<const ov::intel_cpu::load_emitter_context*>(emit_context);
if (load_emitter_context == nullptr) {
IE_THROW() << "Load emitter in " << name << " does not get load emmiter context.";
}
@@ -515,7 +516,7 @@ void jit_store_emitter::emit_data() const {
void jit_store_emitter::emit_impl(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs,
const std::vector<size_t> &pool_vec_idxs, const std::vector<size_t> &pool_gpr_idxs,
const emitter_context *emit_context) const {
const auto* store_emitter_context = dynamic_cast<const MKLDNNPlugin::store_emitter_context*>(emit_context);
const auto* store_emitter_context = dynamic_cast<const ov::intel_cpu::store_emitter_context*>(emit_context);
if (store_emitter_context == nullptr) {
IE_THROW() << "Store emitter in " << name << " does not get store emmiter context.";
}
@@ -886,4 +887,5 @@ template <typename Vmm>
}
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,14 +6,15 @@
#include "jit_emitter.hpp"
#include <cpu/x64/jit_generator.hpp>
#include "mkldnn_node.h"
#include "jit_bf16_emitters.hpp"
using namespace mkldnn::impl;
using namespace mkldnn::impl::cpu::x64;
using namespace InferenceEngine;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
struct load_emitter_context : public emitter_context {
load_emitter_context() : src_prc_(Precision::FP32), dst_prc_(Precision::FP32), load_num_(8),
offset_byte_(0), is_fill_(false), fill_value_("zero") {}
@@ -152,4 +153,5 @@ private:
std::shared_ptr<jit_emu_vcvtneps2bf16> emu_vcvtneps2bf16;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -3,14 +3,15 @@
//
#include "jit_mkldnn_emitters.hpp"
#include "nodes/mkldnn_eltwise_node.h"
#include <nodes/eltwise.h>
using namespace mkldnn::impl::utils;
using namespace mkldnn::impl;
using namespace mkldnn::impl::cpu::x64;
using namespace Xbyak;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
jit_mkldnn_emitter::jit_mkldnn_emitter(jit_generator *host, cpu_isa_t host_isa, const std::shared_ptr<ngraph::Node>& node, InferenceEngine::Precision exec_prc)
: jit_emitter(host, host_isa, node, exec_prc) {
@@ -84,4 +85,5 @@ jit_mkldnn_aux_emitter::jit_mkldnn_aux_emitter(jit_generator *host, cpu_isa_t ho
: jit_mkldnn_emitter(host, host_isa, algKind, inpAlpha, inpBeta, exec_prc) {
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -7,11 +7,9 @@
#include <cpu/x64/jit_generator.hpp>
#include <cpu/x64/injectors/jit_uni_eltwise_injector.hpp>
#include "jit_emitter.hpp"
#include "mkldnn_node.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class jit_mkldnn_emitter : public jit_emitter {
public:
@@ -53,4 +51,5 @@ public:
private:
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,7 +6,8 @@
#include "jit_mkldnn_emitters.hpp"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class jit_relu_emitter : public jit_mkldnn_emitter {
public:
@@ -141,4 +142,5 @@ public:
}
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -8,8 +8,11 @@
#include <ngraph/variant.hpp>
#include "jit_emitter.hpp"
using namespace Xbyak;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
#define SNIPPETS_MAX_SNIPPETS_DIMS 7
#define SNIPPETS_MAX_HARNESS_DIMS 5
@@ -94,7 +97,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
const size_t num_inputs = in[0];
const size_t num_outputs = in[1];
const size_t num_params = num_inputs + num_outputs;
@@ -195,7 +198,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
const size_t inc = in[0];
const size_t previous_inc = in[1]; // increment of a previous tile in the same dim (0 if the first tile in the dim)
const size_t num_params = in[2];
@@ -304,7 +307,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
}
};
@@ -326,7 +329,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
if (host_isa_ == dnnl::impl::cpu::x64::sse41) {
emit_isa<dnnl::impl::cpu::x64::sse41>(in, out);
} else if (host_isa_ == dnnl::impl::cpu::x64::avx2) {
@@ -376,7 +379,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
if (host_isa_ == dnnl::impl::cpu::x64::sse41) {
emit_isa<dnnl::impl::cpu::x64::sse41>(in, out);
} else if (host_isa_ == dnnl::impl::cpu::x64::avx2) {
@@ -447,7 +450,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
if (host_isa_ == dnnl::impl::cpu::x64::sse41) {
emit_isa<dnnl::impl::cpu::x64::sse41>(in, out);
} else if (host_isa_ == dnnl::impl::cpu::x64::avx2) {
@@ -484,7 +487,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
if (host_isa_ == dnnl::impl::cpu::x64::sse41) {
emit_isa<dnnl::impl::cpu::x64::sse41>(in, out);
} else if (host_isa_ == dnnl::impl::cpu::x64::avx2) {
@@ -521,7 +524,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
if (host_isa_ == dnnl::impl::cpu::x64::sse41) {
emit_isa<dnnl::impl::cpu::x64::sse41>(in, out);
} else if (host_isa_ == dnnl::impl::cpu::x64::avx2) {
@@ -563,7 +566,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
if (host_isa_ == dnnl::impl::cpu::x64::sse41) {
emit_isa<dnnl::impl::cpu::x64::sse41>(in, out);
} else if (host_isa_ == dnnl::impl::cpu::x64::avx2) {
@@ -601,7 +604,7 @@ private:
const std::vector<size_t>& out,
const std::vector<size_t>& pool,
const std::vector<size_t>& gpr,
const MKLDNNPlugin::emitter_context *emit_context) const override {
const ov::intel_cpu::emitter_context *emit_context) const override {
if (host_isa_ == dnnl::impl::cpu::x64::sse41) {
emit_isa<dnnl::impl::cpu::x64::sse41>(in, out);
} else if (host_isa_ == dnnl::impl::cpu::x64::avx2) {
@@ -632,4 +635,5 @@ private:
bool shouldPostIncrement;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,15 +4,15 @@
#include <ie_metric_helpers.hpp>
#include <precision_utils.h>
#include "mkldnn_exec_network.h"
#include "exec_network.h"
#include "mkldnn_async_infer_request.h"
#include "mkldnn_infer_request.h"
#include "mkldnn_memory_state.h"
#include "mkldnn_itt.h"
#include "mkldnn_serialize.h"
#include "async_infer_request.h"
#include "infer_request.h"
#include "memory_state.h"
#include "itt.h"
#include "serialize.h"
#include "ngraph/type/element_type.hpp"
#include "nodes/mkldnn_memory_node.hpp"
#include "nodes/memory.hpp"
#include <threading/ie_executor_manager.hpp>
#define FIX_62820 0
#if FIX_62820 && ((IE_THREAD == IE_THREAD_TBB) || (IE_THREAD == IE_THREAD_TBB_AUTO))
@@ -32,7 +32,7 @@
#include <utility>
#include <cstring>
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
using namespace InferenceEngine;
using namespace InferenceEngine::details;

View File

@@ -7,8 +7,8 @@
#include <cpp_interfaces/impl/ie_executable_network_thread_safe_default.hpp>
#include <cpp_interfaces/impl/ie_executable_network_thread_safe_default.hpp>
#include "mkldnn_graph.h"
#include "mkldnn_extension_mngr.h"
#include "graph.h"
#include "extension_mngr.h"
#include <threading/ie_thread_local.hpp>
#include <vector>
@@ -17,7 +17,8 @@
#include <string>
#include <unordered_map>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNExecNetwork: public InferenceEngine::ExecutableNetworkThreadSafeDefault {
public:
@@ -84,4 +85,6 @@ protected:
InferenceEngine::Parameter GetMetricLegacy(const std::string &name, const Graph& graph) const;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_extension.h"
#include "extension.h"
#include "ngraph_transformations/op/fully_connected.hpp"
#include "ngraph_transformations/op/leaky_relu.hpp"
#include "ngraph_transformations/op/power_static.hpp"
@@ -15,7 +15,8 @@
#include <mutex>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
void MKLDNNExtension::GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept {
static const InferenceEngine::Version version = {
@@ -34,10 +35,10 @@ std::map<std::string, ngraph::OpSet> MKLDNNExtension::getOpSets() {
ngraph::OpSet opset;
#define NGRAPH_OP(NAME, NAMESPACE) opset.insert<NAMESPACE::NAME>();
NGRAPH_OP(FullyConnectedNode, MKLDNNPlugin)
NGRAPH_OP(LeakyReluNode, MKLDNNPlugin)
NGRAPH_OP(PowerStaticNode, MKLDNNPlugin)
NGRAPH_OP(SwishNode, MKLDNNPlugin)
NGRAPH_OP(FullyConnectedNode, ov::intel_cpu)
NGRAPH_OP(LeakyReluNode, ov::intel_cpu)
NGRAPH_OP(PowerStaticNode, ov::intel_cpu)
NGRAPH_OP(SwishNode, ov::intel_cpu)
#undef NGRAPH_OP
return opset;
@@ -126,7 +127,8 @@ InferenceEngine::ILayerImpl::Ptr MKLDNNExtension::getImplementation(const std::s
return nullptr;
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov
// Generate exported function
IE_DEFINE_EXTENSION_CREATE_FUNCTION(MKLDNNPlugin::MKLDNNExtension)
IE_DEFINE_EXTENSION_CREATE_FUNCTION(ov::intel_cpu::MKLDNNExtension)

View File

@@ -6,7 +6,8 @@
#include <ie_iextension.h>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNExtension : public InferenceEngine::IExtension {
public:
@@ -17,4 +18,5 @@ public:
InferenceEngine::ILayerImpl::Ptr getImplementation(const std::shared_ptr<ngraph::Node>& node, const std::string& implType) override;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,9 +6,9 @@
#include <string>
#include <algorithm>
#include "mkldnn_extension_mngr.h"
#include "extension_mngr.h"
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
using namespace InferenceEngine;
void MKLDNNExtensionManager::AddExtension(const IExtensionPtr& extension) {

View File

@@ -10,7 +10,8 @@
#include <ie_iextension.h>
#include "nodes/list.hpp"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNExtensionManager {
public:
@@ -25,4 +26,6 @@ private:
std::vector<InferenceEngine::IExtensionPtr> _extensions;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -2,13 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_extension_utils.h"
#include "extension_utils.h"
#include "utils/general_utils.h"
#include <vector>
#include "memory_desc/dnnl_blocked_memory_desc.h"
using namespace mkldnn;
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
uint8_t MKLDNNExtensionUtils::sizeOfDataType(mkldnn::memory::data_type dataType) {
switch (dataType) {

View File

@@ -4,7 +4,7 @@
/**
* @brief Convinience wrapper class for handling MKL-DNN memory formats.
* @file mkldnn_extension_utils.h
* @file extension_utils.h
*/
#pragma once
@@ -13,7 +13,8 @@
#include "mkldnn.hpp"
#include "memory_desc/cpu_memory_desc.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class DnnlMemoryDesc;
@@ -48,4 +49,5 @@ public:
static size_t getMemSizeForDnnlDesc(const mkldnn::memory::desc& desc);
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -14,17 +14,17 @@
#include <memory>
#include <utility>
#include "mkldnn_graph.h"
#include "mkldnn_graph_dumper.h"
#include "mkldnn_graph_optimizer.h"
#include "mkldnn_extension_utils.h"
#include "mkldnn_extension_mngr.h"
#include "graph.h"
#include "graph_dumper.h"
#include "graph_optimizer.h"
#include "extension_utils.h"
#include "extension_mngr.h"
#include "memory_solver.hpp"
#include "mkldnn_itt.h"
#include "mkldnn_infer_request.h"
#include <nodes/mkldnn_input_node.h>
#include <nodes/mkldnn_reorder_node.h>
#include <nodes/mkldnn_convert_node.h>
#include "itt.h"
#include "infer_request.h"
#include "nodes/input.h"
#include <nodes/reorder.h>
#include "nodes/convert.h"
#include <ie_algorithm.hpp>
#include <blob_factory.hpp>
@@ -51,7 +51,7 @@
#include "memory_desc/dnnl_blocked_memory_desc.h"
using namespace mkldnn;
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
using namespace InferenceEngine;
using namespace InferenceEngine::details;
@@ -63,7 +63,7 @@ mkldnn::engine MKLDNNGraph::eng(mkldnn::engine::kind::cpu, 0);
template<typename NET>
void MKLDNNGraph::CreateGraph(NET &net, const MKLDNNExtensionManager::Ptr& extMgr,
MKLDNNWeightsSharing::Ptr &w_cache) {
OV_ITT_SCOPE(FIRST_INFERENCE, MKLDNNPlugin::itt::domains::MKLDNN_LT, "CreateGraph");
OV_ITT_SCOPE(FIRST_INFERENCE, ov::intel_cpu::itt::domains::intel_cpu_LT, "CreateGraph");
if (IsReady())
ForgetGraphData();
@@ -173,7 +173,7 @@ void MKLDNNGraph::Replicate(const std::shared_ptr<const ov::Model> &subgraph, co
graphEdges.push_back(edge);
}
if (!MKLDNNPlugin::one_of(op->get_type_info(),
if (!ov::intel_cpu::one_of(op->get_type_info(),
ngraph::op::v0::Result::get_type_info_static(),
ngraph::op::v3::Assign::get_type_info_static(),
ngraph::op::v6::Assign::get_type_info_static())) {
@@ -201,7 +201,7 @@ void MKLDNNGraph::Replicate(const std::shared_ptr<const ov::Model> &subgraph, co
}
void MKLDNNGraph::Replicate(const CNNNetwork &network, const MKLDNNExtensionManager::Ptr& extMgr) {
OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::MKLDNN_LT, "MKLDNNGraph::Replicate", "CNNNetwork");
OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::intel_cpu_LT, "MKLDNNGraph::Replicate", "CNNNetwork");
InputsDataMap inputsInfo = network.getInputsInfo();
OutputsDataMap outputsInfo = network.getOutputsInfo();
@@ -292,7 +292,7 @@ void MKLDNNGraph::Replicate(const CNNNetwork &network, const MKLDNNExtensionMana
graphEdges.push_back(edge);
}
if (!MKLDNNPlugin::one_of(op->get_type_info(),
if (!ov::intel_cpu::one_of(op->get_type_info(),
ngraph::op::v0::Result::get_type_info_static(),
ngraph::op::v3::Assign::get_type_info_static(),
ngraph::op::v6::Assign::get_type_info_static())) {
@@ -405,14 +405,14 @@ void MKLDNNGraph::InitGraph() {
}
void MKLDNNGraph::InitNodes() {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, "MKLDNNGraph::InitNodes");
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "MKLDNNGraph::InitNodes");
for (auto &node : graphNodes) {
node->init();
}
}
void MKLDNNGraph::InitDescriptors() {
OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, MKLDNNPlugin::itt::domains::MKLDNN_LT, "InitDescriptors", "Prepare");
OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, ov::intel_cpu::itt::domains::intel_cpu_LT, "InitDescriptors", "Prepare");
for (auto &node : graphNodes) {
if (node->getType() == Input && _normalizePreprocMap.find(node->getName()) != _normalizePreprocMap.end()) {
@@ -437,15 +437,15 @@ void MKLDNNGraph::InitDescriptors() {
}
void MKLDNNGraph::InitOptimalPrimitiveDescriptors() {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, "MKLDNNGraph::InitOptimalPrimitiveDescriptors");
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "MKLDNNGraph::InitOptimalPrimitiveDescriptors");
for (auto &node : graphNodes) {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, node->profiling.initOptimalPrimitiveDescriptor);
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, node->profiling.initOptimalPrimitiveDescriptor);
node->initOptimalPrimitiveDescriptor();
}
}
void MKLDNNGraph::ExtractConstantAndExecutableNodes() {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, "MKLDNNGraph::ExtractConstantAndExecutableNodes");
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "MKLDNNGraph::ExtractConstantAndExecutableNodes");
for (const auto& graphNode : graphNodes) {
if (graphNode->isConstant()) {
constantGraphNodes.emplace_back(graphNode);
@@ -461,7 +461,7 @@ void MKLDNNGraph::ExtractConstantAndExecutableNodes() {
}
void MKLDNNGraph::ExecuteConstantNodesOnly() const {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, "MKLDNNGraph::ExecuteConstantNodesOnly");
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "MKLDNNGraph::ExecuteConstantNodesOnly");
mkldnn::stream stream(eng);
using shared_memory_ptr = MKLDNNWeightsSharing::MKLDNNSharedMemory::Ptr;
@@ -524,7 +524,7 @@ static bool isReorderAvailable(const MemoryDescPtr& parentDesc, const MemoryDesc
}
void MKLDNNGraph::InitEdges() {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, "MKLDNNGraph::InitEdges");
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "MKLDNNGraph::InitEdges");
size_t numberOfEdges = graphEdges.size();
@@ -762,7 +762,7 @@ void MKLDNNGraph::AllocateWithReuse() {
}
void MKLDNNGraph::Allocate() {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, "MKLDNNGraph::Allocate");
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "MKLDNNGraph::Allocate");
// resolve edges. Define which will be a view on others
// NeedAllocation - real blob
@@ -783,9 +783,9 @@ void MKLDNNGraph::Allocate() {
}
void MKLDNNGraph::CreatePrimitives() {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, "MKLDNNGraph::CreatePrimitives");
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "MKLDNNGraph::CreatePrimitives");
for (auto& node : graphNodes) {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, node->profiling.createPrimitive);
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, node->profiling.createPrimitive);
node->createPrimitive();
}
}
@@ -874,7 +874,7 @@ void MKLDNNGraph::PullOutputData(BlobMap &out) {
if (out[name]->getTensorDesc().getDims() != outDims && !isScalarOutput) {
// WA: because input/output info initially contains non empty dims, order etc.
// and setDims (called inside setShape) can't correct modify blocked desc for desc with blocked layout
if (expectedDesc.getLayout() == Layout::BLOCKED) {
if (expectedDesc.getLayout() == InferenceEngine::Layout::BLOCKED) {
expectedDesc = TensorDesc(expectedDesc.getPrecision(), expectedDesc.getLayout());
}
if (getProperty().isNewApi && getProperty().batchLimit > 0) {
@@ -942,7 +942,7 @@ void MKLDNNGraph::PullOutputData(BlobMap &out) {
inline void MKLDNNGraph::ExecuteNode(const MKLDNNNodePtr& node, const mkldnn::stream& stream) const {
DUMP(node, config, infer_count);
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, node->profiling.execute);
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, node->profiling.execute);
if (node->isDynamicNode()) {
node->executeDynamic(stream);
@@ -992,7 +992,7 @@ void MKLDNNGraph::VisitNode(MKLDNNNodePtr node, std::vector<MKLDNNNodePtr>& sort
}
void MKLDNNGraph::SortTopologically() {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, "MKLDNNGraph::SortTopologically");
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "MKLDNNGraph::SortTopologically");
std::vector<MKLDNNNodePtr> unsorted;
std::vector<MKLDNNNodePtr> sorted;

View File

@@ -6,10 +6,10 @@
#include "cpp/ie_cnn_network.h"
#include "config.h"
#include "mkldnn_memory.h"
#include "cpu_memory.h"
#include "normalize_preprocess.h"
#include "mkldnn_node.h"
#include "mkldnn_edge.h"
#include "node.h"
#include "edge.h"
#include "cache/multi_cache.h"
#include <map>
#include <string>
@@ -17,7 +17,9 @@
#include <memory>
#include <atomic>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNInferRequestBase;
class MKLDNNGraph {
public:
@@ -259,4 +261,5 @@ private:
void EnforceBF16();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_graph_dumper.h"
#include "graph_dumper.h"
#include "utils/debug_capabilities.h"
#include <ie_ngraph_utils.hpp>
@@ -21,7 +21,8 @@
using namespace InferenceEngine;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
void serializeToCout(const MKLDNNGraph &graph);
void serializeToXML(const MKLDNNGraph &graph, const std::string& path);
@@ -255,4 +256,5 @@ void serializeToCout(const MKLDNNGraph &graph) {
}
}
#endif
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -5,15 +5,18 @@
#pragma once
#include "cpp/ie_cnn_network.h"
#include "mkldnn_graph.h"
#include "graph.h"
#include "utils/debug_capabilities.h"
#include <memory>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
std::shared_ptr<ngraph::Function> dump_graph_as_ie_ngraph_net(const MKLDNNGraph &graph);
#ifdef CPU_DEBUG_CAPS
void serialize(const MKLDNNGraph &graph);
#endif // CPU_DEBUG_CAPS
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -2,24 +2,24 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_graph_optimizer.h"
#include "graph_optimizer.h"
#include "mkldnn_extension_utils.h"
#include "nodes/mkldnn_reshape_node.h"
#include "nodes/mkldnn_pooling_node.h"
#include "nodes/mkldnn_eltwise_node.h"
#include "nodes/mkldnn_concat_node.h"
#include "nodes/mkldnn_reorder_node.h"
#include "nodes/mkldnn_conv_node.h"
#include "nodes/mkldnn_deconv_node.h"
#include "nodes/mkldnn_bin_conv_node.h"
#include "nodes/mkldnn_fake_quantize_node.h"
#include "nodes/mkldnn_mvn_node.h"
#include <nodes/mkldnn_transpose_node.h>
#include "nodes/mkldnn_interpolate_node.h"
#include "nodes/mkldnn_reduce_node.h"
#include "nodes/mkldnn_input_node.h"
#include "nodes/mkldnn_rnn.h"
#include "extension_utils.h"
#include "nodes/reshape.h"
#include "nodes/pooling.h"
#include "nodes/eltwise.h"
#include "nodes/concat.h"
#include "nodes/reorder.h"
#include "nodes/conv.h"
#include "nodes/deconv.h"
#include "nodes/bin_conv.h"
#include "nodes/fake_quantize.h"
#include "nodes/mvn.h"
#include "nodes/transpose.h"
#include "nodes/interpolate.h"
#include "nodes/reduce.h"
#include "nodes/input.h"
#include "nodes/rnn.h"
#include "nodes/common/cpu_convert.h"
#include "mkldnn/ie_mkldnn.h"
@@ -48,17 +48,17 @@
#include <set>
#include <algorithm>
#include "mkldnn_itt.h"
#include "itt.h"
#include "memory_desc/cpu_memory_desc_utils.h"
using namespace mkldnn;
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
using namespace InferenceEngine;
MKLDNNGraphOptimizer::MKLDNNGraphOptimizer() {}
void MKLDNNGraphOptimizer::ApplyCommonGraphOptimizations(MKLDNNGraph &graph) {
OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::MKLDNN_LT, "ApplyCommonGraphOptimizations", "FuseConvolutionAndBias");
OV_ITT_SCOPE_CHAIN(FIRST_INFERENCE, taskChain, itt::domains::intel_cpu_LT, "ApplyCommonGraphOptimizations", "FuseConvolutionAndBias");
FuseConvolutionMatMulAndBias(graph);
graph.RemoveDroppedNodes();
@@ -155,7 +155,7 @@ void MKLDNNGraphOptimizer::ApplyCommonGraphOptimizations(MKLDNNGraph &graph) {
}
void MKLDNNGraphOptimizer::ApplyImplSpecificGraphOptimizations(MKLDNNGraph &graph) {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::MKLDNN_LT, "MKLDNNGraphOptimizer::ApplyImplSpecificGraphOptimizations");
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "MKLDNNGraphOptimizer::ApplyImplSpecificGraphOptimizations");
DropDoubleReorders(graph);
graph.RemoveDroppedNodes();

View File

@@ -4,11 +4,12 @@
#pragma once
#include "mkldnn_graph.h"
#include "nodes/mkldnn_eltwise_node.h"
#include "graph.h"
#include "nodes/eltwise.h"
#include <vector>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNGraphOptimizer {
public:
@@ -44,4 +45,5 @@ private:
void reshapeRnnSeq(MKLDNNGraph &graph);
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -2,23 +2,23 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_infer_request.h"
#include "mkldnn_extension_utils.h"
#include "infer_request.h"
#include "extension_utils.h"
#include <vector>
#include <string>
#include <map>
#include <blob_factory.hpp>
#include <nodes/mkldnn_concat_node.h>
#include <nodes/mkldnn_split_node.h>
#include "nodes/concat.h"
#include "nodes/split.h"
#include <ie_compound_blob.h>
#include <ie_common.h>
#include "mkldnn_exec_network.h"
#include "mkldnn_itt.h"
#include "exec_network.h"
#include "itt.h"
#include "nodes/common/cpu_convert.h"
#include "mkldnn_memory_state.h"
#include "nodes/mkldnn_memory_node.hpp"
#include "memory_state.h"
#include "nodes/memory.hpp"
#include "nodes/common/cpu_memcpy.h"
#include "mkldnn_async_infer_request.h"
#include "async_infer_request.h"
#include <debug.h>
#include "utils/general_utils.h"
#include "utils/cpu_utils.hpp"
@@ -26,7 +26,7 @@
#include <transformations/utils/utils.hpp>
#include <ie_ngraph_utils.hpp>
void MKLDNNPlugin::MKLDNNInferRequestBase::CreateInferRequest() {
void ov::intel_cpu::MKLDNNInferRequestBase::CreateInferRequest() {
auto id = (execNetwork->_numRequests)++;
profilingTask = openvino::itt::handle("MKLDNN_INFER_" + execNetwork->_name + "_" + std::to_string(id));
@@ -58,11 +58,11 @@ void MKLDNNPlugin::MKLDNNInferRequestBase::CreateInferRequest() {
}
}
MKLDNNPlugin::MKLDNNInferRequestBase::~MKLDNNInferRequestBase() {
ov::intel_cpu::MKLDNNInferRequestBase::~MKLDNNInferRequestBase() {
--(execNetwork->_numRequests);
}
void MKLDNNPlugin::MKLDNNInferRequestBase::pushInput(const std::string& inputName, InferenceEngine::Blob::Ptr& inputBlob, InferenceEngine::Precision inPrec) {
void ov::intel_cpu::MKLDNNInferRequestBase::pushInput(const std::string& inputName, InferenceEngine::Blob::Ptr& inputBlob, InferenceEngine::Precision inPrec) {
auto& tensorDesc = inputBlob->getTensorDesc();
bool needConvert = inPrec != tensorDesc.getPrecision();
@@ -89,7 +89,7 @@ void MKLDNNPlugin::MKLDNNInferRequestBase::pushInput(const std::string& inputNam
graph->PushInputData(inputName, needConvert ? iconv : inputBlob);
}
void MKLDNNPlugin::MKLDNNInferRequestBase::PushStates() {
void ov::intel_cpu::MKLDNNInferRequestBase::PushStates() {
for (auto &node : graph->GetNodes()) {
if (node->getType() == MemoryInput) {
auto cur_node = dynamic_cast<MKLDNNMemoryInputNode*>(node.get());
@@ -111,7 +111,7 @@ void MKLDNNPlugin::MKLDNNInferRequestBase::PushStates() {
}
}
void MKLDNNPlugin::MKLDNNInferRequestBase::PullStates() {
void ov::intel_cpu::MKLDNNInferRequestBase::PullStates() {
for (auto &node : graph->GetNodes()) {
if (node->getType() == MemoryInput) {
auto cur_node = dynamic_cast<MKLDNNMemoryInputNode*>(node.get());
@@ -133,7 +133,7 @@ void MKLDNNPlugin::MKLDNNInferRequestBase::PullStates() {
}
}
void MKLDNNPlugin::MKLDNNInferRequestBase::redefineMemoryForInputNodes() {
void ov::intel_cpu::MKLDNNInferRequestBase::redefineMemoryForInputNodes() {
const auto cpuInputNodes = graph->GetInputNodesMap();
for (const auto &blob : _inputs) {
@@ -146,9 +146,9 @@ void MKLDNNPlugin::MKLDNNInferRequestBase::redefineMemoryForInputNodes() {
}
}
void MKLDNNPlugin::MKLDNNInferRequestBase::InferImpl() {
void ov::intel_cpu::MKLDNNInferRequestBase::InferImpl() {
using namespace openvino::itt;
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, profilingTask);
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, profilingTask);
auto graphLock = execNetwork->GetGraph();
graph = &(graphLock._graph);
@@ -184,7 +184,7 @@ void MKLDNNPlugin::MKLDNNInferRequestBase::InferImpl() {
graph->PullOutputData(_outputs);
}
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> MKLDNNPlugin::MKLDNNInferRequestBase::GetPerformanceCounts() const {
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> ov::intel_cpu::MKLDNNInferRequestBase::GetPerformanceCounts() const {
if (!graph || !graph->IsReady())
IE_THROW() << "Graph is not ready!";
std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> perfMap;
@@ -192,11 +192,11 @@ std::map<std::string, InferenceEngine::InferenceEngineProfileInfo> MKLDNNPlugin:
return perfMap;
}
static inline void changeEdgePtr(const MKLDNNPlugin::MKLDNNEdgePtr &edge, void *newPtr) {
static inline void changeEdgePtr(const ov::intel_cpu::MKLDNNEdgePtr &edge, void *newPtr) {
edge->getMemoryPtr()->setDataHandle(newPtr);
}
void MKLDNNPlugin::MKLDNNInferRequestBase::changeDefaultPtr() {
void ov::intel_cpu::MKLDNNInferRequestBase::changeDefaultPtr() {
for (auto& it : externalPtr) {
const auto& inputNodesMap = graph->GetInputNodesMap();
auto input = inputNodesMap.find(it.first);
@@ -305,22 +305,22 @@ void MKLDNNPlugin::MKLDNNInferRequestBase::changeDefaultPtr() {
}
}
std::vector<InferenceEngine::IVariableStateInternal::Ptr> MKLDNNPlugin::MKLDNNInferRequestBase::QueryState() {
std::vector<InferenceEngine::IVariableStateInternal::Ptr> ov::intel_cpu::MKLDNNInferRequestBase::QueryState() {
return memoryStates;
}
void MKLDNNPlugin::MKLDNNInferRequestBase::SetAsyncRequest(MKLDNNAsyncInferRequest* asyncRequest) {
void ov::intel_cpu::MKLDNNInferRequestBase::SetAsyncRequest(MKLDNNAsyncInferRequest* asyncRequest) {
_asyncRequest = asyncRequest;
}
void MKLDNNPlugin::MKLDNNInferRequestBase::ThrowIfCanceled() const {
void ov::intel_cpu::MKLDNNInferRequestBase::ThrowIfCanceled() const {
if (_asyncRequest != nullptr) {
_asyncRequest->ThrowIfCanceled();
}
}
InferenceEngine::Precision
MKLDNNPlugin::MKLDNNInferRequestBase::normToInputSupportedPrec(const std::pair<const std::string, InferenceEngine::Blob::Ptr>& input) const {
ov::intel_cpu::MKLDNNInferRequestBase::normToInputSupportedPrec(const std::pair<const std::string, InferenceEngine::Blob::Ptr>& input) const {
const auto& inputTensorDesc = input.second->getTensorDesc();
auto inPrec = inputTensorDesc.getPrecision();
if (graph->hasMeanImageFor(input.first) && one_of(inPrec, InferenceEngine::Precision::U8, InferenceEngine::Precision::BOOL)) {
@@ -337,14 +337,14 @@ MKLDNNPlugin::MKLDNNInferRequestBase::normToInputSupportedPrec(const std::pair<c
}
/* ========================================== MKLDNNLegacyInferRequest ========================================== */
MKLDNNPlugin::MKLDNNLegacyInferRequest::MKLDNNLegacyInferRequest(InferenceEngine::InputsDataMap networkInputs,
ov::intel_cpu::MKLDNNLegacyInferRequest::MKLDNNLegacyInferRequest(InferenceEngine::InputsDataMap networkInputs,
InferenceEngine::OutputsDataMap networkOutputs,
std::shared_ptr<MKLDNNExecNetwork> execNetwork)
: MKLDNNInferRequestBase(networkInputs, networkOutputs, execNetwork) {
CreateInferRequest();
}
void MKLDNNPlugin::MKLDNNLegacyInferRequest::initBlobs() {
void ov::intel_cpu::MKLDNNLegacyInferRequest::initBlobs() {
for (const auto& it : _networkInputs) {
MKLDNNLegacyInferRequest::GetBlob(it.first);
}
@@ -353,7 +353,7 @@ void MKLDNNPlugin::MKLDNNLegacyInferRequest::initBlobs() {
}
}
void MKLDNNPlugin::MKLDNNLegacyInferRequest::SetBatch(int new_batch) {
void ov::intel_cpu::MKLDNNLegacyInferRequest::SetBatch(int new_batch) {
if (!graph->getProperty().enableDynamicBatch)
IE_THROW() << "Dynamic batch is not enabled.";
@@ -369,8 +369,8 @@ void MKLDNNPlugin::MKLDNNLegacyInferRequest::SetBatch(int new_batch) {
}
}
void MKLDNNPlugin::MKLDNNLegacyInferRequest::SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr &data) {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, "SetBlobLegacy");
void ov::intel_cpu::MKLDNNLegacyInferRequest::SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr &data) {
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "SetBlobLegacy");
if (name.empty()) {
IE_THROW(NotFound) << "Failed to set blob with empty name";
}
@@ -479,8 +479,8 @@ void MKLDNNPlugin::MKLDNNLegacyInferRequest::SetBlob(const std::string& name, co
}
}
InferenceEngine::Blob::Ptr MKLDNNPlugin::MKLDNNLegacyInferRequest::GetBlob(const std::string& name) {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, "GetBlobLegacy");
InferenceEngine::Blob::Ptr ov::intel_cpu::MKLDNNLegacyInferRequest::GetBlob(const std::string& name) {
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "GetBlobLegacy");
if (!graph || !graph->IsReady())
IE_THROW() << "Graph is not ready!";
@@ -595,7 +595,7 @@ InferenceEngine::Blob::Ptr MKLDNNPlugin::MKLDNNLegacyInferRequest::GetBlob(const
return data;
}
void MKLDNNPlugin::MKLDNNLegacyInferRequest::PushInputData() {
void ov::intel_cpu::MKLDNNLegacyInferRequest::PushInputData() {
for (auto input : _inputs) {
auto inputName = input.first;
if (!_networkInputs[inputName]) {
@@ -614,7 +614,7 @@ void MKLDNNPlugin::MKLDNNLegacyInferRequest::PushInputData() {
}
/* ========================================== MKLDNNInferRequest ========================================== */
MKLDNNPlugin::MKLDNNInferRequest::MKLDNNInferRequest(const std::vector<std::shared_ptr<const ov::Node>>& inputs,
ov::intel_cpu::MKLDNNInferRequest::MKLDNNInferRequest(const std::vector<std::shared_ptr<const ov::Node>>& inputs,
const std::vector<std::shared_ptr<const ov::Node>>& outputs,
MKLDNNExecNetwork::Ptr execNetwork)
: MKLDNNInferRequestBase(inputs, outputs, execNetwork) {
@@ -628,7 +628,7 @@ MKLDNNPlugin::MKLDNNInferRequest::MKLDNNInferRequest(const std::vector<std::shar
CreateInferRequest();
}
void MKLDNNPlugin::MKLDNNInferRequest::initBlobs() {
void ov::intel_cpu::MKLDNNInferRequest::initBlobs() {
for (const auto& it : modelInputsMap) {
MKLDNNInferRequest::GetBlob(it.first);
}
@@ -637,7 +637,7 @@ void MKLDNNPlugin::MKLDNNInferRequest::initBlobs() {
}
}
void MKLDNNPlugin::MKLDNNInferRequest::SetBatch(int new_batch) {
void ov::intel_cpu::MKLDNNInferRequest::SetBatch(int new_batch) {
if (!graph->getProperty().batchLimit || modelInputsMap.begin()->second->get_output_partial_shape(0).is_static()) {
IE_THROW() << "Can't SetBatch for model that can't be executed via legacy dynamic batch or for static model";
}
@@ -653,8 +653,8 @@ void MKLDNNPlugin::MKLDNNInferRequest::SetBatch(int new_batch) {
}
}
void MKLDNNPlugin::MKLDNNInferRequest::SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr &data) {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, "SetBlob");
void ov::intel_cpu::MKLDNNInferRequest::SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr &data) {
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "SetBlob");
if (name.empty()) {
IE_THROW(NotFound) << "Failed to set blob with empty name";
}
@@ -751,8 +751,8 @@ void MKLDNNPlugin::MKLDNNInferRequest::SetBlob(const std::string& name, const In
}
}
InferenceEngine::Blob::Ptr MKLDNNPlugin::MKLDNNInferRequest::GetBlob(const std::string& name) {
OV_ITT_SCOPED_TASK(itt::domains::MKLDNNPlugin, "GetBlob");
InferenceEngine::Blob::Ptr ov::intel_cpu::MKLDNNInferRequest::GetBlob(const std::string& name) {
OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "GetBlob");
if (!graph || !graph->IsReady())
IE_THROW() << "Graph is not ready!";
@@ -852,7 +852,7 @@ InferenceEngine::Blob::Ptr MKLDNNPlugin::MKLDNNInferRequest::GetBlob(const std::
return data;
}
void MKLDNNPlugin::MKLDNNInferRequest::PushInputData() {
void ov::intel_cpu::MKLDNNInferRequest::PushInputData() {
for (auto input : _inputs) {
auto inputName = input.first;
if (!modelInputsMap[inputName]) {

View File

@@ -4,13 +4,14 @@
#pragma once
#include "mkldnn_graph.h"
#include "graph.h"
#include <memory>
#include <string>
#include <map>
#include <cpp_interfaces/interface/ie_iinfer_request_internal.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNExecNetwork;
class MKLDNNAsyncInferRequest;
@@ -100,4 +101,5 @@ private:
std::unordered_map<std::string, std::shared_ptr<const ov::Node>> modelOutputsMap;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,18 +4,20 @@
/**
* @brief Defines openvino domains for tracing
* @file mkldnn_itt.h
* @file itt.h
*/
#pragma once
#include <openvino/itt.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
namespace itt {
namespace domains {
OV_ITT_DOMAIN(MKLDNNPlugin);
OV_ITT_DOMAIN(MKLDNN_LT);
OV_ITT_DOMAIN(intel_cpu);
OV_ITT_DOMAIN(intel_cpu_LT);
}
}
}
}

View File

@@ -5,7 +5,7 @@
#include "blocked_memory_desc.h"
#include "utils/general_utils.h"
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
bool BlockedMemoryDesc::isCompatibleInternal(const BlockedMemoryDesc &rhs, CmpMask cmpMask) const {
if (this->getShape() != rhs.getShape() || this->getPrecision() != rhs.getPrecision())

View File

@@ -8,7 +8,8 @@
#include "cpu_memory_desc.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
#define BLOCKED_DESC_FULL_MASK 0xffffffff
#define BLOCKED_DESC_EMPTY_MASK 0x0
@@ -104,4 +105,5 @@ protected:
using BlockedMemoryDescPtr = std::shared_ptr<BlockedMemoryDesc>;
using BlockedMemoryDescCPtr = std::shared_ptr<const BlockedMemoryDesc>;
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -3,10 +3,10 @@
//
#include "cpu_blocked_memory_desc.h"
#include "mkldnn_memory.h"
#include <cpu_memory.h>
#include "dnnl_blocked_memory_desc.h"
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
static VectorDims makeRange(size_t size) {
VectorDims retVec(size, 0);

View File

@@ -7,7 +7,8 @@
#include "blocked_memory_desc.h"
#include "utils/general_utils.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class CpuBlockedMemoryDesc : public BlockedMemoryDesc {
public:
@@ -102,4 +103,5 @@ private:
using CpuBlockedMemoryDescPtr = std::shared_ptr<CpuBlockedMemoryDesc>;
using CpuBlockedMemoryDescCPtr = std::shared_ptr<const CpuBlockedMemoryDesc>;
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -20,7 +20,8 @@
*
*/
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MemoryDesc;
@@ -175,4 +176,5 @@ protected:
friend class MKLDNNSplitNode;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,7 +4,7 @@
#include "cpu_memory_desc.h"
#include "memory_desc/cpu_memory_desc_utils.h"
#include "mkldnn_memory.h"
#include <cpu_memory.h>
#include "memory_desc/dnnl_blocked_memory_desc.h"
#include "utils/general_utils.h"
#include "utils/cpu_utils.hpp"
@@ -15,10 +15,11 @@
#include <dnnl_types.h>
using namespace mkldnn;
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
using namespace InferenceEngine;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
DnnlMemoryDescPtr MemoryDescUtils::convertToDnnlMemoryDesc(const MemoryDescPtr &desc) {
if (MemoryDescType::Blocked == desc->getType()) {
@@ -150,4 +151,5 @@ Shape MemoryDescUtils::makeDummyShape(const Shape &shape, Dim dummyVal) {
return Shape(dummyDims);
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -10,7 +10,8 @@
#include <ie_layouts.h>
#include <ie_blob.h>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MemoryDesc;
class DnnlMemoryDesc;
@@ -105,4 +106,5 @@ public:
static std::string dims2str(const VectorDims& dims);
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,7 +6,7 @@
#include <dnnl_types.h>
#include <common/memory_desc_wrapper.hpp>
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
using namespace InferenceEngine;
DnnlBlockedMemoryDesc::DnnlBlockedMemoryDesc(InferenceEngine::Precision prc, const Shape& shape, const VectorDims& strides)

View File

@@ -5,10 +5,11 @@
#pragma once
#include "blocked_memory_desc.h"
#include "mkldnn_memory.h"
#include "mkldnn_extension_utils.h"
#include <cpu_memory.h>
#include <extension_utils.h>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class DnnlBlockedMemoryDesc : public BlockedMemoryDesc, public DnnlMemoryDesc {
public:
@@ -100,4 +101,5 @@ private:
using DnnlBlockedMemoryDescPtr = std::shared_ptr<DnnlBlockedMemoryDesc>;
using DnnlBlockedMemoryDescCPtr = std::shared_ptr<const DnnlBlockedMemoryDesc>;
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -3,11 +3,12 @@
//
#include "dnnl_memory_desc.h"
#include "mkldnn_extension_utils.h"
#include <extension_utils.h>
#include <common/memory_desc_wrapper.hpp>
#include "mkldnn/ie_mkldnn.h"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
DnnlMemoryDesc::DnnlMemoryDesc(const mkldnn::memory::desc& desc) :
MemoryDesc(Shape(MKLDNNExtensionUtils::convertToVectorDims(desc.dims())), Mkldnn), desc(desc) {
@@ -82,4 +83,5 @@ MemoryDescPtr DnnlMemoryDesc::cloneWithNewPrecision(const InferenceEngine::Preci
return newDesc;
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -5,9 +5,10 @@
#pragma once
#include "cpu_blocked_memory_desc.h"
#include "mkldnn_extension_utils.h"
#include <extension_utils.h>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class DnnlMemoryDesc;
@@ -71,4 +72,6 @@ private:
friend DnnlMemoryDescPtr MKLDNNExtensionUtils::makeDescriptor(const mkldnn::memory::desc &desc);
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -2,16 +2,19 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "mkldnn_memory_state.h"
#include "mkldnn_extension_utils.h"
#include "memory_state.h"
#include "extension_utils.h"
#include "blob_factory.hpp"
using namespace InferenceEngine;
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
void MKLDNNVariableState::Reset() {
std::memset(state->buffer(), 0, state->byteSize());
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -6,13 +6,14 @@
#include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp"
#include "blob_factory.hpp"
#include "mkldnn_memory.h"
#include "cpu_memory.h"
#include "nodes/common/cpu_memcpy.h"
#include "memory_desc/cpu_memory_desc_utils.h"
#include <string>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MKLDNNVariableState : public InferenceEngine::IVariableStateInternal {
public:
@@ -26,4 +27,5 @@ public:
void Reset() override;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,9 +4,9 @@
#include "iml_type_mapper.h"
using namespace MKLDNNPlugin;
using namespace ov::intel_cpu;
impl_desc_type MKLDNNPlugin::parse_impl_name(std::string impl_desc_name) {
impl_desc_type ov::intel_cpu::parse_impl_name(std::string impl_desc_name) {
impl_desc_type res = impl_desc_type::unknown;
#define REPLACE_WORD(_wrd, _sub) auto pos = impl_desc_name.find(#_wrd); \
@@ -55,7 +55,7 @@ impl_desc_type MKLDNNPlugin::parse_impl_name(std::string impl_desc_name) {
return res;
}
const char* MKLDNNPlugin::impl_type_to_string(impl_desc_type type) {
const char* ov::intel_cpu::impl_type_to_string(impl_desc_type type) {
#define CASE(_type) do { \
if (type == _type) return #_type; \
} while (0)

View File

@@ -6,7 +6,8 @@
#include <string>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
enum impl_desc_type {
unknown = 0x00000000,
@@ -94,4 +95,6 @@ enum impl_desc_type {
const char * impl_type_to_string(impl_desc_type type);
impl_desc_type parse_impl_name(std::string impl_desc_name);
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -13,9 +13,9 @@
#include <algorithm>
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::AlignMatMulInputRanks, "AlignMatMulInputRanks", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::AlignMatMulInputRanks, "AlignMatMulInputRanks", 0);
MKLDNNPlugin::AlignMatMulInputRanks::AlignMatMulInputRanks() {
ov::intel_cpu::AlignMatMulInputRanks::AlignMatMulInputRanks() {
ngraph::OutputVector twoInputs = {
ngraph::pattern::any_input(ngraph::pattern::has_static_rank()),
ngraph::pattern::any_input(ngraph::pattern::has_static_rank())

View File

@@ -14,7 +14,8 @@
* requires inputs to have equal ranks
*/
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class AlignMatMulInputRanks: public ngraph::pass::MatcherPass {
public:
@@ -22,4 +23,5 @@ public:
AlignMatMulInputRanks();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -8,9 +8,9 @@
#include <ngraph/rt_info.hpp>
#include <ngraph/pattern/op/wrap_type.hpp>
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ConvertBroadcastToTiles, "ConvertBroadcastToTiles", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ConvertBroadcastToTiles, "ConvertBroadcastToTiles", 0);
MKLDNNPlugin::ConvertBroadcastToTiles::ConvertBroadcastToTiles() {
ov::intel_cpu::ConvertBroadcastToTiles::ConvertBroadcastToTiles() {
auto broadcast = ngraph::pattern::wrap_type<ngraph::opset1::Broadcast>();
ngraph::matcher_pass_callback callback = [this](ngraph::pattern::Matcher& m) {

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ConvertBroadcastToTiles: public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ConvertBroadcastToTiles();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -9,9 +9,9 @@
#include <ngraph/pattern/op/wrap_type.hpp>
#include <transformations/utils/utils.hpp>
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ConvertMatMulToFC, "ConvertMatMulToFC", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ConvertMatMulToFC, "ConvertMatMulToFC", 0);
MKLDNNPlugin::ConvertMatMulToFC::ConvertMatMulToFC() {
ov::intel_cpu::ConvertMatMulToFC::ConvertMatMulToFC() {
auto activations_m = ngraph::pattern::any_input(ngraph::pattern::has_static_rank());
auto weights_m = ngraph::pattern::wrap_type<ngraph::opset1::Constant>();
auto matmul_m = ngraph::pattern::wrap_type<ngraph::opset1::MatMul>({ activations_m, weights_m }, ngraph::pattern::has_static_rank());
@@ -156,7 +156,7 @@ MKLDNNPlugin::ConvertMatMulToFC::ConvertMatMulToFC() {
auto output_rank = matmul->get_output_partial_shape(0).rank();
// Create FullyConnected
auto fc = std::make_shared<MKLDNNPlugin::FullyConnectedNode>(fc_input_a, fc_input_b, output_rank, matmul->get_output_element_type(0));
auto fc = std::make_shared<ov::intel_cpu::FullyConnectedNode>(fc_input_a, fc_input_b, output_rank, matmul->get_output_element_type(0));
fc->set_friendly_name(matmul->get_friendly_name());
new_ops.push_back(fc);
ngraph::copy_runtime_info(matmul, new_ops);

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ConvertMatMulToFC: public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ConvertMatMulToFC();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -12,9 +12,9 @@
#include <ngraph/rt_info.hpp>
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ConvertTileToSeqTiles, "ConvertTileToSeqTiles", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ConvertTileToSeqTiles, "ConvertTileToSeqTiles", 0);
MKLDNNPlugin::ConvertTileToSeqTiles::ConvertTileToSeqTiles() {
ov::intel_cpu::ConvertTileToSeqTiles::ConvertTileToSeqTiles() {
auto tile = ngraph::pattern::wrap_type<ngraph::opset1::Tile>({ngraph::pattern::any_input(ngraph::pattern::has_static_rank()),
ngraph::pattern::wrap_type<ngraph::opset1::Constant>()});

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ConvertTileToSeqTiles: public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ConvertTileToSeqTiles();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -20,7 +20,8 @@
#include "rnn_sequences_optimization.hpp"
#include "transformations/common_optimizations/reshape_sequence_fusion.hpp"
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
inline void ConvertToCPUSpecificOpset(std::shared_ptr<ngraph::Function> &nGraphFunc) {
ngraph::pass::Manager manager;
@@ -43,4 +44,5 @@ inline void ConvertToCPUSpecificOpset(std::shared_ptr<ngraph::Function> &nGraphF
manager.run_passes(nGraphFunc);
}
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -9,9 +9,9 @@
#include <ngraph/pattern/op/wrap_type.hpp>
#include "op/leaky_relu.hpp"
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ConvertToLeakyRelu, "ConvertToLeakyRelu", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ConvertToLeakyRelu, "ConvertToLeakyRelu", 0);
MKLDNNPlugin::ConvertToLeakyRelu::ConvertToLeakyRelu() {
ov::intel_cpu::ConvertToLeakyRelu::ConvertToLeakyRelu() {
auto input = ngraph::pattern::any_input();
auto slope_constant = ngraph::pattern::wrap_type<ngraph::opset1::Constant>();
auto prelu = ngraph::pattern::wrap_type<ngraph::opset1::PRelu>({ input, slope_constant });
@@ -24,7 +24,7 @@ MKLDNNPlugin::ConvertToLeakyRelu::ConvertToLeakyRelu() {
auto slopeNode = std::dynamic_pointer_cast<ngraph::opset1::Constant>(prelu->get_input_node_shared_ptr(1));
if (slopeNode != nullptr && ngraph::shape_size(slopeNode->get_shape()) == 1) {
const float slope = slopeNode->cast_vector<float>()[0];
const auto leakyRelu = std::make_shared<MKLDNNPlugin::LeakyReluNode>(prelu->input(0).get_source_output(), slope,
const auto leakyRelu = std::make_shared<ov::intel_cpu::LeakyReluNode>(prelu->input(0).get_source_output(), slope,
prelu->output(0).get_element_type());
leakyRelu->set_friendly_name(prelu->get_friendly_name());
ngraph::copy_runtime_info(prelu, leakyRelu);

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ConvertToLeakyRelu: public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ConvertToLeakyRelu();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -43,14 +43,14 @@ bool isConvertableToPowerStatic(const std::shared_ptr<BaseOp> &node) {
auto const_shape = node->get_input_shape(constPort);
return ngraph::shape_size(const_shape) == 1 &&
input_rank.get_length() >= const_shape.size() &&
!MKLDNNPlugin::one_of(node->get_input_node_shared_ptr(nonConstPort)->get_type_info(),
!ov::intel_cpu::one_of(node->get_input_node_shared_ptr(nonConstPort)->get_type_info(),
ngraph::opset1::NormalizeL2::get_type_info_static(),
ngraph::opset4::Interpolate::get_type_info_static(),
ngraph::opset1::Convolution::get_type_info_static(),
ngraph::opset1::GroupConvolution::get_type_info_static(),
ngraph::opset1::ConvolutionBackpropData::get_type_info_static(),
ngraph::opset1::GroupConvolutionBackpropData::get_type_info_static(),
MKLDNNPlugin::FullyConnectedNode::get_type_info_static(),
ov::intel_cpu::FullyConnectedNode::get_type_info_static(),
ngraph::op::v0::MVN::get_type_info_static(),
ngraph::opset6::MVN::get_type_info_static());
}
@@ -71,10 +71,10 @@ std::shared_ptr<ngraph::Node> convert(const std::shared_ptr<BaseOp> &node) {
std::shared_ptr<ngraph::opset1::Constant> powerNode = std::dynamic_pointer_cast<ngraph::opset1::Constant>(node->get_input_node_shared_ptr(constPort));
const float value = powerNode->cast_vector<float>()[0];
if (std::is_same<BaseOp, ngraph::opset1::Power>::value) {
return std::make_shared<MKLDNNPlugin::PowerStaticNode>(node->input(nonConstPort).get_source_output(), value, 1.0f, 0.0f,
return std::make_shared<ov::intel_cpu::PowerStaticNode>(node->input(nonConstPort).get_source_output(), value, 1.0f, 0.0f,
node->output(0).get_element_type());
} else if (std::is_same<BaseOp, ngraph::opset1::Add>::value) {
return std::make_shared<MKLDNNPlugin::PowerStaticNode>(node->input(nonConstPort).get_source_output(), 1.0f, 1.0f, value,
return std::make_shared<ov::intel_cpu::PowerStaticNode>(node->input(nonConstPort).get_source_output(), 1.0f, 1.0f, value,
node->output(0).get_element_type());
} else if (std::is_same<BaseOp, ngraph::opset1::Subtract>::value) {
float scale = 1.0f;
@@ -84,10 +84,10 @@ std::shared_ptr<ngraph::Node> convert(const std::shared_ptr<BaseOp> &node) {
} else {
shift *= -1.0f;
}
return std::make_shared<MKLDNNPlugin::PowerStaticNode>(node->input(nonConstPort).get_source_output(), 1.0f, scale, shift,
return std::make_shared<ov::intel_cpu::PowerStaticNode>(node->input(nonConstPort).get_source_output(), 1.0f, scale, shift,
node->output(0).get_element_type());
} else if (std::is_same<BaseOp, ngraph::opset1::Multiply>::value) {
return std::make_shared<MKLDNNPlugin::PowerStaticNode>(node->input(nonConstPort).get_source_output(), 1.f, value, 0.0f,
return std::make_shared<ov::intel_cpu::PowerStaticNode>(node->input(nonConstPort).get_source_output(), 1.f, value, 0.0f,
node->output(0).get_element_type());
} else {
throw ngraph::ngraph_error("ConvertToPowerStatic: op type is not supported");
@@ -96,9 +96,9 @@ std::shared_ptr<ngraph::Node> convert(const std::shared_ptr<BaseOp> &node) {
} // namespace
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ConvertToPowerStatic, "ConvertToPowerStatic", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ConvertToPowerStatic, "ConvertToPowerStatic", 0);
MKLDNNPlugin::ConvertToPowerStatic::ConvertToPowerStatic() {
ov::intel_cpu::ConvertToPowerStatic::ConvertToPowerStatic() {
ngraph::OutputVector twoInputs = {ngraph::pattern::any_input(ngraph::pattern::has_static_rank()),
ngraph::pattern::any_input(ngraph::pattern::has_static_rank())};
auto power = ngraph::pattern::wrap_type<ngraph::opset1::Power>(twoInputs);

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ConvertToPowerStatic: public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ConvertToPowerStatic();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -9,9 +9,9 @@
#include <ngraph/pattern/op/wrap_type.hpp>
#include "op/swish_cpu.hpp"
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ConvertToSwishCPU, "ConvertToSwishCPU", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ConvertToSwishCPU, "ConvertToSwishCPU", 0);
MKLDNNPlugin::ConvertToSwishCPU::ConvertToSwishCPU() {
ov::intel_cpu::ConvertToSwishCPU::ConvertToSwishCPU() {
auto swish = ngraph::pattern::wrap_type<ngraph::opset4::Swish>();
ngraph::matcher_pass_callback callback = [](ngraph::pattern::Matcher& m) {
@@ -29,7 +29,7 @@ MKLDNNPlugin::ConvertToSwishCPU::ConvertToSwishCPU() {
beta_value = beta->cast_vector<float>()[0];
}
auto swish_cpu = std::make_shared<MKLDNNPlugin::SwishNode>(swish->input(0).get_source_output(), beta_value);
auto swish_cpu = std::make_shared<ov::intel_cpu::SwishNode>(swish->input(0).get_source_output(), beta_value);
swish_cpu->set_friendly_name(swish->get_friendly_name());
ngraph::copy_runtime_info(swish, swish_cpu);
ngraph::replace_node(swish, swish_cpu);

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ConvertToSwishCPU: public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ConvertToSwishCPU();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -11,12 +11,12 @@
#include "transformations/utils/utils.hpp"
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::FullyConnectedBiasFusion, "FullyConnectedBiasFusion", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::FullyConnectedBiasFusion, "FullyConnectedBiasFusion", 0);
MKLDNNPlugin::FullyConnectedBiasFusion::FullyConnectedBiasFusion() {
ov::intel_cpu::FullyConnectedBiasFusion::FullyConnectedBiasFusion() {
auto input = ngraph::pattern::any_input();
auto weights = ngraph::pattern::any_input(ngraph::pattern::has_static_shape());
auto m_fc = ngraph::pattern::wrap_type<MKLDNNPlugin::FullyConnectedNode>({ input, weights }, [](ngraph::Output<ngraph::Node> output) {
auto m_fc = ngraph::pattern::wrap_type<ov::intel_cpu::FullyConnectedNode>({ input, weights }, [](ngraph::Output<ngraph::Node> output) {
return ngraph::pattern::consumers_count(1)(output) && ngraph::pattern::has_static_rank()(output);
});
auto m_bias = ngraph::pattern::any_input(ngraph::pattern::has_static_shape());
@@ -27,7 +27,7 @@ MKLDNNPlugin::FullyConnectedBiasFusion::FullyConnectedBiasFusion() {
auto add = pattern_to_output[m_add].get_node_shared_ptr();
auto bias = pattern_to_output[m_bias].get_node_shared_ptr();
auto fc = std::dynamic_pointer_cast<MKLDNNPlugin::FullyConnectedNode>(pattern_to_output[m_fc].get_node_shared_ptr());
auto fc = std::dynamic_pointer_cast<ov::intel_cpu::FullyConnectedNode>(pattern_to_output[m_fc].get_node_shared_ptr());
if (!fc || transformation_callback(fc)) {
return false;
}
@@ -57,7 +57,7 @@ MKLDNNPlugin::FullyConnectedBiasFusion::FullyConnectedBiasFusion() {
new_ops.push_back(final_bias);
}
auto new_fc = std::make_shared<MKLDNNPlugin::FullyConnectedNode>(fc->input_value(0),
auto new_fc = std::make_shared<ov::intel_cpu::FullyConnectedNode>(fc->input_value(0),
fc->input_value(1),
final_bias,
fc->get_output_rank(),

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class FullyConnectedBiasFusion : public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
FullyConnectedBiasFusion();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -13,7 +13,7 @@
#include <ngraph/pattern/op/wrap_type.hpp>
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::MoveEltwiseUpThroughDataMov, "MoveEltwiseUpThroughDataMov", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::MoveEltwiseUpThroughDataMov, "MoveEltwiseUpThroughDataMov", 0);
namespace {
bool is_data_movement_operation(const std::shared_ptr<ngraph::Node>& node) {
@@ -39,7 +39,7 @@ namespace {
}
} // namespace
MKLDNNPlugin::MoveEltwiseUpThroughDataMov::MoveEltwiseUpThroughDataMov() {
ov::intel_cpu::MoveEltwiseUpThroughDataMov::MoveEltwiseUpThroughDataMov() {
auto eltwise_pattern = ngraph::pattern::wrap_type<ngraph::op::util::UnaryElementwiseArithmetic,
ngraph::op::util::BinaryElementwiseArithmetic>(ngraph::pattern::has_static_rank());

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class MoveEltwiseUpThroughDataMov : public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
MoveEltwiseUpThroughDataMov();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,7 +4,7 @@
#include "fully_connected.hpp"
MKLDNNPlugin::FullyConnectedNode::FullyConnectedNode(const ngraph::Output<Node>& A,
ov::intel_cpu::FullyConnectedNode::FullyConnectedNode(const ngraph::Output<Node>& A,
const ngraph::Output<Node>& B,
const ngraph::Rank& output_rank,
const ngraph::element::Type output_type)
@@ -12,7 +12,7 @@ MKLDNNPlugin::FullyConnectedNode::FullyConnectedNode(const ngraph::Output<Node>&
validate_and_infer_types();
}
MKLDNNPlugin::FullyConnectedNode::FullyConnectedNode(const ngraph::Output<Node>& A,
ov::intel_cpu::FullyConnectedNode::FullyConnectedNode(const ngraph::Output<Node>& A,
const ngraph::Output<Node>& B,
const ngraph::Output<Node>& C,
const ngraph::Rank& output_rank,
@@ -21,18 +21,18 @@ MKLDNNPlugin::FullyConnectedNode::FullyConnectedNode(const ngraph::Output<Node>&
validate_and_infer_types();
}
std::shared_ptr<ngraph::Node> MKLDNNPlugin::FullyConnectedNode::clone_with_new_inputs(const ngraph::OutputVector& new_args) const {
std::shared_ptr<ngraph::Node> ov::intel_cpu::FullyConnectedNode::clone_with_new_inputs(const ngraph::OutputVector& new_args) const {
check_new_args_count(this, new_args);
if (new_args.size() == 2) {
return std::make_shared<MKLDNNPlugin::FullyConnectedNode>(new_args.at(0), new_args.at(1), m_output_rank, m_output_type);
return std::make_shared<ov::intel_cpu::FullyConnectedNode>(new_args.at(0), new_args.at(1), m_output_rank, m_output_type);
} else if (new_args.size() == 3) {
return std::make_shared<MKLDNNPlugin::FullyConnectedNode>(new_args.at(0), new_args.at(1), new_args.at(2), m_output_rank, m_output_type);
return std::make_shared<ov::intel_cpu::FullyConnectedNode>(new_args.at(0), new_args.at(1), new_args.at(2), m_output_rank, m_output_type);
}
throw ngraph::ngraph_error("Unsupported number of arguments for FullyConnected operation");
}
void MKLDNNPlugin::FullyConnectedNode::validate_and_infer_types() {
void ov::intel_cpu::FullyConnectedNode::validate_and_infer_types() {
const auto input_size = get_input_size();
NODE_VALIDATION_CHECK(this,
input_size == 2 || input_size == 3,
@@ -93,7 +93,7 @@ void MKLDNNPlugin::FullyConnectedNode::validate_and_infer_types() {
set_output_type(0, output_type, output_pshape);
}
bool MKLDNNPlugin::FullyConnectedNode::visit_attributes(ngraph::AttributeVisitor &visitor) {
bool ov::intel_cpu::FullyConnectedNode::visit_attributes(ngraph::AttributeVisitor &visitor) {
visitor.on_attribute("out-rank", m_output_rank);
visitor.on_attribute("out-type", m_output_type);
return true;

View File

@@ -7,7 +7,8 @@
#include <ngraph/node.hpp>
#include <ngraph/op/op.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class FullyConnectedNode : public ngraph::op::Op {
public:
@@ -40,4 +41,5 @@ private:
ngraph::element::Type m_output_type;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,26 +4,26 @@
#include "leaky_relu.hpp"
MKLDNNPlugin::LeakyReluNode::LeakyReluNode(const ngraph::Output<ngraph::Node> &data,
ov::intel_cpu::LeakyReluNode::LeakyReluNode(const ngraph::Output<ngraph::Node> &data,
const float &negative_slope,
const ngraph::element::Type output_type)
: Op({data}), m_negative_slope(negative_slope), m_output_type(output_type) {
validate_and_infer_types();
}
std::shared_ptr<ngraph::Node> MKLDNNPlugin::LeakyReluNode::clone_with_new_inputs(const ngraph::OutputVector& new_args) const {
std::shared_ptr<ngraph::Node> ov::intel_cpu::LeakyReluNode::clone_with_new_inputs(const ngraph::OutputVector& new_args) const {
check_new_args_count(this, new_args);
return std::make_shared<MKLDNNPlugin::LeakyReluNode>(new_args.at(0), m_negative_slope, m_output_type);
return std::make_shared<ov::intel_cpu::LeakyReluNode>(new_args.at(0), m_negative_slope, m_output_type);
}
void MKLDNNPlugin::LeakyReluNode::validate_and_infer_types() {
void ov::intel_cpu::LeakyReluNode::validate_and_infer_types() {
set_output_type(
0,
m_output_type == ngraph::element::undefined ? get_input_element_type(0) : m_output_type,
get_input_partial_shape(0));
}
bool MKLDNNPlugin::LeakyReluNode::visit_attributes(ngraph::AttributeVisitor &visitor) {
bool ov::intel_cpu::LeakyReluNode::visit_attributes(ngraph::AttributeVisitor &visitor) {
visitor.on_attribute("negative_slope", m_negative_slope);
visitor.on_attribute("out-type", m_output_type);
return true;

View File

@@ -6,7 +6,8 @@
#include <ngraph/op/op.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class LeakyReluNode : public ngraph::op::Op {
public:
@@ -31,4 +32,5 @@ private:
ngraph::element::Type m_output_type;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,7 +4,7 @@
#include "power_static.hpp"
MKLDNNPlugin::PowerStaticNode::PowerStaticNode(const ngraph::Output<Node> &data,
ov::intel_cpu::PowerStaticNode::PowerStaticNode(const ngraph::Output<Node> &data,
const float &power,
const float &scale,
const float &shift,
@@ -13,19 +13,19 @@ MKLDNNPlugin::PowerStaticNode::PowerStaticNode(const ngraph::Output<Node> &data,
validate_and_infer_types();
}
std::shared_ptr<ngraph::Node> MKLDNNPlugin::PowerStaticNode::clone_with_new_inputs(const ngraph::OutputVector &new_args) const {
std::shared_ptr<ngraph::Node> ov::intel_cpu::PowerStaticNode::clone_with_new_inputs(const ngraph::OutputVector &new_args) const {
if (new_args.size() != 1) {
throw ngraph::ngraph_error("Incorrect number of new arguments");
}
return std::make_shared<MKLDNNPlugin::PowerStaticNode>(new_args.at(0), this->power, this->scale, this->shift, this->m_output_type);
return std::make_shared<ov::intel_cpu::PowerStaticNode>(new_args.at(0), this->power, this->scale, this->shift, this->m_output_type);
}
void MKLDNNPlugin::PowerStaticNode::validate_and_infer_types() {
void ov::intel_cpu::PowerStaticNode::validate_and_infer_types() {
set_output_type(0, m_output_type == ngraph::element::undefined ? get_input_element_type(0) : m_output_type, get_input_partial_shape(0));
}
bool MKLDNNPlugin::PowerStaticNode::visit_attributes(ngraph::AttributeVisitor &visitor) {
bool ov::intel_cpu::PowerStaticNode::visit_attributes(ngraph::AttributeVisitor &visitor) {
visitor.on_attribute("scale", scale);
visitor.on_attribute("power", power);
visitor.on_attribute("shift", shift);

View File

@@ -6,7 +6,8 @@
#include <ngraph/op/op.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class PowerStaticNode : public ngraph::op::Op {
public:
@@ -32,4 +33,5 @@ private:
ngraph::element::Type m_output_type;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -4,26 +4,26 @@
#include "swish_cpu.hpp"
MKLDNNPlugin::SwishNode::SwishNode(const ngraph::Output<ngraph::Node> & input, const float alpha)
ov::intel_cpu::SwishNode::SwishNode(const ngraph::Output<ngraph::Node> & input, const float alpha)
: Op({input}), m_alpha(alpha) {
validate_and_infer_types();
}
std::shared_ptr<ngraph::Node> MKLDNNPlugin::SwishNode::clone_with_new_inputs(const ngraph::OutputVector& new_args) const {
std::shared_ptr<ngraph::Node> ov::intel_cpu::SwishNode::clone_with_new_inputs(const ngraph::OutputVector& new_args) const {
check_new_args_count(this, new_args);
return std::make_shared<MKLDNNPlugin::SwishNode>(new_args.at(0), m_alpha);
return std::make_shared<ov::intel_cpu::SwishNode>(new_args.at(0), m_alpha);
}
bool MKLDNNPlugin::SwishNode::visit_attributes(ngraph::AttributeVisitor& visitor) {
bool ov::intel_cpu::SwishNode::visit_attributes(ngraph::AttributeVisitor& visitor) {
visitor.on_attribute("alpha", m_alpha);
return true;
}
void MKLDNNPlugin::SwishNode::validate_and_infer_types() {
void ov::intel_cpu::SwishNode::validate_and_infer_types() {
set_output_type(0, get_input_element_type(0), get_input_partial_shape(0));
}
float MKLDNNPlugin::SwishNode::get_alpha() const {
float ov::intel_cpu::SwishNode::get_alpha() const {
return m_alpha;
}

View File

@@ -6,7 +6,8 @@
#include <ngraph/op/op.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class SwishNode : public ngraph::op::Op {
public:
@@ -26,4 +27,5 @@ protected:
float m_alpha;
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -10,20 +10,20 @@
#include <ngraph/pattern/op/wrap_type.hpp>
#include <ngraph/pattern/op/or.hpp>
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ReshapeFullyConnectedFusion, "ReshapeFullyConnectedFusion", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ReshapeFullyConnectedFusion, "ReshapeFullyConnectedFusion", 0);
MKLDNNPlugin::ReshapeFullyConnectedFusion::ReshapeFullyConnectedFusion() {
ov::intel_cpu::ReshapeFullyConnectedFusion::ReshapeFullyConnectedFusion() {
auto m_reshape = ngraph::pattern::wrap_type<ngraph::opset1::Reshape>({ngraph::pattern::any_input(ov::pass::pattern::has_static_shape()),
ngraph::pattern::any_input()},
ngraph::pattern::has_static_shape());
ngraph::OutputVector twoInputs = {m_reshape, ngraph::pattern::any_input()};
ngraph::OutputVector threeInputs = {m_reshape, ngraph::pattern::any_input(), ngraph::pattern::any_input()};
auto fcTwoInputs = ngraph::pattern::wrap_type<MKLDNNPlugin::FullyConnectedNode>(twoInputs, ngraph::pattern::has_static_shape());
auto fcThreeInputs = ngraph::pattern::wrap_type<MKLDNNPlugin::FullyConnectedNode>(threeInputs, ngraph::pattern::has_static_shape());
auto fcTwoInputs = ngraph::pattern::wrap_type<ov::intel_cpu::FullyConnectedNode>(twoInputs, ngraph::pattern::has_static_shape());
auto fcThreeInputs = ngraph::pattern::wrap_type<ov::intel_cpu::FullyConnectedNode>(threeInputs, ngraph::pattern::has_static_shape());
const auto fcTwoOrThreeInputs = std::make_shared<ngraph::pattern::op::Or>(ngraph::OutputVector{fcTwoInputs, fcThreeInputs});
ngraph::matcher_pass_callback callback = [this](ngraph::pattern::Matcher &m) {
auto fc = std::dynamic_pointer_cast<MKLDNNPlugin::FullyConnectedNode>(m.get_match_root());
auto fc = std::dynamic_pointer_cast<ov::intel_cpu::FullyConnectedNode>(m.get_match_root());
if (!fc)
return false;
auto reshape = std::dynamic_pointer_cast<ngraph::opset1::Reshape>(fc->get_input_node_shared_ptr(0));
@@ -63,12 +63,12 @@ MKLDNNPlugin::ReshapeFullyConnectedFusion::ReshapeFullyConnectedFusion() {
std::shared_ptr<ngraph::Node> new_fc;
if (fc->get_input_size() == 2) {
new_fc = std::make_shared<MKLDNNPlugin::FullyConnectedNode>(reshape->input_value(0),
new_fc = std::make_shared<ov::intel_cpu::FullyConnectedNode>(reshape->input_value(0),
weightInput,
ngraph::Rank(outShape.size()),
fc->output(0).get_element_type());
} else if (fc->get_input_size() == 3) {
new_fc = std::make_shared<MKLDNNPlugin::FullyConnectedNode>(reshape->input_value(0),
new_fc = std::make_shared<ov::intel_cpu::FullyConnectedNode>(reshape->input_value(0),
weightInput,
fc->input_value(2),
ngraph::Rank(outShape.size()),

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ReshapeFullyConnectedFusion : public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ReshapeFullyConnectedFusion();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

View File

@@ -9,9 +9,9 @@
#include <ngraph/pattern/op/wrap_type.hpp>
#include "transformations/utils/utils.hpp"
NGRAPH_RTTI_DEFINITION(MKLDNNPlugin::ReshapePRelu, "ReshapePRelu", 0);
NGRAPH_RTTI_DEFINITION(ov::intel_cpu::ReshapePRelu, "ReshapePRelu", 0);
MKLDNNPlugin::ReshapePRelu::ReshapePRelu() {
ov::intel_cpu::ReshapePRelu::ReshapePRelu() {
auto input_m = ngraph::pattern::any_input(ngraph::pattern::has_static_rank());
auto slope_m = ngraph::pattern::any_input(ngraph::pattern::has_static_rank());
auto prelu_m = ngraph::pattern::wrap_type<ngraph::opset1::PRelu>({ input_m, slope_m });

View File

@@ -6,7 +6,8 @@
#include <ngraph/pass/graph_rewrite.hpp>
namespace MKLDNNPlugin {
namespace ov {
namespace intel_cpu {
class ReshapePRelu: public ngraph::pass::MatcherPass {
public:
@@ -14,4 +15,5 @@ public:
ReshapePRelu();
};
} // namespace MKLDNNPlugin
} // namespace intel_cpu
} // namespace ov

Some files were not shown because too many files have changed in this diff Show More