diff --git a/src/cpp/src/utils.cpp b/src/cpp/src/utils.cpp index a535f55af0..76bf485efd 100644 --- a/src/cpp/src/utils.cpp +++ b/src/cpp/src/utils.cpp @@ -109,7 +109,6 @@ void update_npu_config_whisper(ov::AnyMap& config, update_config(config, {"NPUW_LLM", "YES"}); update_config(config, {"NPUW_WHISPER", "YES"}); rename_key(config, "WHISPER_EOS_TOKEN", "NPUW_WHISPER_EOS_TOKEN"); - rename_key(config, "WHISPER_DECOMPOSE_SDPA", "NPUW_WHISPER_DECOMPOSE_SDPA"); update_config(config, {"NPUW_LLM_BATCH_DIM", kv_pos.batch}); update_config(config, {"NPUW_LLM_SEQ_LEN_DIM", kv_pos.seq_len}); diff --git a/src/cpp/src/whisper/models/statefull_decoder.cpp b/src/cpp/src/whisper/models/statefull_decoder.cpp index 2b64e860d9..40313f4a16 100644 --- a/src/cpp/src/whisper/models/statefull_decoder.cpp +++ b/src/cpp/src/whisper/models/statefull_decoder.cpp @@ -34,6 +34,11 @@ WhisperStatefullDecoder::WhisperStatefullDecoder(const std::filesystem::path& mo m_has_cache_position = utils::has_input(model, "cache_position"); + if (m_decompose_cross_attention_spda_ops) { + ov::genai::decompose_scaled_dot_product_attention_for_whisper(model); + ov::genai::add_cross_attention_qk_scaled_scores_outputs_for_whisper(model); + } + ov::CompiledModel compiled_model; if (device == "NPU") { auto kv_pos = ov::genai::utils::get_kv_axes_pos(model); @@ -43,11 +48,6 @@ WhisperStatefullDecoder::WhisperStatefullDecoder(const std::filesystem::path& mo utils::KVDesc kv_desc; std::tie(compiled_model, kv_desc) = utils::compile_decoder_for_npu(model, properties, kv_pos, true); } else { - if (m_decompose_cross_attention_spda_ops) { - ov::genai::decompose_scaled_dot_product_attention_for_whisper(model); - ov::genai::add_cross_attention_qk_scaled_scores_outputs_for_whisper(model); - } - utils::apply_slice_before_matmul_transformation(model); compiled_model = core.compile_model(model, device, properties); diff --git a/src/cpp/src/whisper/pipeline.cpp b/src/cpp/src/whisper/pipeline.cpp index 861e36a6fb..0a1b88684b 100644 --- a/src/cpp/src/whisper/pipeline.cpp +++ b/src/cpp/src/whisper/pipeline.cpp @@ -94,10 +94,6 @@ class WhisperPipeline::WhisperPipelineStatefulImpl : public WhisperPipeline::Whi auto eos_token = m_generation_config.eos_token_id == -1 ? m_tokenizer.get_eos_token_id() : m_generation_config.eos_token_id; properties_copy.insert({"WHISPER_EOS_TOKEN", eos_token}); - - if (m_generation_config.word_timestamps) { - properties_copy.insert({"WHISPER_DECOMPOSE_SDPA", m_generation_config.word_timestamps}); - } } else { compiled_model = core.compile_model(models_path / "openvino_encoder_model.xml", device, properties_copy); }