OpenVINO backend: Support Whisper.cpp - #257
Conversation
4250de7 to
175f422
Compare
9c96a1d to
c66a9c9
Compare
1300653 to
ce90ca1
Compare
678ba21 to
16f69ac
Compare
ce90ca1 to
1c023b0
Compare
eb54a50 to
04b5691
Compare
1c023b0 to
1687f7a
Compare
|
|
@cavusmustafa @ravi9 @wine99 can you please have a look? FYI: this PR is dependent on #261 and ggml-org/whisper.cpp#3997 |
8ba9348 to
d691121
Compare
1687f7a to
24eaf6a
Compare
d691121 to
407e209
Compare
24eaf6a to
8f63532
Compare
|
Looks like OV CPU is much slower than GGML CPU Is this the right number to look at? Is the decoding itself actually slower, or does this timing include compilation time? Is there any graph splitting involved? |
|
LGTM. The changes are mostly additive, so they shouldn’t break existing models. Great job. Thanks! cc @zhaixuejun1993 |
@wine99 This is purely decode time. The model itself consists of 4 |
The conversion of KV cache from f16 to f32 is a known issue. The CPU plugin inserts these conversions because it lacks support for f16 arithmetic. The GPU plugin should not have such conversions. I think GPU performance should have a higher priority than CPU performance, since that’s usually what the team cares about more. |
|
It is a much bigger issue in whisper since the KV cache is shared across layers, so the whole cache is converted for each layer. Thanks for reviewing, and I will keep you posted with any potential for improvement in performance. |
Overview
src[3](mask) isnullptr.reshape_flat_kvinflash_attn_extto reshape and strided-slice 1D flat KV buffers ([1, 1, 1, N]) into multi-head attention inputs[B, n_head, S_k, head_size]based on dynamic/static attention sizes (op_case1 & 2).is_supported_flash_attn_patternchecks to acceptPERMUTE -> RESHAPE(Whisper Q) and directVIEW -> base(Whisper K/V) patterns.op_case5 & 6) usingov::op::v3::ScatterUpdateto write new token embeddings into flat 1D KV cache buffers.compute_llm_paramsto extracttoken_len_per_seq,attention_size, and static cross-attention dimensions (attention_size_static) from directGGML_OP_VIEWtensors without requiringPERMUTEnodes.create_ov_output_tensorforGGML_OP_CPYtargeting a paddedview_src, ensuring the output tensor matches the full underlyingview_srcbuffer dimensions rather than the smaller slice shape.TODO:
--no-flash-attnAdditional information
Requirements