Skip to content

Commit c8b6dca

Browse files
committed
Add F16SET/F16CNT debug cap env
1 parent f5972d2 commit c8b6dca

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/plugins/intel_cpu/src/graph.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,9 @@ bool Graph::InsertNode(NodePtr parent, NodePtr child, NodePtr node, int parentPo
14961496

14971497
// Set all non const data paths precision to BF16
14981498
void Graph::EnforceInferencePrecision() {
1499+
CPU_DEBUG_CAP_ENABLE(static std::string F16SET = std::getenv("F16SET"));
1500+
CPU_DEBUG_CAP_ENABLE(static int F16CNT = atoi(std::getenv("F16CNT") ? std::getenv("F16CNT") : "9999999"));
1501+
CPU_DEBUG_CAP_ENABLE(static int f16cnt = 0);
14991502
auto inferPrec = InferenceEngine::Precision::FP32;
15001503
switch (getConfig().inferencePrecision) {
15011504
case ov::element::bf16:
@@ -1538,7 +1541,8 @@ void Graph::EnforceInferencePrecision() {
15381541
Type::Deconvolution, // deconv
15391542
Type::FullyConnected, // conv / bert nets
15401543
Type::MatMul, // bert nets
1541-
Type::Pooling))
1544+
Type::Pooling,
1545+
Type::MVN))
15421546
continue; // stop at significant nodes
15431547
}
15441548

@@ -1568,6 +1572,17 @@ void Graph::EnforceInferencePrecision() {
15681572
// FP16 is only implemented on limited types of node.
15691573
// TODO:
15701574
// Eltwise : fused is supported, need to support standalone
1575+
#ifdef CPU_DEBUG_CAPS
1576+
if (inferPrec == InferenceEngine::Precision::FP16 &&
1577+
F16SET.find(NameFromType(node->getType()) + ",") != std::string::npos) {
1578+
if (f16cnt < F16CNT) {
1579+
std::cout << " f16cnt [" << f16cnt << "] : " << NameFromType(node->getType()) << " " << node->getName() << std::endl;
1580+
f16cnt++;
1581+
} else {
1582+
continue;
1583+
}
1584+
}
1585+
#endif
15711586
if (inferPrec == InferenceEngine::Precision::FP16 && !one_of(node->getType(),
15721587
Type::Reorder,
15731588
Type::Convolution,

src/plugins/intel_cpu/src/utils/debug_capabilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ std::ostream & operator<<(std::ostream & os, const Node &c_node) {
241241
} else {
242242
// no SPD yet, use orginal shapes
243243
comma = "";
244-
for (int i = 0; i < num_output_port; i++) {
244+
for (int i = 0; i < node.getOriginalOutputPrecisions().size(); i++) {
245245
auto shape = node.getOutputShapeAtPort(i);
246246
std::string prec_name = "Undef";
247247
prec_name = node.getOriginalOutputPrecisionAtPort(i).name();

0 commit comments

Comments
 (0)