Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU] SDPA micro: use prefill config on integrated GPUs (#39316)

Kamil Wielocha3cc46f437c1
diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/sdpa_gen_micro.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/sdpa_gen_micro.cpp
index d2409837bd8..eb773295011 100644
--- a/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/sdpa_gen_micro.cpp
+++ b/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/sdpa_gen_micro.cpp
@@ -723,6 +723,11 @@ sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool qua
if (seq <= 0 && is_pa) {
return is_prefill ? &xehpc_h128 : &xehpc_h128_pa;
}
+ // On an integrated part a multi-token call whose key count is only known at run time is a
+ // prefill over a long context; do not size it as if it had no keys.
+ if (seq <= 0 && !thin_q && is_integrated) {
+ seq = std::numeric_limits<int>::max();
+ }
if (quantized) {
if (thin_q) {
if (is_integrated) {
@@ -749,11 +754,8 @@ sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool qua
}
return &xehpc_q_h128;
}
- if (is_integrated) {
- return &xehpc_q_h128_2nd_integrated;
- }
if (thin_q) {
- return &xehpc_h128_2nd;
+ return is_integrated ? &xehpc_q_h128_2nd_integrated : &xehpc_h128_2nd;
}
if (seq <= 32) {
return &xehpc_h128_s32;