Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/cpp/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/src/whisper/models/statefull_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Comment on lines +37 to +40

ov::CompiledModel compiled_model;
if (device == "NPU") {
auto kv_pos = ov::genai::utils::get_kv_axes_pos(model);
Expand All @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions src/cpp/src/whisper/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Loading