diff --git a/src/common/snippets/src/pass/insert_loops.cpp b/src/common/snippets/src/pass/insert_loops.cpp index d594f864d5ccde..ebb836f6ba9309 100644 --- a/src/common/snippets/src/pass/insert_loops.cpp +++ b/src/common/snippets/src/pass/insert_loops.cpp @@ -35,11 +35,7 @@ bool ngraph::snippets::pass::InsertLoops::run_on_model(const std::shared_ptrget_rt_info(); const auto& plugin_shapes = body_rt_info.find("PluginShapesOverride"); if (plugin_shapes == body_rt_info.end()) { - ioShapes.reserve(commonParams.size() + commonResults.size()); - std::transform(commonParams.begin(), commonParams.end(), std::back_inserter(ioShapes), - [](const std::shared_ptr& n) { return n->get_output_partial_shape(0); }); - std::transform(commonResults.begin(), commonResults.end(), std::back_inserter(ioShapes), - [](const std::shared_ptr& n) { return n->get_input_partial_shape(0); }); + throw ngraph_error("InsertLoops requires PluginShapesOverride rt_info field"); } else { const auto& new_shapes = plugin_shapes->second.as>>(); if (new_shapes.size() != commonResults.size() + commonParams.size()) diff --git a/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.cpp b/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.cpp index 6f4a0d79382b14..5f1a52b7e9b3f8 100644 --- a/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.cpp +++ b/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.cpp @@ -134,8 +134,7 @@ KernelEmitter::KernelEmitter(dnnl::impl::cpu::x64::jit_generator* h, dnnl::impl: const auto& model_rt_info = model->get_rt_info(); const auto& plugin_shapes = model_rt_info.find("PluginShapesOverride"); if (plugin_shapes == model_rt_info.end()) { - for (const auto& op : io_nodes) - io_shapes.push_back(get_static_shape(op)); + IE_THROW() << "JIT KernelEmitter requires plugin-overriden shapes in model rt_info"; } else { const auto& new_shapes = plugin_shapes->second.as>>(); if (new_shapes.size() != num_inputs + num_outputs) diff --git a/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.hpp b/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.hpp index 94e974a65f1dd8..68a653db52dc42 100644 --- a/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.hpp +++ b/src/plugins/intel_cpu/src/emitters/jit_snippets_emitters.hpp @@ -33,7 +33,6 @@ struct jit_snippets_call_args { struct jit_snippets_compile_args { std::vector master_shape{}; size_t tile_rank = 0; -// int64_t data_offsets[SNIPPETS_MAX_SNIPPETS_DIMS * SNIPPETS_MAX_HARNESS_DIMS] = {}; }; /// /// \brief jit_container_emitter designed to wrap Emitters that contain other Emitters (for example, KernelEmitter) diff --git a/src/plugins/intel_cpu/src/nodes/subgraph.cpp b/src/plugins/intel_cpu/src/nodes/subgraph.cpp index c5699afcbc1f8b..94552d44947b62 100644 --- a/src/plugins/intel_cpu/src/nodes/subgraph.cpp +++ b/src/plugins/intel_cpu/src/nodes/subgraph.cpp @@ -212,29 +212,6 @@ InferenceEngine::Precision Snippet::getRuntimePrecision() const { return getMaxPrecision(inputPrecisions); } -void Snippet::calcJITParams(std::vector& offsets) const { - const size_t numInputs = normInputShapes.size(); - const size_t numParams = numInputs + normOutputShapes.size(); - - // Note that we don't need offset for the last dim, since it's handled directly by Tile emitter - const size_t offset_rank = masterShape.size() - 1; - offsets.resize(numParams * (offset_rank), 1); - auto offset_calculation = [offset_rank, this](int64_t *off, const std::vector& dims, const size_t data_size) { - size_t k = dims.back(); - for (int i = offset_rank - 1; i >= 0; i--) { -// auto tmp = (dims[i] == masterShape[i] && masterShape[i] != 1) ? k : 0; - // dims could be either master_shape[i] or 1 - auto tmp = (dims[i] != 1) ? k : 0; - off[i] = tmp * data_size; - k *= dims[i]; - } - }; - for (size_t i = 0; i < numParams; i++) { - offset_calculation(&offsets[i * offset_rank], - i < numInputs ? normInputShapes[i] : normOutputShapes[i - numInputs], - dataSize[i]); - } -} bool Snippet::optimizeExecDomain(std::vector& inputShapes, std::vector& outputShapes, VectorDims &domain, size_t& TileRank) const { const size_t minimalConcurrency = parallel_get_max_threads(); @@ -367,7 +344,6 @@ void Snippet::createPrimitive() { prepareParams(); jcp.master_shape = masterShape; jcp.tile_rank = tileRank; -// std::copy(data_offsets.begin(), data_offsets.end(), jcp.data_offsets); generate(&jcp); } @@ -453,8 +429,6 @@ void Snippet::prepareParams() { } exec_domain = masterShape; - // todo: probably better to pass a call_args instance - calcJITParams(data_offsets); auto initStartMemoryOffsets = [this]() { const auto config = getSelectedPrimitiveDescriptor()->getConfig(); const size_t numInputs = inputShapes.size(); @@ -488,30 +462,12 @@ void Snippet::prepareParams() { dim = 1; } - // Note: if exec domain is updated (dimensions are collapsed) then we need to communicate updated shapes - if (execDomainIsUpdated) { - auto& body_rt_info = snippet->get_body()->get_rt_info(); - std::vector> new_shapes; - std::copy(normInputShapes.begin(), normInputShapes.end(), std::back_inserter(new_shapes)); - std::copy(normOutputShapes.begin(), normOutputShapes.end(), std::back_inserter(new_shapes)); - body_rt_info["PluginShapesOverride"] = new_shapes; - snippet->set_master_shape(ov::PartialShape(masterShape)); - } -// snippet->set_overriden_shapes(new_shapes); - // todo: tileRank should be determined by snippets based on body shapes and operation semantics, not by plugin + auto& body_rt_info = snippet->get_body()->get_rt_info(); + std::vector> new_shapes(normInputShapes); + std::copy(normOutputShapes.begin(), normOutputShapes.end(), std::back_inserter(new_shapes)); + body_rt_info["PluginShapesOverride"] = new_shapes; + snippet->set_master_shape(ov::PartialShape(masterShape)); snippet->tileRank = tileRank; - /* - snippet->set_master_shape(PartialShape(scheduler_work_amounts)); - // If the snippets has domain sensitive ops (e.g. Transpose) then domain optimizations are not performed - // so need only update Parameter and Result shapes so Loops will be appropriately inserted in the snippets::pass::InsertLoops - if (snippet->has_domain_sensitive_ops()) { - for (const auto& s : get_shapes_for_snippet(normOutputShapes, tileRank)) - new_shapes.push_back(s); - snippet->set_overriden_shapes(new_shapes); - } else { - snippet->reshape_body(new_shapes); - } - */ } bool Snippet::needPrepareParams() const { diff --git a/src/plugins/intel_cpu/src/nodes/subgraph.h b/src/plugins/intel_cpu/src/nodes/subgraph.h index 6a8b9bda4ee560..9be60ddc8f4c98 100644 --- a/src/plugins/intel_cpu/src/nodes/subgraph.h +++ b/src/plugins/intel_cpu/src/nodes/subgraph.h @@ -61,7 +61,6 @@ class Snippet : public Node { ov::PartialShape canonicalizeBody(); // returns true if exec domain was modified bool optimizeExecDomain(std::vector&, std::vector&, VectorDims&, size_t&) const; - void calcJITParams(std::vector& offsets) const; void generate(const jit_snippets_compile_args*); void updateSrcDstPtrs(jit_snippets_call_args&) const; @@ -96,7 +95,6 @@ class Snippet : public Node { std::vector dstMemPtrs = {}; std::vector dataSize = {}; - std::vector data_offsets; // this is needed for fast shape inference of blocking-invariant prepended shapes std::vector inputShapeIsBlocked = {}; // we need this info to shape-infer mixed layouts std::vector outputShapeIsBlocked = {}; // we need this info to shape-infer mixed layouts