File tree Expand file tree Collapse file tree 3 files changed +39
-14
lines changed
core/include/openvino/core
transformations/cpu_opset/x64/pass Expand file tree Collapse file tree 3 files changed +39
-14
lines changed Original file line number Diff line number Diff line change 1919 * @brief Defines OpenVINO patch version
2020 */
2121
22- #define OPENVINO_VERSION_MAJOR 2026
23- #define OPENVINO_VERSION_MINOR 0
22+ #define OPENVINO_VERSION_MAJOR 2025
23+ #define OPENVINO_VERSION_MINOR 4
2424#define OPENVINO_VERSION_PATCH 0
2525
2626namespace ov {
Original file line number Diff line number Diff line change @@ -546,20 +546,25 @@ bool Eltwise::isWithBroadcast() {
546546}
547547
548548void Eltwise::init () {
549- // Bf16 saturation handling for gamma parameter when input precision is bf16 to make sure it stays within the valid
550- // range for bfloat16.
549+ // Bf16 saturation handling for PowerStatic parameters
550+ // to make sure they stay within the valid range for bfloat16.
551551 if (m_attrs.data .algo == Algorithm::EltwisePowerStatic && getOriginalInputPrecisionAtPort (0 ) == ov::element::bf16 ) {
552- const float lowest = static_cast <float >(std::numeric_limits<ov::bfloat16>::lowest ());
553- const float max = static_cast <float >(std::numeric_limits<ov::bfloat16>::max ());
554- auto & gamma = m_attrs.data .gamma ;
555-
556- if (gamma < lowest) {
557- gamma = lowest;
558- }
552+ // Use the actual float values corresponding to bfloat16 limits
553+ // 0xFF7F = -65504.0f (lowest), 0x7F7F = 65504.0f (max)
554+ static constexpr float bf16_lowest = -65504 .0f ;
555+ static constexpr float bf16_max = 65504 .0f ;
556+
557+ // Helper lambda to clamp parameter values within bf16 range
558+ auto clampBf16Parameter = [&](auto & param) {
559+ if (std::isfinite (param)) {
560+ param = std::clamp (static_cast <float >(param), bf16_lowest, bf16_max);
561+ }
562+ };
559563
560- if (gamma > max) {
561- gamma = max;
562- }
564+ // Clamp all PowerStatic parameters
565+ clampBf16Parameter (m_attrs.data .alpha );
566+ clampBf16Parameter (m_attrs.data .beta );
567+ clampBf16Parameter (m_attrs.data .gamma );
563568 }
564569}
565570
Original file line number Diff line number Diff line change @@ -122,6 +122,26 @@ ov::intel_cpu::MLPFusionPass::MLPFusionPass() {
122122 matcher_pass_callback callback = [OV_CAPTURE_CPY_AND_THIS](ov::pass::pattern::Matcher& m) {
123123 const auto & pattern_map = m.get_pattern_value_map ();
124124 auto root = m.get_match_root ();
125+
126+ // Verify VariadicSplit output[1] connects to Multiply (up branch) in combined mode
127+ if (pattern_map.count (gate_up_proj_split)) {
128+ auto mlp_gated_up_node = pattern_map.at (mlp_gated_up).get_node_shared_ptr ();
129+ auto input0 = mlp_gated_up_node->input_value (0 );
130+ auto input1 = mlp_gated_up_node->input_value (1 );
131+
132+ bool found_valid_up_connection = false ;
133+
134+ if (input0.get_node () == pattern_map.at (gate_up_proj_split).get_node () && input0.get_index () == 1 ) {
135+ found_valid_up_connection = true ;
136+ }
137+ if (input1.get_node () == pattern_map.at (gate_up_proj_split).get_node () && input1.get_index () == 1 ) {
138+ found_valid_up_connection = true ;
139+ }
140+
141+ if (!found_valid_up_connection) {
142+ return false ;
143+ }
144+ }
125145 auto src = pattern_map.at (input);
126146 if (!src.get_element_type ().is_real ()) {
127147 // FakeQuantize, should skip fusion
You can’t perform that action at this time.
0 commit comments