Skip to content

Commit

Permalink
[CPU]Fix profile graph (openvinotoolkit#23699)
Browse files Browse the repository at this point in the history
### Details:
 - *Fix profile graph construction*

### Tickets:
 - *CVS-136859*
 - openvinotoolkit/openvino.genai#327
  • Loading branch information
zhangYiIntel authored and alvoron committed Apr 29, 2024
1 parent 0c641f9 commit 8237b62
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/plugins/intel_cpu/src/nodes/broadcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ void Broadcast::getSupportedDescriptors() {
void Broadcast::initSupportedPrimitiveDescriptors() {
if (!supportedPrimitiveDescriptors.empty())
return;

supportedPrimitiveDescriptors = getSupportedConfigs(this);
supportedPrimitiveDescriptors = getSupportedConfigs(this, outputShapes.size());
}

bool Broadcast::needPrepareParams() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool TileBroadcastCommon::canBeExecutedInNSPCLayout(VectorDims srcBlockedDims, V
return optimizedDims.size() <= maxNDims;
}

std::vector<NodeDesc> TileBroadcastCommon::getSupportedConfigs(const Node *node) {
std::vector<NodeDesc> TileBroadcastCommon::getSupportedConfigs(const Node *node, size_t outSize) {
std::vector<NodeDesc> supportedPrimitiveDescriptors;
auto precision = node->getOriginalInputPrecisionAtPort(0);
auto dataType = DnnlExtensionUtils::ElementTypeToDataType(precision);
Expand Down Expand Up @@ -122,7 +122,7 @@ std::vector<NodeDesc> TileBroadcastCommon::getSupportedConfigs(const Node *node)
config.inConfs[2].setMemDesc(std::make_shared<CpuBlockedMemoryDesc>(ov::element::i32, node->getInputShapeAtPort(2)));
}

config.outConfs.resize(node->getChildEdges().size());
config.outConfs.resize(outSize);

auto pushDesc = [&](dnnl::memory::format_tag inFormat, dnnl::memory::format_tag outFormat) {
config.inConfs[0].setMemDesc(std::make_shared<DnnlBlockedMemoryDesc>(node->getInputShapeAtPort(0), dataType, inFormat));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace intel_cpu {
class TileBroadcastCommon {
protected:
static VectorDims calculateDenseStrides(const VectorDims &dims);
std::vector<NodeDesc> getSupportedConfigs(const Node *node);
std::vector<NodeDesc> getSupportedConfigs(const Node *node, size_t outSize);
bool prepareOptimizedParams(const Node *node, VectorDims& srcBlockedDims, VectorDims& dstBlockedDims);

void optimizedExecute(const MemoryPtr& srcMemory, const MemoryPtr& dstMemory);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/nodes/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void Tile::initSupportedPrimitiveDescriptors() {
if (!supportedPrimitiveDescriptors.empty())
return;

supportedPrimitiveDescriptors = getSupportedConfigs(this);
supportedPrimitiveDescriptors = getSupportedConfigs(this, outputShapes.size());
}

bool Tile::needPrepareParams() const {
Expand Down

0 comments on commit 8237b62

Please sign in to comment.