From 1d3dc4b09d888b2ee1ab22c67419fa244daf415e Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Tue, 4 Feb 2025 19:20:57 +0100 Subject: [PATCH] Address review comments --- src/plugins/intel_cpu/src/nodes/bin_conv.cpp | 2 +- src/plugins/intel_cpu/src/nodes/conv.cpp | 4 ++-- src/plugins/intel_cpu/src/nodes/embedding_bag_packed.cpp | 2 +- src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp | 2 +- src/plugins/intel_cpu/src/nodes/grid_sample.cpp | 2 +- src/plugins/intel_cpu/src/nodes/interpolate.cpp | 4 ++-- src/plugins/intel_cpu/src/nodes/inverse.cpp | 2 +- src/plugins/intel_cpu/src/nodes/llm_mlp.cpp | 2 +- src/plugins/intel_cpu/src/nodes/multinomial.cpp | 2 +- src/plugins/intel_cpu/src/nodes/mvn.cpp | 2 +- src/plugins/intel_cpu/src/nodes/ngram.cpp | 2 +- src/plugins/intel_cpu/src/nodes/paged_attn.cpp | 2 +- src/plugins/intel_cpu/src/nodes/pooling.cpp | 2 +- src/plugins/intel_cpu/src/nodes/qkv_proj.cpp | 2 +- src/plugins/intel_cpu/src/nodes/random_uniform.cpp | 2 +- src/plugins/intel_cpu/src/nodes/rdft.h | 1 - src/plugins/intel_cpu/src/nodes/rms_norm.cpp | 2 +- src/plugins/intel_cpu/src/nodes/rope.cpp | 2 +- src/plugins/intel_cpu/src/nodes/scaled_attn.cpp | 2 +- src/plugins/intel_cpu/src/nodes/stft.cpp | 2 +- src/plugins/intel_cpu/src/nodes/transpose.cpp | 2 +- 21 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/bin_conv.cpp b/src/plugins/intel_cpu/src/nodes/bin_conv.cpp index 8184927f272131..370bdea66aad81 100644 --- a/src/plugins/intel_cpu/src/nodes/bin_conv.cpp +++ b/src/plugins/intel_cpu/src/nodes/bin_conv.cpp @@ -1084,7 +1084,7 @@ void BinaryConvolution::initSupportedPrimitiveDescriptors() { void BinaryConvolution::createPrimitive() { auto selectedPrimitiveDescriptor = getSelectedPrimitiveDescriptor(); if (!selectedPrimitiveDescriptor) { - THROW_CPU_NODE_ERR("CPU binary convolution with name '", getName(), "' doesn't have primitive descriptors."); + THROW_CPU_NODE_ERR("doesn't have primitive descriptors."); } auto srcDims = getParentEdgeAt(0)->getMemory().getStaticDims(); diff --git a/src/plugins/intel_cpu/src/nodes/conv.cpp b/src/plugins/intel_cpu/src/nodes/conv.cpp index db7541fa22902d..70abb0aec191c9 100644 --- a/src/plugins/intel_cpu/src/nodes/conv.cpp +++ b/src/plugins/intel_cpu/src/nodes/conv.cpp @@ -420,7 +420,7 @@ void Convolution::getSupportedDescriptors() { return; } if (!attrs.empty()) { - THROW_CPU_NODE_ERR("has not empty attrs vector"); + THROW_CPU_NODE_ERR("has a non-empty attrs vector"); } attrs.reserve(2); @@ -1363,7 +1363,7 @@ void Convolution::prepareParams() { const NodeDesc* selected_pd = getSelectedPrimitiveDescriptor(); if (selected_pd == nullptr) { - THROW_CPU_NODE_ERR("Preferable primitive descriptor is not set for node ", getName(), "."); + THROW_CPU_NODE_ERR("Preferable primitive descriptor is not set."); } DnnlMemoryDescCPtr inMemoryDesc = srcMemPtr->getDescWithType(); diff --git a/src/plugins/intel_cpu/src/nodes/embedding_bag_packed.cpp b/src/plugins/intel_cpu/src/nodes/embedding_bag_packed.cpp index 0478a4483e96a8..2becb7e2635020 100644 --- a/src/plugins/intel_cpu/src/nodes/embedding_bag_packed.cpp +++ b/src/plugins/intel_cpu/src/nodes/embedding_bag_packed.cpp @@ -54,7 +54,7 @@ EmbeddingBagPacked::EmbeddingBagPacked(const std::shared_ptr& op, cons } } if (getInputShapeAtPort(INDICES_IDX).getRank() != 2ul) { - THROW_CPU_NODE_ERR("layer has indices data with invalid rank."); + THROW_CPU_NODE_ERR("has indices data with invalid rank."); } } diff --git a/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp b/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp index 55c424f5b4a418..8193b26077f892 100644 --- a/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp +++ b/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp @@ -466,7 +466,7 @@ void ExtractImagePatches::execute(const dnnl::stream& strm) { const auto outStrides = getChildEdgeAt(0)->getMemory().getDescWithType()->getStrides(); execPtr->exec(src, dst, inStrides, outStrides); } else { - THROW_CPU_NODE_ERR("Can't execute extract image patches node. Primitive wasn't created"); + THROW_CPU_NODE_ERR("Primitive wasn't created"); } } diff --git a/src/plugins/intel_cpu/src/nodes/grid_sample.cpp b/src/plugins/intel_cpu/src/nodes/grid_sample.cpp index 46732779df879f..aeca249f3a760a 100644 --- a/src/plugins/intel_cpu/src/nodes/grid_sample.cpp +++ b/src/plugins/intel_cpu/src/nodes/grid_sample.cpp @@ -41,7 +41,7 @@ GridSample::GridSample(const std::shared_ptr& op, const GraphContext:: : Node(op, context, NgraphShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } if (op->get_input_size() != 2 || op->get_output_size() != 1) { diff --git a/src/plugins/intel_cpu/src/nodes/interpolate.cpp b/src/plugins/intel_cpu/src/nodes/interpolate.cpp index 15ce525dc20a04..72dece52591356 100644 --- a/src/plugins/intel_cpu/src/nodes/interpolate.cpp +++ b/src/plugins/intel_cpu/src/nodes/interpolate.cpp @@ -2465,7 +2465,7 @@ void Interpolate::prepareParams() { std::vector dataScales = getScales(getPaddedInputShape(srcDims, interpAttrs.padBegin, interpAttrs.padEnd), dstDims); if (!NCHWAsNHWC && (getOutputShapeAtPort(0).getRank() > 2 && (dataScales[0] != 1.f || dataScales[1] != 1.f))) { - THROW_CPU_NODE_ERR("Interpolate layer only supports resize on spatial dimensions(depth, height and width)"); + THROW_CPU_NODE_ERR("only supports resize on spatial dimensions(depth, height and width)"); } if (canUseAclExecutor) { @@ -2724,7 +2724,7 @@ void Interpolate::execute(const dnnl::stream& strm) { } else if (aclExecPtr) { aclExecPtr->exec({srcMemPtr}, {dstMemPtr}, postOpsDataPtrs.data()); } else { - THROW_CPU_NODE_ERR("Primitive didn't created"); + THROW_CPU_NODE_ERR("Primitive wasn't created"); } } diff --git a/src/plugins/intel_cpu/src/nodes/inverse.cpp b/src/plugins/intel_cpu/src/nodes/inverse.cpp index 25f54cb5283847..751a55add5de37 100644 --- a/src/plugins/intel_cpu/src/nodes/inverse.cpp +++ b/src/plugins/intel_cpu/src/nodes/inverse.cpp @@ -19,7 +19,7 @@ Inverse::Inverse(const std::shared_ptr& op, const GraphContext::CPtr& : Node(op, context, NgraphShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } auto inverse_op = as_type_ptr(op); diff --git a/src/plugins/intel_cpu/src/nodes/llm_mlp.cpp b/src/plugins/intel_cpu/src/nodes/llm_mlp.cpp index 1d553e2bfd7835..73425c58b65435 100644 --- a/src/plugins/intel_cpu/src/nodes/llm_mlp.cpp +++ b/src/plugins/intel_cpu/src/nodes/llm_mlp.cpp @@ -504,7 +504,7 @@ LLMMLP::LLMMLP(const std::shared_ptr& op, const GraphContext::CPtr& co std::string errorMessage; const auto& config = context->getConfig(); if (!isSupportedOperation(op, errorMessage, config.fcDynamicQuantizationGroupSize)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } const auto node_mlp = ov::as_type_ptr(op); m_mlp_config = node_mlp->get_config(); diff --git a/src/plugins/intel_cpu/src/nodes/multinomial.cpp b/src/plugins/intel_cpu/src/nodes/multinomial.cpp index e7ed2d1b8e199f..7802a847f275ba 100644 --- a/src/plugins/intel_cpu/src/nodes/multinomial.cpp +++ b/src/plugins/intel_cpu/src/nodes/multinomial.cpp @@ -18,7 +18,7 @@ Multinomial::Multinomial(const std::shared_ptr& op, const GraphContext : Node(op, context, NgraphShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } auto multinomial_op = as_type_ptr(op); diff --git a/src/plugins/intel_cpu/src/nodes/mvn.cpp b/src/plugins/intel_cpu/src/nodes/mvn.cpp index b9794c914ff9dd..9cff2cbaa01d7b 100644 --- a/src/plugins/intel_cpu/src/nodes/mvn.cpp +++ b/src/plugins/intel_cpu/src/nodes/mvn.cpp @@ -2319,7 +2319,7 @@ void MVN::execute(const dnnl::stream& strm) { } else if (aclExecPtr) { aclExecPtr->exec({srcMemPtr}, {dstMemPtr}, postOpsDataPtrs.data()); } else { - THROW_CPU_NODE_ERR("Primitive didn't created"); + THROW_CPU_NODE_ERR("Primitive wasn't created"); } } diff --git a/src/plugins/intel_cpu/src/nodes/ngram.cpp b/src/plugins/intel_cpu/src/nodes/ngram.cpp index 6599099e9bd75f..0646e71d378c06 100644 --- a/src/plugins/intel_cpu/src/nodes/ngram.cpp +++ b/src/plugins/intel_cpu/src/nodes/ngram.cpp @@ -109,7 +109,7 @@ void Ngram::execute(const dnnl::stream& strm) { } else if (idcesPrecision == ov::element::i64) { batchLenghts = computeBatchLenghts(); } else { - THROW_CPU_NODE_ERR("Unsupported idces precision: ", idcesPrecision); + THROW_CPU_NODE_ERR("Unsupported indices precision: ", idcesPrecision); } /* The following procedure applied to each batch: diff --git a/src/plugins/intel_cpu/src/nodes/paged_attn.cpp b/src/plugins/intel_cpu/src/nodes/paged_attn.cpp index 73964799c0d08e..30a7439f0c91b8 100644 --- a/src/plugins/intel_cpu/src/nodes/paged_attn.cpp +++ b/src/plugins/intel_cpu/src/nodes/paged_attn.cpp @@ -56,7 +56,7 @@ PagedAttention::PagedAttention(const std::shared_ptr& op, const GraphC : Node(op, context, InternalDynShapeInferFactory()) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } // output score may have no child m_hasScore = !op->get_output_target_inputs(1).empty(); diff --git a/src/plugins/intel_cpu/src/nodes/pooling.cpp b/src/plugins/intel_cpu/src/nodes/pooling.cpp index b2ee8f124bbebd..a7e128e449f960 100644 --- a/src/plugins/intel_cpu/src/nodes/pooling.cpp +++ b/src/plugins/intel_cpu/src/nodes/pooling.cpp @@ -507,7 +507,7 @@ void Pooling::prepareParams() { dnnlExecPtr = result.first; if (!dnnlExecPtr) { - THROW_CPU_NODE_ERR("Primitive descriptor was not found for node ", getName(), "."); + THROW_CPU_NODE_ERR("Primitive descriptor was not found."); } auto scratchpadMem = getScratchPadMem(dnnlExecPtr->getScratchPadDesc()); diff --git a/src/plugins/intel_cpu/src/nodes/qkv_proj.cpp b/src/plugins/intel_cpu/src/nodes/qkv_proj.cpp index 2d25eeb6580df5..55dbc20c1bd946 100644 --- a/src/plugins/intel_cpu/src/nodes/qkv_proj.cpp +++ b/src/plugins/intel_cpu/src/nodes/qkv_proj.cpp @@ -348,7 +348,7 @@ QKVProjection::QKVProjection(const std::shared_ptr& op, const GraphCon } if (!isSupportedOperation(op, errorMessage, concurrency, config.fcDynamicQuantizationGroupSize)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } const auto node = ov::as_type_ptr(op); m_config = node->get_config(); diff --git a/src/plugins/intel_cpu/src/nodes/random_uniform.cpp b/src/plugins/intel_cpu/src/nodes/random_uniform.cpp index b23a091d28ee8d..bf2e8efa1c1cd9 100644 --- a/src/plugins/intel_cpu/src/nodes/random_uniform.cpp +++ b/src/plugins/intel_cpu/src/nodes/random_uniform.cpp @@ -41,7 +41,7 @@ RandomUniform::RandomUniform(const std::shared_ptr& op, const GraphCon : Node(op, context, NgraphShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } // RandomUniform should generate new sequence each run even if all inputs are constants. So that method diff --git a/src/plugins/intel_cpu/src/nodes/rdft.h b/src/plugins/intel_cpu/src/nodes/rdft.h index e8990e383d8ff3..df7755751ec6ac 100644 --- a/src/plugins/intel_cpu/src/nodes/rdft.h +++ b/src/plugins/intel_cpu/src/nodes/rdft.h @@ -118,7 +118,6 @@ class RDFT : public Node { bool needShapeInfer() const override; bool needPrepareParams() const override; - std::string errorMsgPrefix; bool inverse; std::vector axes; std::vector signalSizes; diff --git a/src/plugins/intel_cpu/src/nodes/rms_norm.cpp b/src/plugins/intel_cpu/src/nodes/rms_norm.cpp index 652ba42056d957..66b9ae3d3bd803 100644 --- a/src/plugins/intel_cpu/src/nodes/rms_norm.cpp +++ b/src/plugins/intel_cpu/src/nodes/rms_norm.cpp @@ -122,7 +122,7 @@ RMSNorm::RMSNorm(const std::shared_ptr& op, const GraphContext::CPtr& : Node(op, context, RMSNormShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } const auto rms = ov::as_type_ptr(op); m_eps = static_cast(rms->get_epsilon()); diff --git a/src/plugins/intel_cpu/src/nodes/rope.cpp b/src/plugins/intel_cpu/src/nodes/rope.cpp index 58d3221f43519f..f22a5a720752ec 100644 --- a/src/plugins/intel_cpu/src/nodes/rope.cpp +++ b/src/plugins/intel_cpu/src/nodes/rope.cpp @@ -25,7 +25,7 @@ RoPE::RoPE(const std::shared_ptr& op, const GraphContext::CPtr& contex : Node(op, context, NgraphShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } const auto node = ov::as_type_ptr(op); diff --git a/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp b/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp index 16e0f70a891f89..28f56b54151de7 100644 --- a/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp +++ b/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp @@ -1084,7 +1084,7 @@ ScaledDotProductAttention::ScaledDotProductAttention(const std::shared_ptrgetConfig(); const auto& keyCachePrecision = cpuConfig.keyCachePrecision; diff --git a/src/plugins/intel_cpu/src/nodes/stft.cpp b/src/plugins/intel_cpu/src/nodes/stft.cpp index 751891e9c4af7f..be66e4dc9bf70c 100644 --- a/src/plugins/intel_cpu/src/nodes/stft.cpp +++ b/src/plugins/intel_cpu/src/nodes/stft.cpp @@ -33,7 +33,7 @@ STFT::STFT(const std::shared_ptr& op, const GraphContext::CPtr& contex : Node(op, context, NgraphShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { - THROW_CPU_NODE_ERR(errorMessage); + OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage); } const auto stft_op = as_type_ptr(op); diff --git a/src/plugins/intel_cpu/src/nodes/transpose.cpp b/src/plugins/intel_cpu/src/nodes/transpose.cpp index 36beb4a115ebd5..b17333011f6dd1 100644 --- a/src/plugins/intel_cpu/src/nodes/transpose.cpp +++ b/src/plugins/intel_cpu/src/nodes/transpose.cpp @@ -148,7 +148,7 @@ void Transpose::prepareParams() { auto srcDesc = dnnl::memory::desc(dstDesc.get_dims(), dstDesc.get_data_type(), memory::format_tag::acdb); auto result = getReorderPrim(context->getParamsCache(), getEngine(), srcDesc, dstDesc); if (!result) { - THROW_CPU_NODE_ERR("Reorder primitive descriptor was not found for Transpose node ", getName(), "."); + THROW_CPU_NODE_ERR("reorder primitive descriptor was not found."); } prim = result;