← Back to Pull requests

[CPU][x64] Drop exec_prc from the remaining node-based eltwise emitter constructors #40068

Merged
arshil42 merged 3 files (235 lines) on Nov 24, 2026 17:57 UTC
View on GitHub
arshil42 arshil42 commented on Nov 19, 2026 14:44 UTC
Author

Details:


- Follow-up to #39683, as discussed in its review: the remaining x64 eltwise emitter constructors that take a node no longer take an exec_prc defaulting to f32. That default is how the node's precision was ignored in the SquaredDifference bug fixed by #39683.
- The f32-only emitters (Floor, Ceiling, FloorMod, Mod, PowerDynamic, PowerStatic, LogicalAnd/Or/Xor/Not, PRelu, Sqrt, Negative, Exp, Erf, SoftSign, ErfInv, IsInf) pass f32 explicitly; f32 is the only precision each of them supports.
- jit_bitwise_and/or/xor/not_emitter take the precision from the node through get_arithmetic_binary_exec_precision(). jit_select_emitter takes the node's output type, because its condition input is boolean and the helper requires equal input precisions.
- No behavior change is expected: on x64 these constructors are only called through EmitterFactory::from_node(), which never passed a precision, and none of these emitters reads exec_prc_ when generating code. The precision-only constructors used by the Eltwise node are unchanged.

Validation:


Run on Windows with an Intel Core i5-12450HX (AVX2, no AVX-512), using a local Release build.
- ov_cpu_func_tests filtered to Snippets, Select, IsInf, activation, EltwiseChain, eltwise and bitwise tests: 10345 ran, 7599 passed, the rest skipped by configuration, 0 failed.
- clang-format clean.

Tickets:


- N/A

AI Assistance:


- AI assistance used: yes
- An AI coding agent was used to find the remaining constructors, check their call sites and supported precisions, make the change and draft this description.
- Validation performed: the local build and tests listed above, run on my machine.

Diff: 235 lines (+90 / -145) across 3 files Reviewer: v-Golubev Review duration: 7393m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.39) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 235 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.90 · 5 substantive comment(s)
0.90
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
91%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.327
Real PR Conversation Timeline
11 items
v-Golubev v-Golubev commented on Nov 23, 2026 09:46 UTC
Contributor

build_jenkins

v-Golubev v-Golubev commented on code on Nov 23, 2026 14:53 UTC
Code Review
src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.cpp:1
@@ -2936,9 +2918,8 @@ void jit_is_nan_emitter::register_table_entries() {
 /// SELECT ///
 jit_select_emitter::jit_select_emitter(x64::jit_generator_t* host,
                                        x64::cpu_isa_t host_isa,
-                                       [[maybe_unused]] const std::shared_ptr<ov::Node>& node,
-                                       ov::element::Type exec_prc)
-    : jit_emitter(host, host_isa, exec_prc) {}
+                                       const std::shared_ptr<ov::Node>& node)
+    : jit_emitter(host, host_isa, node->get_output_element_type(0)) {}

Can we use get_arithmetic_binary_exec_precision(node) here, as the aarch64 and riscv64 select emitters do? The supported precisions are all-f32 or all-i32, so PropagatePrecision converts the condition too and the input precisions are equal at this point. If it is not the case, please add a comment explaining why the output type is used.

    : jit_emitter(host, host_isa, get_arithmetic_binary_exec_precision(node)) {}

v-Golubev v-Golubev commented on code on Nov 23, 2026 15:10 UTC
Code Review
src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.cpp:1
@@ -408,9 +408,8 @@ size_t jit_divide_emitter::aux_vecs_count() const {
 /// FLOOR ///
 jit_floor_emitter::jit_floor_emitter(x64::jit_generator_t* host,
                                      x64::cpu_isa_t host_isa,
-                                     [[maybe_unused]] const std::shared_ptr<ov::Node>& node,
-                                     ov::element::Type exec_prc)
-    : jit_emitter(host, host_isa, exec_prc) {}
+                                     [[maybe_unused]] const std::shared_ptr<ov::Node>& node)
+    : jit_emitter(host, host_isa, ov::element::f32) {}

Can we take the precision from the node here, as the aarch64 emitters do, instead of the f32 literal? The emitter supports only f32, so the value is the same, but the node stays the single source of the precision: a hidden f32 is what hid the SquaredDifference bug. This comment is actual for all the f32-only emitters in this file.

jit_floor_emitter::jit_floor_emitter(x64::jit_generator_t* host,
                                     x64::cpu_isa_t host_isa,
                                     const std::shared_ptr<ov::Node>& node)
    : jit_emitter(host, host_isa, get_arithmetic_binary_exec_precision(node)) {}

v-Golubev v-Golubev commented on code on Nov 23, 2026 15:10 UTC
Code Review
src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.hpp:1
@@ -134,8 +134,7 @@ class jit_floor_emitter : public jit_emitter {
                       ov::element::Type exec_prc = ov::element::f32);
     jit_floor_emitter(dnnl::impl::cpu::x64::jit_generator_t* host,
                       dnnl::impl::cpu::x64::cpu_isa_t host_isa,
-                      const std::shared_ptr<ov::Node>& n,
-                      ov::element::Type exec_prc = ov::element::f32);
+                      const std::shared_ptr<ov::Node>& n);

Can we also drop exec_prc from the node constructors in jit_dnnl_ext_emitters.hpp (Relu, Sigmoid, Tanh, Elu, Swish, HSwish, HSigmoid, Gelu erf/tanh, Round)? They are x64 eltwise emitters created by from_node() as well and still default exec_prc to f32, which jit_dnnl_emitter only forwards to the base class. Otherwise "remaining" in the description is not accurate. A follow-up is fine too.

arshil42 arshil42 commented on code on Nov 23, 2026 19:20 UTC
Code Review
src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.cpp:1
@@ -2936,9 +2918,8 @@ void jit_is_nan_emitter::register_table_entries() {
 /// SELECT ///
 jit_select_emitter::jit_select_emitter(x64::jit_generator_t* host,
                                        x64::cpu_isa_t host_isa,
-                                       [[maybe_unused]] const std::shared_ptr<ov::Node>& node,
-                                       ov::element::Type exec_prc)
-    : jit_emitter(host, host_isa, exec_prc) {}
+                                       const std::shared_ptr<ov::Node>& node)
+    : jit_emitter(host, host_isa, node->get_output_element_type(0)) {}

Thanks for the suggestion. I’ve updated the Select emitter to use get_arithmetic_binary_exec_precision(node), consistent with the aarch64 and riscv64 emitters.

At this point, the inputs have equal precision due to PropagatePrecision, so the helper returns the same precision as the output type. The previous output-type special case therefore wasn’t needed, and I didn’t add a comment. This is included in commit 90ce391.

arshil42 arshil42 commented on code on Nov 23, 2026 19:22 UTC
Code Review
src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.hpp:1
@@ -134,8 +134,7 @@ class jit_floor_emitter : public jit_emitter {
                       ov::element::Type exec_prc = ov::element::f32);
     jit_floor_emitter(dnnl::impl::cpu::x64::jit_generator_t* host,
                       dnnl::impl::cpu::x64::cpu_isa_t host_isa,
-                      const std::shared_ptr<ov::Node>& n,
-                      ov::element::Type exec_prc = ov::element::f32);
+                      const std::shared_ptr<ov::Node>& n);

Done in this PR rather than a follow-up, so the “remaining” wording in the title and description is now accurate. All 10 node constructors in jit_dnnl_ext_emitters.hpp no longer take exec_prc; they now get the precision from the node via get_arithmetic_binary_exec_precision(n) as well.

arshil42 arshil42 commented on code on Nov 23, 2026 19:22 UTC
Code Review
src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.cpp:1
@@ -408,9 +408,8 @@ size_t jit_divide_emitter::aux_vecs_count() const {
 /// FLOOR ///
 jit_floor_emitter::jit_floor_emitter(x64::jit_generator_t* host,
                                      x64::cpu_isa_t host_isa,
-                                     [[maybe_unused]] const std::shared_ptr<ov::Node>& node,
-                                     ov::element::Type exec_prc)
-    : jit_emitter(host, host_isa, exec_prc) {}
+                                     [[maybe_unused]] const std::shared_ptr<ov::Node>& node)
+    : jit_emitter(host, host_isa, ov::element::f32) {}

Done. I’ve applied this to all the f32-only emitters in the file, not just Floor — 18 constructors in total, including erf, now taking the precision from get_arithmetic_binary_exec_precision(node).

I also removed [[maybe_unused]] from the affected node parameters since they’re used now.

v-Golubev v-Golubev commented on Nov 24, 2026 09:15 UTC
Contributor

build_jenkins

v-Golubev v-Golubev approved these changes on Nov 24, 2026 10:38 UTC
Approved Reviewer

Thank you for the contribution!

arshil42 arshil42 commented on Nov 24, 2026 22:38 UTC
Author

@v-Golubev
Hi, thanks for reviewing and approving #40068.

I have relied a lot on AI for my PRs so far, which I have disclosed in them. I have been learning OpenVINO and have been trying to understand the code myself.

I do understand what I am doing at a high level while working on issues (thanks to GPT and Claude), but I still find reading the code hard.

I have done some competitive programming in C++ and have a good grasp of ML, DL, transformers, and language models.

I would really appreciate it if you could point me to a relatively easy issue in the CPU plugin where I can work end to end and raise the PR myself.

My goal is to learn the code properly and use AI only when I get stuck.

Reviewers
Assignees
arshil42 arshil42
Labels
risk: low confidence: 91.2% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 38.6% (MEDIUM) · Higher = larger blast radius
38.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 91.2% · Lower = rushed or shallow review
91.2%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 3.4% · Safe to merge
3.4%