Skip to content

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

[GPU] sdpa_micro for prefix caching (#31968)

Eddy Kimf35beb7f1355
diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/paged_attention_opt.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/paged_attention_opt.cpp
index 200c9a31e00..9b51f99cc6b 100644
--- a/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/paged_attention_opt.cpp
+++ b/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa/paged_attention_opt.cpp
@@ -1087,6 +1087,7 @@ public:
Stage::Ptr pa_scores_calc = make_stage<PagedAttentionGeneratorScoresCalculation>();
#ifdef ENABLE_ONEDNN_FOR_GPU
Stage::Ptr pa_sdpa_micro = make_stage<SDPAMicroGenerator>(true);
+ Stage::Ptr pa_sdpa_micro_mixed = make_stage<SDPAMicroGenerator>(false);
#endif
PagedAttentionOptImpl() : SDPAImplBase(PagedAttentionOpt::get_type_info_static()) {}
@@ -1099,6 +1100,7 @@ public:
const bool use_micro_sdpa = supports_micro_sdpa(params);
if (use_micro_sdpa) {
add_stage(pa_sdpa_micro, params);
+ add_stage(pa_sdpa_micro_mixed, params);
}
#endif
@@ -1169,8 +1171,9 @@ public:
size_t get_query_block_size(const PagedAttentionStage& stage, const bool use_micro_sdpa) const {
const auto default_block_size = 16;
- if (use_micro_sdpa && stage == PagedAttentionStage::PREFILL)
- return get_micro_tile_qsize(pa_sdpa_micro->kd);
+ if (use_micro_sdpa) {
+ return (stage == PagedAttentionStage::PREFILL) ? get_micro_tile_qsize(pa_sdpa_micro->kd) : get_micro_tile_qsize(pa_sdpa_micro_mixed->kd);
+ }
return default_block_size;
}
#else
@@ -1213,22 +1216,17 @@ public:
rt_params->paged_attention_snap_kv_tokens = 0;
}
- if (rt_params->stage == PagedAttentionStage::PREFILL) {
#ifdef ENABLE_ONEDNN_FOR_GPU
- // Determine if sdpa_micro can be used based on sliding_window and aliged_seq_len
- bool support_sliding_window =
- desc->sliding_window == 0 || (desc->sliding_window > 0 && rt_params->paged_attention_aligned_seq_len < desc->sliding_window);
- rt_params->use_micro_sdpa = supports_micro_sdpa(params) && support_sliding_window;
+ rt_params->use_micro_sdpa = supports_micro_sdpa(params) && rt_params->stage != PagedAttentionStage::GENERATE;
#else
- rt_params->use_micro_sdpa = false;
+ rt_params->use_micro_sdpa = false;
#endif
- rt_params->query_block_size = get_query_block_size(rt_params->stage, rt_params->use_micro_sdpa);
- } else {
- rt_params->use_micro_sdpa = false;
- }
+ rt_params->query_block_size = get_query_block_size(rt_params->stage, rt_params->use_micro_sdpa);
- if (rt_params->stage == PagedAttentionStage::GENERATE) {
+ if (rt_params->stage == PagedAttentionStage::GENERATE && !rt_params->use_micro_sdpa) {
rt_params->use_gqa_kernel = can_use_gqa_kernel(params, PagedAttentionStage::GENERATE, rt_params->max_context_len);
+ } else {
+ rt_params->use_gqa_kernel = false;
}
return;
}
@@ -1274,9 +1272,14 @@ public:
if (rt_params->use_gqa_kernel) {
res_event = {execute_stage(res_event, instance, multi_tokens_mode ? pa_multi_token : pa_gqa_single_token)};
} else {
- res_event = {execute_stage(res_event, instance, multi_tokens_mode ? pa_multi_token : pa_single_token)};
+#ifdef ENABLE_ONEDNN_FOR_GPU
+ if (multi_tokens_mode && rt_params->use_micro_sdpa)
+ res_event = {execute_stage(res_event, instance, pa_sdpa_micro_mixed)};
+ else
+#endif
+ res_event = {execute_stage(res_event, instance, multi_tokens_mode ? pa_multi_token : pa_single_token)};
}
- if (num_of_partitions > 1) {
+ if (num_of_partitions > 1 && !rt_params->use_micro_sdpa) {
res_event = {execute_stage(res_event, instance, multi_tokens_mode ? pa_multi_token_finalization : pa_single_token_finalization)};
}
}
@@ -1364,11 +1367,9 @@ public:
const auto max_context_len = get_max_context_len(params);
num_of_partitions = ceil_div(max_context_len, partition_size);
}
- bool can_use_micro_sdpa = stage == PagedAttentionStage::PREFILL;
+ bool can_use_micro_sdpa = false;
#ifdef ENABLE_ONEDNN_FOR_GPU
- can_use_micro_sdpa &= has_stage(pa_sdpa_micro);
-#else
- can_use_micro_sdpa = false;
+ can_use_micro_sdpa = has_stage(pa_sdpa_micro) && stage != PagedAttentionStage::GENERATE;
#endif
GPU_DEBUG_TRACE_DETAIL << "get_internal_buffer_descs: stage = " << static_cast<size_t>(stage) << std::endl;
int64_t paged_attention_aligned_seq_len = -1;
@@ -1447,13 +1448,13 @@ public:
}
const auto multi_tokens_mode = stage == PagedAttentionStage::MIXED;
- if (multi_tokens_mode) {
+ if (multi_tokens_mode && !can_use_micro_sdpa) {
internal_buffers.emplace_back(total_tokens, softmax_accumulator_type, lockable); // 9
}
#ifdef ENABLE_ONEDNN_FOR_GPU
if (can_use_micro_sdpa) {
- const auto wg_tile_q = get_micro_tile_qsize(pa_sdpa_micro->kd);
+ const auto wg_tile_q = 8; // This is set as the minimum size of query block for sharing between sdpa_micro_prefill and mixed.
const auto target_seq_len = std::max(paged_attention_aligned_seq_len, static_cast<int64_t>(1));
const auto indexes_buf_size = ceil_div(target_seq_len, wg_tile_q) * 2;
internal_buffers.emplace_back(indexes_buf_size * 4, indexes_dt, lockable);
@@ -1552,7 +1553,7 @@ public:
std::unique_ptr<mem_lock<int32_t, mem_lock_type::write>> sequential_gws_subseq_mapping_lock = nullptr;
std::unique_ptr<mem_lock<int32_t, mem_lock_type::write>> micro_sdpa_block_starts_and_gws_mapping_lock = nullptr;
- if (stage == PagedAttentionStage::MIXED) {
+ if (stage == PagedAttentionStage::MIXED && !use_micro_sdpa) {
size_t sequential_gws_subseq_mapping_idx = 6;
if (has_score_aggregation) {
sequential_gws_subseq_mapping_idx = 9;
@@ -1567,7 +1568,7 @@ public:
sequential_gws_subseq_mapping_lock.reset(new mem_lock<int32_t, mem_lock_type::write>(sequential_gws_subseq_mapping_mem, stream));
}
- if (stage == PagedAttentionStage::PREFILL && use_micro_sdpa) {
+ if (use_micro_sdpa) {
const auto memory_idx = 3; // intermediate_idx for micro kernel
auto memory = intermediates_memories[memory_idx];
micro_sdpa_block_starts_and_gws_mapping_lock.reset(new mem_lock<int32_t, mem_lock_type::write>(memory, stream));
@@ -1619,7 +1620,7 @@ public:
}
}
- if (stage == PagedAttentionStage::MIXED) {
+ if (stage == PagedAttentionStage::MIXED && !use_micro_sdpa) {
for (int32_t idx = seq_start; idx < seq_end; idx++) {
sequential_gws_subseq_mapping_lock->operator[](idx) = static_cast<int32_t>(i);
}
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 946de0ecdbb..660d280d884 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
@@ -263,6 +263,8 @@ struct sdpa_config_t {
// h<N> -- maximum head size = N
// s<M> -- target sequence length = M
// 2nd -- second token (thin Q)
+// pa -- paged attention
+sdpa_config_t xehpg_h32_pa = {16, 16, 16, 16, 2, 8, 2, 8};
sdpa_config_t xehpg_h32 = {32, 16, 16, 16, 2, 16, 2, 16};
sdpa_config_t xehpg_h32_s256 = {16, 16, 16, 16, 2, 8, 2, 8};
sdpa_config_t xehpg_h32_s64 = {16, 16, 16, 8, 4, 4, 2, 8};
@@ -272,6 +274,7 @@ sdpa_config_t xehpg_h32_2nd = {8, 32, 16, 8, 8, 1, 2, 4};
sdpa_config_t xehpg_q_h32 = {32, 16, 16, 16, 2, 8, 2, 8};
sdpa_config_t xehpg_q_h32_2nd = {32, 16, 8, 8, 8, 1, 4, 2};
+sdpa_config_t xehpg_h64_pa = {16, 16, 16, 16, 4, 8, 4, 8};
sdpa_config_t xehpg_h64 = {32, 16, 16, 16, 4, 8, 4, 8};
sdpa_config_t xehpg_h64_s128 = {16, 16, 16, 16, 4, 8, 4, 8};
sdpa_config_t xehpg_h64_s64 = {32, 16, 16, 8, 8, 4, 4, 8};
@@ -286,6 +289,7 @@ sdpa_config_t xehpg_q_h64_s64_2nd = {8, 8, 8, 8, 8, 2, 8, 2};
sdpa_config_t xehpg_q_h64_s128_2nd = {16, 8, 8, 8, 8, 4, 8, 4};
sdpa_config_t xehpg_q_h64_2nd = {16, 16, 8, 8, 16, 2, 8, 4};
+sdpa_config_t xehpg_h128_pa = {16, 16, 16, 16, 8, 4, 8, 4};
sdpa_config_t xehpg_h128 = {16, 16, 32, 8, 8, 4, 4, 8};
sdpa_config_t xehpg_h128_s32 = {16, 16, 16, 8, 16, 2, 8, 4};
sdpa_config_t xehpg_h128_2nd = {8, 16, 16, 8, 16, 1, 8, 2};
@@ -296,6 +300,7 @@ sdpa_config_t xehpg_q_h128_s512 = {16, 16, 16, 16, 8, 4, 8, 4};
sdpa_config_t xehpg_q_h128_2nd = {32, 16, 16, 8, 16, 1, 8, 2};
sdpa_config_t xehpg_q_h128_s96_2nd = {8, 8, 8, 8, 16, 2, 16, 2};
+sdpa_config_t xehpg_h256_pa = {16, 16, 16, 16, 16, 2, 16, 2};
sdpa_config_t xehpg_h256 = {16, 16, 32, 8, 16, 2, 8, 4};
sdpa_config_t xehpg_h256_s128 = {8, 16, 32, 16, 8, 4, 8, 4};
sdpa_config_t xehpg_h256_s32 = {8, 16, 32, 8, 16, 2, 8, 4};
@@ -320,13 +325,16 @@ sdpa_config_t xehpg_q_h512_s64_2nd = {8, 16, 32, 8, 32, 1, 16, 2};
sdpa_config_t xehpg_q_h512_s256_2nd = {16, 8, 32, 8, 16, 2, 16, 2};
sdpa_config_t xehpg_q_h512_2nd = {16, 8, 16, 8, 32, 1, 32, 1};
+sdpa_config_t xehpg_h512_pa = {16, 16, 16, 16, 8, 2, 32, 2};
sdpa_config_t xehpg_h512 = {8, 16, 32, 16, 16, 2, 16, 2};
sdpa_config_t xehpg_h512_2nd = {8, 8, 32, 8, 16, 1, 16, 1};
+sdpa_config_t xehpc_h32_pa = {16, 16, 16, 16, 4, 4, 4, 4};
sdpa_config_t xehpc_h32 = {16, 64, 32, 16, 4, 2, 1, 8};
sdpa_config_t xehpc_h32_s32 = {16, 16, 16, 16, 2, 4, 2, 4};
sdpa_config_t xehpc_h32_2nd = {16, 64, 16, 16, 8, 1, 2, 4};
+sdpa_config_t xehpc_h64_pa = {16, 16, 16, 16, 4, 4, 4, 4};
sdpa_config_t xehpc_h64 = {16, 64, 32, 16, 8, 2, 2, 8};
sdpa_config_t xehpc_h64_s64 = {32, 32, 32, 16, 4, 2, 2, 4};
sdpa_config_t xehpc_h64_s32 = {16, 16, 16, 16, 4, 2, 4, 2};
@@ -343,6 +351,7 @@ sdpa_config_t xehpc_q_h64_s256_2nd = {16, 16, 16, 16, 16, 1, 16, 1};
sdpa_config_t xehpc_q_h64_s1152_2nd = {16, 16, 16, 16, 16, 1, 16, 1};
sdpa_config_t xehpc_q_h64_2nd = {64, 16, 16, 16, 16, 2, 16, 2};
+sdpa_config_t xehpc_h128_pa = {16, 16, 16, 16, 8, 2, 8, 2};
sdpa_config_t xehpc_h128 = {16, 64, 32, 16, 16, 2, 4, 8};
sdpa_config_t xehpc_h128_s64 = {16, 32, 32, 32, 4, 2, 4, 2};
sdpa_config_t xehpc_h128_s32 = {16, 16, 16, 16, 8, 2, 8, 2};
@@ -358,10 +367,12 @@ sdpa_config_t xehpc_q_h128_2nd_integrated = {16, 16, 16, 16, 8, 1, 8, 1};
sdpa_config_t xehpc_q_h128_s96_2nd = {16, 16, 16, 16, 8, 1, 8, 1};
sdpa_config_t xehpc_q_h128_s512_2nd = {16, 16, 16, 16, 16, 2, 8, 2};
+sdpa_config_t xehpc_h256_pa = {16, 16, 16, 16, 16, 2, 16, 2};
sdpa_config_t xehpc_h256 = {16, 32, 32, 32, 8, 4, 8, 4};
sdpa_config_t xehpc_h256_s64 = {16, 32, 32, 32, 8, 1, 8, 1};
sdpa_config_t xehpc_h256_2nd = {16, 16, 16, 16, 16, 1, 16, 1};
+sdpa_config_t xehpc_h512_pa = {16, 16, 16, 16, 16, 1, 32, 1};
sdpa_config_t xehpc_h512 = {32, 16, 64, 16, 8, 4, 8, 4};
sdpa_config_t xehpc_h512_s64 = {16, 16, 64, 16, 8, 2, 8, 2};
sdpa_config_t xehpc_h512_s128_2nd = {16, 16, 64, 16, 8, 1, 8, 1};
@@ -422,10 +433,10 @@ sdpa_config_t xe2_q_h256_s768_2nd_integrated = {64, 16, 16, 16, 16, 1, 16, 1};
sdpa_config_t xe2_q_h256_s512_2nd_integrated = {32, 32, 32, 16, 16, 1, 8, 2};
sdpa_config_t xe2_q_h256_s384_2nd_integrated = {16, 16, 16, 16, 16, 1, 16, 1};
-sdpa_config_t* choose_config_xehpg(int head_size, int seq, bool thin_q, bool quantized, bool is_pa) {
+sdpa_config_t* choose_config_xehpg(int head_size, int seq, bool thin_q, bool quantized, bool is_pa, bool is_prefill) {
if (head_size <= 32) {
if (seq <= 0 && is_pa)
- return &xehpg_h32;
+ return &xehpg_h32_pa;
if (quantized && seq >= 128) {
if (thin_q)
return &xehpg_q_h32_2nd;
@@ -442,7 +453,7 @@ sdpa_config_t* choose_config_xehpg(int head_size, int seq, bool thin_q, bool qua
return &xehpg_h32;
} else if (head_size <= 64) {
if (seq <= 0 && is_pa)
- return &xehpg_h64;
+ return is_prefill ? &xehpg_h64 : &xehpg_h64_pa;
if (quantized) {
if (thin_q) {
if (seq <= 64)
@@ -469,7 +480,7 @@ sdpa_config_t* choose_config_xehpg(int head_size, int seq, bool thin_q, bool qua
return &xehpg_h64;
} else if (head_size <= 128) {
if (seq <= 0 && is_pa)
- return &xehpg_h128;
+ return is_prefill ? &xehpg_h128 : &xehpg_h128_pa;
if (quantized) {
if (thin_q) {
if (seq <= 1)
@@ -494,7 +505,7 @@ sdpa_config_t* choose_config_xehpg(int head_size, int seq, bool thin_q, bool qua
return &xehpg_h128;
} else if (head_size <= 256) {
if (seq <= 0 && is_pa)
- return &xehpg_h256;
+ return is_prefill ? &xehpg_h256 : &xehpg_h256_pa;
if (thin_q) {
if (quantized) {
if (seq <= 96)
@@ -521,7 +532,7 @@ sdpa_config_t* choose_config_xehpg(int head_size, int seq, bool thin_q, bool qua
return &xehpg_h256;
} else if (head_size <= 512) {
if (seq <= 0 && is_pa)
- return &xehpg_h512;
+ return is_prefill ? &xehpg_h512 : &xehpg_h512_pa;
if (quantized) {
if (thin_q) {
if (seq <= 64)
@@ -546,10 +557,10 @@ sdpa_config_t* choose_config_xehpg(int head_size, int seq, bool thin_q, bool qua
return nullptr;
}
-sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool quantized, bool is_integrated, bool is_pa) {
+sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool quantized, bool is_integrated, bool is_pa, bool is_prefill) {
if (head_size <= 32) {
if (seq <= 0 && is_pa)
- return &xehpc_h32;
+ return is_prefill ? &xehpc_h32 : &xehpc_h32_pa;
if (thin_q)
return &xehpc_h32_2nd;
if (seq <= 32)
@@ -557,7 +568,7 @@ sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool qua
return &xehpc_h32;
} else if (head_size <= 64) {
if (seq <= 0 && is_pa)
- return &xehpc_h64;
+ return is_prefill ? &xehpc_h64 : &xehpc_h64_pa;
if (thin_q) {
if (quantized) {
if (seq <= 96)
@@ -589,7 +600,7 @@ sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool qua
return &xehpc_h64;
} else if (head_size <= 128) {
if (seq <= 0 && is_pa)
- return &xehpc_h128;
+ return is_prefill ? &xehpc_h128 : &xehpc_h128_pa;
if (quantized) {
if (thin_q) {
if (is_integrated) {
@@ -623,7 +634,7 @@ sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool qua
return &xehpc_h128;
} else if (head_size <= 256) {
if (seq <= 0 && is_pa)
- return &xehpc_h256;
+ return is_prefill ? &xehpc_h256 : &xehpc_h256_pa;
if (thin_q)
return &xehpc_h256_2nd;
if (seq <= 64)
@@ -631,7 +642,7 @@ sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool qua
return &xehpc_h256;
} else if (head_size <= 512) {
if (seq <= 0 && is_pa)
- return &xehpc_h512;
+ return is_prefill ? &xehpc_h512 : &xehpc_h512_pa;
if (thin_q) {
if (quantized) {
if (is_integrated) {
@@ -689,7 +700,10 @@ sdpa_config_t* choose_config_xehpc(int head_size, int seq, bool thin_q, bool qua
return nullptr;
}
-sdpa_config_t* choose_config_xe2(int head_size, int seq, bool thin_q, bool quantized, bool is_integrated, bool is_pa) {
+sdpa_config_t* choose_config_xe2(int head_size, int seq, bool thin_q, bool quantized, bool is_integrated, bool is_pa, bool is_prefill) {
+ if (seq <= 0 && is_pa) {
+ return choose_config_xehpc(head_size, seq, thin_q, quantized, is_integrated, is_pa, is_prefill);
+ }
if (head_size <= 64) {
if (quantized) {
if (thin_q) {
@@ -733,7 +747,7 @@ sdpa_config_t* choose_config_xe2(int head_size, int seq, bool thin_q, bool quant
}
if (head_size <= 128) {
- return choose_config_xehpc(head_size, seq, thin_q, quantized, is_integrated, is_pa);
+ return choose_config_xehpc(head_size, seq, thin_q, quantized, is_integrated, is_pa, is_prefill);
}
if (head_size <= 256) {
@@ -766,7 +780,7 @@ sdpa_config_t* choose_config_xe2(int head_size, int seq, bool thin_q, bool quant
}
}
}
- return choose_config_xehpc(head_size, seq, thin_q, quantized, is_integrated, is_pa);
+ return choose_config_xehpc(head_size, seq, thin_q, quantized, is_integrated, is_pa, is_prefill);
}
} // namespace
@@ -942,6 +956,7 @@ JitConstants SDPAMicroGenerator::get_jit_constants(const kernel_impl_params& par
if (has_scores_output) {
jit.add(make_layout_jit_constants("OUTPUT" + to_code_string(1), params.output_layouts[1], out_offsets_map.at(1)));
}
+ jit.make("SLIDING_WINDOW_SIZE", desc->sliding_window);
} else {
const auto desc = params.typed_desc<scaled_dot_product_attention>();
jit.add(make_tensors_jit_constants(params));
@@ -954,8 +969,8 @@ JitConstants SDPAMicroGenerator::get_jit_constants(const kernel_impl_params& par
const auto& device_info = params.get_device_info();
const auto& Q = params.input_layouts[0];
- const auto& K = params.input_layouts[1];
- const auto& V = params.input_layouts[2];
+ const auto& K = (config.is_paged_attention && !m_is_prefill) ? params.input_layouts[3] : params.input_layouts[1];
+ const auto& V = (config.is_paged_attention && !m_is_prefill) ? params.input_layouts[4] : params.input_layouts[2];
const auto& out = params.output_layouts[0];
const auto& out_ps = out.get_partial_shape();
@@ -992,6 +1007,7 @@ JitConstants SDPAMicroGenerator::get_jit_constants(const kernel_impl_params& par
}
} else {
jit.make("WITH_ATTN_MASK", 0);
+ jit.make("PAGED_ATTENTION_BLOCK_SIZE", config.paged_attention_block_size);
}
if (config.has_const_scale_val) {
@@ -1006,6 +1022,7 @@ JitConstants SDPAMicroGenerator::get_jit_constants(const kernel_impl_params& par
jit.make("V_ALIGN", micro::alignment_for_ld(static_cast<int>(ldv)));
jit.make("A_ALIGN", micro::alignment_for_ld(static_cast<int>(lda)));
+ jit.make("IS_PREFILL", m_is_prefill);
jit.make("TRANSPOSE_K", false);
jit.make("IS_PAGED_ATTENTION", config.is_paged_attention ? 1 : 0);
jit.make("KV_HEADS_NUM", config.kv_heads_num);
@@ -1026,7 +1043,7 @@ JitConstants SDPAMicroGenerator::get_jit_constants(const kernel_impl_params& par
};
const bool use_asymmetric_quantization = config.use_asymmetric_quantization;
- if (config.is_kv_compressed) {
+ if (!config.is_paged_attention && config.is_kv_compressed) {
const auto& key_cache_comp_scale = params.input_layouts[data_inputs_num];
const auto& value_cache_comp_scale = params.input_layouts[data_inputs_num + 1];
jit.make("KV_COMPRESSED", 1);
@@ -1065,6 +1082,26 @@ JitConstants SDPAMicroGenerator::get_jit_constants(const kernel_impl_params& par
}
}
+ if (config.is_paged_attention && data_type_traits::is_i8_u8(K.data_type)) {
+ auto pa_desc = params.typed_desc<paged_attention>();
+ jit.make("IS_KV_COMPRESSED_PA", true);
+
+ auto scales_zp_size = 4; // scale + zp
+ if (pa_desc->is_key_by_channel) {
+ jit.make("IS_KEY_BY_CHANNEL", 1);
+ jit.make("ADJUSTED_K_HEAD_SIZE", k_head_size);
+ jit.make("ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE", config.paged_attention_block_size + scales_zp_size);
+ } else {
+ jit.make("ADJUSTED_K_HEAD_SIZE", k_head_size + scales_zp_size);
+ jit.make("ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE", config.paged_attention_block_size);
+ }
+ jit.make("ADJUSTED_V_HEAD_SIZE", v_head_size + scales_zp_size);
+ } else if (config.is_paged_attention) {
+ jit.make("ADJUSTED_K_HEAD_SIZE", k_head_size);
+ jit.make("ADJUSTED_V_HEAD_SIZE", v_head_size);
+ jit.make("ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE", config.paged_attention_block_size);
+ }
+
jit.make("KEY_ELEMENTS_PER_BYTE", elems_per_byte(params.input_layouts[1].data_type));
jit.make("VAL_ELEMENTS_PER_BYTE", elems_per_byte(params.input_layouts[2].data_type));
@@ -1103,9 +1140,9 @@ JitConstants SDPAMicroGenerator::get_jit_constants(const kernel_impl_params& par
if (device_info.arch >= gpu_arch::xe_hpc) {
jit.make("PREFETCH_MASK", 1);
- jit.make("PREFETCH_K0", 1);
- jit.make("PREFETCH_K", 1);
- jit.make("PREFETCH_V", 1);
+ jit.make("PREFETCH_K0", (config.is_paged_attention && !m_is_prefill) ? 0 : 1);
+ jit.make("PREFETCH_K", (config.is_paged_attention && !m_is_prefill) ? 0 : 1);
+ jit.make("PREFETCH_V", (config.is_paged_attention && !m_is_prefill) ? 0 : 1);
bool no_rem = d_full && v_full && k_full;
jit.make("PREFETCH_REMAINDER", !no_rem);
jit.make("PREFETCH_D_MAX", std::min<int64_t>(d_max, 64));
@@ -1197,17 +1234,33 @@ Arguments SDPAMicroGenerator::get_arguments_desc(const kernel_impl_params& param
auto data_inputs_num = micro_get_input_num(params, config);
- args.push_back({ArgumentDescriptor::Types::INPUT, ScaledDotProductAttentionInputIdx::KEY}); // K
- args.push_back({ArgumentDescriptor::Types::INPUT, ScaledDotProductAttentionInputIdx::QUERY}); // Q
- args.push_back({ArgumentDescriptor::Types::INPUT, ScaledDotProductAttentionInputIdx::VALUE}); // V
- args.push_back({ArgumentDescriptor::Types::OUTPUT, 0}); // A
-
if (config.is_paged_attention) {
+ if (m_is_prefill) {
+ args.push_back({ArgumentDescriptor::Types::INPUT, 1}); // Key
+ args.push_back({ArgumentDescriptor::Types::INPUT, 0}); // Q
+ args.push_back({ArgumentDescriptor::Types::INPUT, 2}); // Value
+ } else {
+ args.push_back({ArgumentDescriptor::Types::INPUT, 3}); // Key cache
+ args.push_back({ArgumentDescriptor::Types::INPUT, 0}); // Q
+ args.push_back({ArgumentDescriptor::Types::INPUT, 4}); // Value cache
+ }
+ args.push_back({ArgumentDescriptor::Types::OUTPUT, 0}); // A
+
args.push_back({ArgumentDescriptor::Types::INPUT, PagedAttentionInputIdx::SUBSEQUENCE_BEGINS}); // subsequence_begins
+ if (!m_is_prefill) {
+ args.push_back({ArgumentDescriptor::Types::INPUT, 5}); // past_lens
+ args.push_back({ArgumentDescriptor::Types::INPUT, 7}); // block_indices
+ args.push_back({ArgumentDescriptor::Types::INPUT, 8}); // block_indices_begins
+ }
if (!config.has_const_scale_val)
args.push_back({ArgumentDescriptor::Types::INPUT, PagedAttentionInputIdx::SCALE}); // scale
args.push_back({ArgumentDescriptor::Types::INTERNAL_BUFFER, 3}); // blocked_indexes_start_and_gws_mapping
} else {
+ args.push_back({ArgumentDescriptor::Types::INPUT, ScaledDotProductAttentionInputIdx::KEY}); // K
+ args.push_back({ArgumentDescriptor::Types::INPUT, ScaledDotProductAttentionInputIdx::QUERY}); // Q
+ args.push_back({ArgumentDescriptor::Types::INPUT, ScaledDotProductAttentionInputIdx::VALUE}); // V
+ args.push_back({ArgumentDescriptor::Types::OUTPUT, 0}); // A
+
const uint32_t attn_mask_idx = ScaledDotProductAttentionInputIdx::ATTN_MASK;
if (config.input_num > attn_mask_idx && !config.has_const_attn_mask_val)
args.push_back({ArgumentDescriptor::Types::INPUT, attn_mask_idx}); // mask
@@ -1313,9 +1366,12 @@ void SDPAMicroGenerator::init_microkernels(const kernel_impl_params& params,
bool is_prefill) {
// TODO: Remove once micro API is thread safe
std::lock_guard<std::mutex> l(m);
+
+ bool is_paged_attention = params.is_type<cldnn::paged_attention>();
+
const auto& Q = params.input_layouts[0];
- const auto& K = params.input_layouts[1];
- const auto& V = params.input_layouts[2];
+ const auto& K = (is_paged_attention && !is_prefill) ? params.input_layouts[3] : params.input_layouts[1];
+ const auto& V = (is_paged_attention && !is_prefill) ? params.input_layouts[4] : params.input_layouts[2];
auto& out = params.output_layouts[0];
const auto& out_ps = out.get_partial_shape();
const auto& device_info = params.get_device_info();
@@ -1342,24 +1398,31 @@ void SDPAMicroGenerator::init_microkernels(const kernel_impl_params& params,
(K.data_type == ov::element::u8 || K.data_type == ov::element::i8) || (V.data_type == ov::element::u8 || V.data_type == ov::element::i8);
int32_t nkeys_v = n_keys.is_dynamic() ? 0 : n_keys.get_length();
- bool is_paged_attention = false;
- if (params.is_type<cldnn::paged_attention>()) {
- is_paged_attention = true;
- }
-
GPU_DEBUG_TRACE_DETAIL << "k_head_size = " << k_head_size << ", nkeys_v = " << nkeys_v << "\n";
GPU_DEBUG_TRACE_DETAIL << "thin_q = " << thin_q << ", is_quantized = " << is_quantized << "\n";
switch (device_info.arch) {
case gpu_arch::xe_hpg: {
- config = choose_config_xehpg(static_cast<int32_t>(k_head_size), static_cast<int32_t>(nkeys_v), thin_q, is_quantized, is_paged_attention);
+ config = choose_config_xehpg(static_cast<int32_t>(k_head_size), static_cast<int32_t>(nkeys_v), thin_q, is_quantized, is_paged_attention, is_prefill);
break;
}
case gpu_arch::xe_hpc:
- config = choose_config_xehpc(static_cast<int32_t>(k_head_size), static_cast<int32_t>(nkeys_v), thin_q, is_quantized, is_integrated, is_paged_attention);
+ config = choose_config_xehpc(static_cast<int32_t>(k_head_size),
+ static_cast<int32_t>(nkeys_v),
+ thin_q,
+ is_quantized,
+ is_integrated,
+ is_paged_attention,
+ is_prefill);
break;
case gpu_arch::xe2:
case gpu_arch::xe3: {
- config = choose_config_xe2(static_cast<int32_t>(k_head_size), static_cast<int32_t>(nkeys_v), thin_q, is_quantized, is_integrated, is_paged_attention);
+ config = choose_config_xe2(static_cast<int32_t>(k_head_size),
+ static_cast<int32_t>(nkeys_v),
+ thin_q,
+ is_quantized,
+ is_integrated,
+ is_paged_attention,
+ is_prefill);
break;
}
default:
@@ -1384,7 +1447,7 @@ void SDPAMicroGenerator::init_microkernels(const kernel_impl_params& params,
problem.Ts = problem.Tc;
auto problem_kq = problem;
- problem_kq.A.layout = micro::MatrixLayout::T;
+ problem_kq.A.layout = (is_paged_attention && !is_prefill) ? micro::MatrixLayout::N : micro::MatrixLayout::T;
/* Set up microkernel options */
micro::GEMMProtocol::Options opts_kq;
@@ -1392,38 +1455,76 @@ void SDPAMicroGenerator::init_microkernels(const kernel_impl_params& params,
opts_kq.slmPtr = true;
const bool use_asymmetric_quantization = configuration.use_asymmetric_quantization;
- const auto key_cache_id = micro_get_key_cache_id(params);
- if (configuration.is_kv_compressed && !kq_common_scales) {
- const auto& key_cache_comp_scale = params.input_layouts[key_cache_id];
- const auto scale_dt = convert_type(key_cache_comp_scale.data_type);
+
+ if (is_paged_attention && !is_prefill && is_quantized) {
+ problem.Ta = micro::Type::s8;
+
+ const auto scale_dt = convert_type(ov::element::f16);
problem_kq.Ta_scale = scale_dt;
problem_kq.A_scale.setAlignment(scale_dt.size());
problem_kq.A_scale.layout = micro::MatrixLayout::N;
problem_kq.asPtrDims = 2;
- GPU_DEBUG_TRACE_DETAIL << "kq: key_cache_id = " << key_cache_id << std::endl;
- }
- if (configuration.is_kv_compressed && use_asymmetric_quantization) {
- const auto& key_cache_comp_zp = params.input_layouts[key_cache_id + 2];
- const auto zp_dt = convert_type(key_cache_comp_zp.data_type);
+ const auto zp_dt = convert_type(ov::element::f16);
problem_kq.Tao = zp_dt;
problem_kq.AO.setAlignment(zp_dt.size());
problem_kq.AO.layout = micro::MatrixLayout::N;
- problem_kq.aoPtrDims = kq_common_zp ? 0 : 2;
+ problem_kq.aoPtrDims = 2;
problem_kq.aOffset = micro::ABOffset::Calc;
- }
- if (configuration.is_kv_compressed) {
- problem_kq.aqGroupM = 1;
- problem_kq.aqGroupK = (kq_common_scales || kq_common_zp) ? 1 : static_cast<int>(k_head_size);
- }
+ auto pa_desc = params.typed_desc<paged_attention>();
+ if (pa_desc->is_key_by_channel) {
+ problem_kq.aqGroupM = config->unroll_m_kq * config->wg_m_kq;
+ problem_kq.aqGroupK = 1;
+ } else {
+ problem_kq.aqGroupM = 1;
+ problem_kq.aqGroupK = static_cast<int>(k_head_size);
+ }
+
+ opts_kq.scaleA = true;
+ opts_kq.offsetA = true;
+ } else {
+ const auto key_cache_id = micro_get_key_cache_id(params);
+ if (configuration.is_kv_compressed && !kq_common_scales) {
+ const auto& key_cache_comp_scale = params.input_layouts[key_cache_id];
+ const auto scale_dt = convert_type(key_cache_comp_scale.data_type);
+ problem_kq.Ta_scale = scale_dt;
+ problem_kq.A_scale.setAlignment(scale_dt.size());
+ problem_kq.A_scale.layout = micro::MatrixLayout::N;
+ problem_kq.asPtrDims = 2;
+ GPU_DEBUG_TRACE_DETAIL << "kq: key_cache_id = " << key_cache_id << std::endl;
+ }
- opts_kq.scaleA = configuration.is_kv_compressed && !kq_common_scales;
- opts_kq.offsetA = configuration.is_kv_compressed && use_asymmetric_quantization;
+ if (configuration.is_kv_compressed && use_asymmetric_quantization) {
+ const auto& key_cache_comp_zp = params.input_layouts[key_cache_id + 2];
+ const auto zp_dt = convert_type(key_cache_comp_zp.data_type);
+ problem_kq.Tao = zp_dt;
+ problem_kq.AO.setAlignment(zp_dt.size());
+ problem_kq.AO.layout = micro::MatrixLayout::N;
+ problem_kq.aoPtrDims = kq_common_zp ? 0 : 2;
+ problem_kq.aOffset = micro::ABOffset::Calc;
+ }
+
+ if (configuration.is_kv_compressed) {
+ problem_kq.aqGroupM = 1;
+ problem_kq.aqGroupK = (kq_common_scales || kq_common_zp) ? 1 : static_cast<int>(k_head_size);
+ }
+
+ opts_kq.scaleA = configuration.is_kv_compressed && !kq_common_scales;
+ opts_kq.offsetA = configuration.is_kv_compressed && use_asymmetric_quantization;
+ }
problem_kq.B.layout = micro::MatrixLayout::Pr;
problem_kq.C.layout = micro::MatrixLayout::T;
problem_kq.A.setAlignment(micro::alignment_for_ld(k_head_size * problem.Ta));
+ if (is_paged_attention && !is_prefill) {
+ auto pa_desc = params.typed_desc<paged_attention>();
+ const auto paged_attention_block_size = static_cast<int>(paged_attention::block_size);
+ problem_kq.A.setAlignment(paged_attention_block_size * problem.Ta);
+ if (is_quantized && pa_desc->is_key_by_channel) {
+ problem_kq.A.setAlignment(paged_attention_block_size * problem.Ta + 4); // scale - 2 bytes, zp - 2 bytes
+ }
+ }
problem_kq.B.setAlignment(64); // Q is packed in VNNI format in SLM
problem_kq.B.crosspack = 2;
problem_kq.B.tileR = static_cast<uint16_t>(d_max);
@@ -1465,34 +1566,55 @@ void SDPAMicroGenerator::init_microkernels(const kernel_impl_params& params,
problem_vs.Ta_ext = convert_type(V.data_type);
problem_vs.A.layout = micro::MatrixLayout::N;
- const auto value_cache_id = micro_get_value_cache_id(params);
- if (configuration.is_kv_compressed && !vs_common_scales) {
- const auto& value_cache_comp_scale = params.input_layouts[value_cache_id];
- auto scale_dt = convert_type(value_cache_comp_scale.data_type);
+ if (is_paged_attention && !is_prefill && is_quantized) {
+ auto scale_dt = convert_type(ov::element::f16);
problem_vs.Ta_scale = scale_dt;
problem_vs.A_scale.setAlignment(scale_dt.size());
problem_vs.A_scale.layout = micro::MatrixLayout::N;
problem_vs.asPtrDims = 2;
- GPU_DEBUG_TRACE_DETAIL << "vs: value_cache_id = " << value_cache_id << std::endl;
- }
- if (configuration.is_kv_compressed && use_asymmetric_quantization) {
- const auto& value_cache_comp_zp = params.input_layouts[value_cache_id + 2];
- auto zp_dt = convert_type(value_cache_comp_zp.data_type);
+ auto zp_dt = convert_type(ov::element::f16);
problem_vs.Tao = zp_dt;
problem_vs.AO.setAlignment(zp_dt.size());
problem_vs.AO.layout = micro::MatrixLayout::N;
- problem_vs.aoPtrDims = vs_common_zp ? 0 : 2;
+ problem_vs.aoPtrDims = 2;
problem_vs.aOffset = micro::ABOffset::Calc;
- }
- if (configuration.is_kv_compressed) {
- problem_vs.aqGroupM = (vs_common_scales || vs_common_zp) ? 1 : static_cast<int>(micro::rnd_up_pow2(v_head_size));
+ problem_vs.aqGroupM = static_cast<int>(v_head_size);
problem_vs.aqGroupK = 1;
- }
- opts_vs.scaleA = configuration.is_kv_compressed && !vs_common_scales;
- opts_vs.offsetA = configuration.is_kv_compressed && use_asymmetric_quantization;
+ opts_vs.scaleA = true;
+ opts_vs.offsetA = true;
+ } else {
+ const auto value_cache_id = micro_get_value_cache_id(params);
+ if (configuration.is_kv_compressed && !vs_common_scales) {
+ const auto& value_cache_comp_scale = params.input_layouts[value_cache_id];
+ auto scale_dt = convert_type(value_cache_comp_scale.data_type);
+ problem_vs.Ta_scale = scale_dt;
+ problem_vs.A_scale.setAlignment(scale_dt.size());
+ problem_vs.A_scale.layout = micro::MatrixLayout::N;
+ problem_vs.asPtrDims = 2;
+ GPU_DEBUG_TRACE_DETAIL << "vs: value_cache_id = " << value_cache_id << std::endl;
+ }
+
+ if (configuration.is_kv_compressed && use_asymmetric_quantization) {
+ const auto& value_cache_comp_zp = params.input_layouts[value_cache_id + 2];
+ auto zp_dt = convert_type(value_cache_comp_zp.data_type);
+ problem_vs.Tao = zp_dt;
+ problem_vs.AO.setAlignment(zp_dt.size());
+ problem_vs.AO.layout = micro::MatrixLayout::N;
+ problem_vs.aoPtrDims = vs_common_zp ? 0 : 2;
+ problem_vs.aOffset = micro::ABOffset::Calc;
+ }
+
+ if (configuration.is_kv_compressed) {
+ problem_vs.aqGroupM = (vs_common_scales || vs_common_zp) ? 1 : static_cast<int>(micro::rnd_up_pow2(v_head_size));
+ problem_vs.aqGroupK = 1;
+ }
+
+ opts_vs.scaleA = configuration.is_kv_compressed && !vs_common_scales;
+ opts_vs.offsetA = configuration.is_kv_compressed && use_asymmetric_quantization;
+ }
problem_vs.B.layout = micro::MatrixLayout::Pr;
problem_vs.C.layout = micro::MatrixLayout::N;
diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa_micro.cl b/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa_micro.cl
index 452f581ff8e..6d99b7a9ec8 100644
--- a/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa_micro.cl
+++ b/src/plugins/intel_gpu/src/graph/impls/ocl_v2/sdpa_micro.cl
@@ -144,7 +144,12 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
const global VAL_DATA_T *V,
global half *A,
#if IS_PAGED_ATTENTION
- const __global INPUT3_TYPE* subsequence_begins,
+ const __global INPUT3_TYPE* subsequence_begins,
+ #if IS_PREFILL == 0
+ const __global INPUT3_TYPE* past_lens,
+ const __global INPUT3_TYPE* block_indices,
+ const __global INPUT3_TYPE* block_indices_begins,
+ #endif
#endif
#if WITH_ATTN_MASK
const global half *msk,
@@ -174,8 +179,12 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
const uint subsequence_begin = subsequence_begins[gws_mapping];
const uint subsequence_end = subsequence_begins[gws_mapping + 1];
const uint subsequence_query_block_idx = block_start_pos - subsequence_begin;
- const int k = subsequence_end - subsequence_begin;
- const int q = k;
+ const int q = subsequence_end - subsequence_begin;
+#if IS_PREFILL
+ const int k = q;
+#else
+ const int k = q + past_lens[gws_mapping];
+#endif
const int d = HEAD_SIZE;
#endif
uint sg_ij = sub_group_broadcast(get_local_id(1), 0);
@@ -190,10 +199,23 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
#endif
/* Leading dimension for matrices */
#if IS_PAGED_ATTENTION
- uint ldk = HEAD_SIZE * KV_HEADS_NUM + INPUT1_PAD_BEFORE_FEATURE_NUM + INPUT1_PAD_AFTER_FEATURE_NUM;
uint ldq = HEAD_SIZE * HEADS_NUM + INPUT0_PAD_BEFORE_FEATURE_NUM + INPUT0_PAD_AFTER_FEATURE_NUM;
- uint ldv = HEAD_SIZE * KV_HEADS_NUM + INPUT2_PAD_BEFORE_FEATURE_NUM + INPUT2_PAD_AFTER_FEATURE_NUM;
uint lda = HEAD_SIZE * HEADS_NUM;
+ #if IS_PREFILL
+ uint ldk = HEAD_SIZE * KV_HEADS_NUM + INPUT1_PAD_BEFORE_FEATURE_NUM + INPUT1_PAD_AFTER_FEATURE_NUM;
+ uint ldv = HEAD_SIZE * KV_HEADS_NUM + INPUT2_PAD_BEFORE_FEATURE_NUM + INPUT2_PAD_AFTER_FEATURE_NUM;
+ #else
+ uint ldk = ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE;
+ uint ldv = HEAD_SIZE;
+ #if IS_KV_COMPRESSED_PA
+ #if IS_KEY_BY_CHANNEL
+ uint ldkq = ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE / 2;
+ #else
+ uint ldkq = 1;
+ #endif
+ uint ldvq = 1;
+ #endif
+ #endif
#else
uint ldk = TRANSPOSE_K ? KEY_S3 : KEY_S2;
uint ldq = QRY_S2;
@@ -240,14 +262,21 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
/* Locate K/Q/V/A matrices within batch */
#if IS_PAGED_ATTENTION
- K += subsequence_begin * ldk
- + b0_kv * HEAD_SIZE + INPUT1_PAD_BEFORE_FEATURE_NUM;
Q += subsequence_begin * ldq
+ b0 * HEAD_SIZE + INPUT0_PAD_BEFORE_FEATURE_NUM;
- V += subsequence_begin * ldv
- + b0_kv * HEAD_SIZE + INPUT2_PAD_BEFORE_FEATURE_NUM;
A += subsequence_begin * lda
+ b0 * HEAD_SIZE;
+ #if IS_PREFILL
+ K += subsequence_begin * ldk
+ + b0_kv * HEAD_SIZE + INPUT1_PAD_BEFORE_FEATURE_NUM;
+ V += subsequence_begin * ldv
+ + b0_kv * HEAD_SIZE + INPUT2_PAD_BEFORE_FEATURE_NUM;
+ #else
+ const uint base_block_index = block_indices_begins[gws_mapping];
+
+ K += b0_kv * ADJUSTED_K_HEAD_SIZE * ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE;
+ V += b0_kv * ADJUSTED_V_HEAD_SIZE * PAGED_ATTENTION_BLOCK_SIZE;
+ #endif
#else
K += (KEY_OFF(b1, b0_kv, 0, 0) + INPUT1_OFFSET) / KEY_ELEMENTS_PER_BYTE;
Q += (QRY_OFF(b1, b0, 0, 0) + INPUT0_OFFSET);
@@ -413,6 +442,9 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
uint sg_i0_kq = sg_i_kq * ugemm_kq_sg_tile_m;
uint sg_j0_kq = sg_j_kq * ugemm_kq_sg_tile_n;
+
+ int k_chunk = min(k - k0, ugemm_kq_wg_tile_m);
+
#if WITH_ATTN_MASK
/* Load mask. No remainder handling needed assuming k block size is a power of 2. */
mask_tile_type mask_tile;
@@ -439,20 +471,42 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
#endif
/* Calculate S = (K^T) * Q */
+#if IS_PAGED_ATTENTION && IS_PREFILL == 0
+ int k_block_num = k0 / PAGED_ATTENTION_BLOCK_SIZE + sg_i_kq;
+ global KEY_DATA_T *K0 = K + KV_HEADS_NUM * ADJUSTED_K_HEAD_SIZE * ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE * block_indices[base_block_index + k_block_num]
+ - PAGED_ATTENTION_BLOCK_SIZE * sg_i_kq;
+ #if IS_KV_COMPRESSED_PA
+ #if IS_KEY_BY_CHANNEL
+ global KEY_DATA_T *K0_scales = K0 + PAGED_ATTENTION_BLOCK_SIZE * (sg_i_kq + 1);
+ global KEY_DATA_T *K0_zp = K0_scales + 2;
+ #else
+ global KEY_DATA_T *K0_scales = K0 + PAGED_ATTENTION_BLOCK_SIZE * (HEAD_SIZE - sg_i_kq);
+ global KEY_DATA_T *K0_zp = K0_scales + 2 * ADJUSTED_PAGED_ATTENTION_BLOCK_SIZE;
+ #endif
+ #endif
+
+ s_tile_type S_tile
+ = ugemm_kq(K0, ldk, Q_slm, D_MAX, k_chunk, ugemm_kq_wg_tile_n, d, 0,
+ 0, 0, sg_i_kq, sg_j_kq, (local char *)ugemm_slm
+ #if IS_KV_COMPRESSED_PA
+ , (global half *)K0_scales, (global half *)K0_zp, ldkq
+ #endif
+#else
s_tile_type S_tile
= ugemm_kq(K, ldk, Q_slm, D_MAX, k, ugemm_kq_wg_tile_n, d, k0,
0, 0, sg_i_kq, sg_j_kq, (local char *)ugemm_slm
-#if KEY_SCALES == QUANTIZE_2D
+ #if KEY_SCALES == QUANTIZE_2D
,
K_scales
-#endif
-#if KEY_ZERO_POINTS
+ #endif
+ #if KEY_ZERO_POINTS
,
K_zp
-#endif
-#if (KEY_SCALES == QUANTIZE_2D) || KEY_ZERO_POINTS
+ #endif
+ #if (KEY_SCALES == QUANTIZE_2D) || KEY_ZERO_POINTS
,
ldkq
+ #endif
#endif
);
@@ -484,10 +538,20 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
#endif
#if IS_CAUSAL
-#define greater_than(offset_k, offset_q) (offset_k > offset_q)
+ #if SLIDING_WINDOW_SIZE
+ #define greater_than(offset_k, offset_q) (offset_k > offset_q || offset_k <= (offset_q - SLIDING_WINDOW_SIZE))
+ #else
+ #define greater_than(offset_k, offset_q) (offset_k > offset_q)
+ #endif
+
+ int col_offset = wg_j0 + sg_j0_kq;
+ #if IS_PAGED_ATTENTION && IS_PREFILL == 0
+ col_offset += k - q;
+ #endif
+
/* Apply causal mask */
- tile_predicated_assignment_t(S_tile, k0 + sg_i0_kq, wg_j0 + sg_j0_kq,
- greater_than, -INFINITY, SUBGROUP_SIZE, ugemm_kq_c_type_block0,
+ tile_predicated_assignment_t(S_tile, k0 + sg_i0_kq, col_offset,
+ greater_than, -FLT_MAX, SUBGROUP_SIZE, ugemm_kq_c_type_block0,
ugemm_kq_c_type_block1, ugemm_kq_c_type_nblock0,
ugemm_kq_c_type_nblock1);
#endif
@@ -516,8 +580,6 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
}
#endif
-
- int k_chunk = min(k - k0, ugemm_kq_wg_tile_m);
#ifdef PREFETCH_V
/* Prefetch V tile. */
cooperative_prefetch_2d_maybe_rem(
@@ -725,6 +787,31 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
intel_work_group_barrier_arrive(CLK_LOCAL_MEM_FENCE);
/* Accumulate A += V * S */
+#if IS_PAGED_ATTENTION && IS_PREFILL == 0
+ for (int kb0 = 0; kb0 < k_chunk; kb0 += PAGED_ATTENTION_BLOCK_SIZE) {
+ uint s_block_num = kb0 / PAGED_ATTENTION_BLOCK_SIZE;
+ local half *Sb0 = S_slm + s_block_num * ugemm_kq_sg_tile_m * ugemm_kq_sg_tile_n;
+ uint v_block_num = (k0 + kb0) / PAGED_ATTENTION_BLOCK_SIZE;
+ global VAL_DATA_T *Vb0 = V + KV_HEADS_NUM * ADJUSTED_V_HEAD_SIZE * PAGED_ATTENTION_BLOCK_SIZE * block_indices[base_block_index + v_block_num];
+ int kb_chunk = min(k - k0 - kb0, PAGED_ATTENTION_BLOCK_SIZE);
+ #if IS_KV_COMPRESSED_PA
+ global VAL_DATA_T *Vb0_scales = Vb0 + HEAD_SIZE * PAGED_ATTENTION_BLOCK_SIZE;
+ global VAL_DATA_T *Vb0_zp = Vb0_scales + PAGED_ATTENTION_BLOCK_SIZE * 2;
+ #endif
+
+ a_tile_type A_tile1 = ugemm_vs(
+ Vb0, ldv, Sb0, ugemm_kq_wg_tile_m,
+ d, ugemm_kq_wg_tile_n, kb_chunk,
+ 0, 0, 0,
+ sg_i_vs, sg_j_vs, (local char *)ugemm_slm
+ #if IS_KV_COMPRESSED_PA
+ , (global half *)Vb0_scales, (global half *)Vb0_zp, ldvq
+ #endif
+ );
+
+ tile_binary(A_tile, A_tile1, binary_add);
+ }
+#else
a_tile_type A_tile1 = ugemm_vs(
V, ldv, S_slm, ugemm_kq_wg_tile_m, d, ugemm_kq_wg_tile_n,
k_chunk, 0, 0, 0, sg_i_vs, sg_j_vs, (local char *)ugemm_slm
@@ -743,13 +830,19 @@ KERNEL(micro_sdpa)(OPTIONAL_SHAPE_INFO_ARG
);
V += ldv * ugemm_kq_wg_tile_m / VAL_ELEMENTS_PER_BYTE;
+#endif
+
#if VAL_SCALES == QUANTIZE_2D
V_scales += ldvq * ugemm_kq_wg_tile_m;
#endif
#if VAL_ZERO_POINTS == QUANTIZE_2D
V_zp += ldvq * ugemm_kq_wg_tile_m / VAL_ZP_ELEMENTS_PER_BYTE;
#endif
+#if IS_PAGED_ATTENTION && IS_PREFILL == 0
+ // already done
+#else
tile_binary(A_tile, A_tile1, binary_add);
+#endif
}
/* Wait for column sums to be ready */
diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/paged_attention_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/paged_attention_gpu_test.cpp
index e590caeb6d4..093a77b6858 100644
--- a/src/plugins/intel_gpu/tests/unit/test_cases/paged_attention_gpu_test.cpp
+++ b/src/plugins/intel_gpu/tests/unit/test_cases/paged_attention_gpu_test.cpp
@@ -13,6 +13,7 @@
#include <intel_gpu/primitives/paged_attention.hpp>
#include <intel_gpu/primitives/permute.hpp>
#include <intel_gpu/primitives/reorder.hpp>
+#include <intel_gpu/primitives/reshape.hpp>
#include <intel_gpu/primitives/softmax.hpp>
using namespace cldnn;
@@ -75,6 +76,7 @@ struct CacheRotationDescriptor {
struct PagedAttentionManager {
int num_heads;
+ int num_kv_heads;
int k_head_size;
int v_head_size;
int block_size;
@@ -121,6 +123,7 @@ struct PagedAttentionManager {
cldnn::stream& stream,
const std::vector<SubsequenceDescriptor>& subsequence_descs,
int num_heads,
+ int num_kv_heads,
int k_head_size,
int v_head_size,
int block_size,
@@ -130,6 +133,7 @@ struct PagedAttentionManager {
bool has_score_aggregation,
CacheRotationDescriptor rotation_config)
: num_heads(num_heads)
+ , num_kv_heads(num_kv_heads)
, k_head_size(k_head_size)
, v_head_size(v_head_size)
, block_size(block_size)
@@ -152,8 +156,8 @@ struct PagedAttentionManager {
max_len = std::max(max_len, subsequence_desc.num_tokens + subsequence_desc.past_len);
query_data.push_back(generate_input_data(rg, num_heads, subsequence_desc.num_tokens, k_head_size));
- key_data.push_back(generate_input_data(rg, num_heads, subsequence_desc.num_tokens + subsequence_desc.past_len, k_head_size));
- value_data.push_back(generate_input_data(rg, num_heads, subsequence_desc.num_tokens + subsequence_desc.past_len, v_head_size));
+ key_data.push_back(generate_input_data(rg, num_kv_heads, subsequence_desc.num_tokens + subsequence_desc.past_len, k_head_size));
+ value_data.push_back(generate_input_data(rg, num_kv_heads, subsequence_desc.num_tokens + subsequence_desc.past_len, v_head_size));
past_lens.push_back(subsequence_desc.past_len);
int subsequence_start_pos = subsequence_begins[i];
@@ -209,15 +213,15 @@ struct PagedAttentionManager {
}
memory::ptr get_query_memory() {
- return get_QKV_memory(query_data, k_head_size, false);
+ return get_QKV_memory(query_data, num_heads, k_head_size, false);
}
memory::ptr get_key_memory() {
- return get_QKV_memory(key_data, k_head_size, true);
+ return get_QKV_memory(key_data, num_kv_heads, k_head_size, true);
}
memory::ptr get_value_memory() {
- return get_QKV_memory(value_data, v_head_size, true);
+ return get_QKV_memory(value_data, num_kv_heads, v_head_size, true);
}
memory::ptr get_key_cache_memory() {
@@ -234,7 +238,7 @@ struct PagedAttentionManager {
}
auto num_blocks = block_indices.back() + 1;
- auto key_cache_shape = ov::PartialShape{ num_blocks, num_heads, adjusted_head_size, adjusted_block_size };
+ auto key_cache_shape = ov::PartialShape{ num_blocks, num_kv_heads, adjusted_head_size, adjusted_block_size };
auto key_cache_layout = layout{ key_cache_shape, key_cache_dt, format::bfyx };
auto memory = test_engine.allocate_memory(key_cache_layout);
for (int i = 0; i < static_cast<int>(subsequence_descs.size()); i++) {
@@ -243,19 +247,19 @@ struct PagedAttentionManager {
int blocks_num = ceil_div(past_len, block_size);
int start_block_idx = block_indices[block_indices_begins[i]];
for (int block_idx = 0; block_idx < blocks_num; block_idx++) {
- int last_token_idx = block_idx == blocks_num - 1 ? past_len % block_size
+ int last_token_idx = block_idx == blocks_num - 1 ? (past_len - block_size * block_idx)
: block_size;
// quantize by channel
if (kv_cache_compression && key_cache_quant_mode == ov::internal::CacheQuantMode::BY_CHANNEL) {
- for (int head_idx = 0; head_idx < num_heads; head_idx++) {
+ for (int head_idx = 0; head_idx < num_kv_heads; head_idx++) {
for (int k_head_size_idx = 0; k_head_size_idx < k_head_size; k_head_size_idx++) {
std::vector<ov::float16> token_block(block_size);
for (int token_idx = 0; token_idx < last_token_idx; ++token_idx) {
size_t input_token_offset = block_idx * block_size + token_idx;
- token_block[token_idx] = *(key_data[i].data() + input_token_offset * num_heads * k_head_size + head_idx * k_head_size + k_head_size_idx);
+ token_block[token_idx] = *(key_data[i].data() + input_token_offset * num_kv_heads * k_head_size + head_idx * k_head_size + k_head_size_idx);
}
auto [quantized_data, scale, zp] = quantize_data(token_block.data(), last_token_idx, true);
- size_t output_block_offset = (start_block_idx + block_idx) * num_heads * adjusted_head_size * adjusted_block_size +
+ size_t output_block_offset = (start_block_idx + block_idx) * num_kv_heads * adjusted_head_size * adjusted_block_size +
head_idx * adjusted_head_size * adjusted_block_size;
size_t output_offset = output_block_offset +
k_head_size_idx * adjusted_block_size;
@@ -267,16 +271,16 @@ struct PagedAttentionManager {
}
}
for (int token_idx = 0; token_idx < last_token_idx; token_idx++) {
- for (int head_idx = 0; head_idx < num_heads; head_idx++) {
+ for (int head_idx = 0; head_idx < num_kv_heads; head_idx++) {
if (kv_cache_compression) {
if (key_cache_quant_mode == ov::internal::CacheQuantMode::BY_TOKEN) {
// quantize by token
size_t input_token_offset = block_idx * block_size + token_idx;
ov::float16* data_ptr = key_data[i].data() +
- input_token_offset * num_heads * k_head_size +
+ input_token_offset * num_kv_heads * k_head_size +
head_idx * k_head_size;
- // shape: [num_blocks, num_heads, adjusted_head_size, block_size]
- size_t output_block_offset = (start_block_idx + block_idx) * num_heads * adjusted_head_size * block_size +
+ // shape: [num_blocks, num_kv_heads, adjusted_head_size, block_size]
+ size_t output_block_offset = (start_block_idx + block_idx) * num_kv_heads * adjusted_head_size * block_size +
head_idx * adjusted_head_size * block_size;
auto [quantized_data, scale, zp] = quantize_data(data_ptr, k_head_size);
@@ -297,11 +301,11 @@ struct PagedAttentionManager {
for (int k_head_size_idx = 0; k_head_size_idx < k_head_size; k_head_size_idx++) {
size_t input_token_offset = block_idx * block_size + token_idx;
ov::float16* data_ptr = key_data[i].data() +
- input_token_offset * num_heads * k_head_size +
+ input_token_offset * num_kv_heads * k_head_size +
head_idx * k_head_size + k_head_size_idx;
- // shape: [num_blocks, num_heads, k_head_size, block_size]
- size_t output_offset = (start_block_idx + block_idx) * num_heads * k_head_size * block_size +
+ // shape: [num_blocks, num_kv_heads, k_head_size, block_size]
+ size_t output_offset = (start_block_idx + block_idx) * num_kv_heads * k_head_size * block_size +
head_idx * k_head_size * block_size +
k_head_size_idx * block_size +
token_idx;
@@ -327,7 +331,7 @@ struct PagedAttentionManager {
}
auto num_blocks = block_indices.back() + 1;
- auto value_cache_shape = ov::PartialShape{ num_blocks, num_heads, block_size, adjusted_head_size };
+ auto value_cache_shape = ov::PartialShape{ num_blocks, num_kv_heads, block_size, adjusted_head_size };
auto value_cache_layout = layout{ value_cache_shape, value_cache_dt, format::bfyx };
auto memory = test_engine.allocate_memory(value_cache_layout);
@@ -337,20 +341,20 @@ struct PagedAttentionManager {
int blocks_num = ceil_div(past_len, block_size);
int start_block_idx = block_indices[block_indices_begins[i]];
for (int block_idx = 0; block_idx < blocks_num; block_idx++) {
- int last_token_idx = block_idx == blocks_num - 1 ? past_len % block_size
+ int last_token_idx = block_idx == blocks_num - 1 ? (past_len - block_size * block_idx)
: block_size;
for (int token_idx = 0; token_idx < last_token_idx; token_idx++) {
- for (int head_idx = 0; head_idx < num_heads; head_idx++) {
+ for (int head_idx = 0; head_idx < num_kv_heads; head_idx++) {
size_t input_token_offset = block_idx * block_size + token_idx;
ov::float16* data_ptr = value_data[i].data() +
- input_token_offset * num_heads * v_head_size +
+ input_token_offset * num_kv_heads * v_head_size +
head_idx * v_head_size;
if (kv_cache_compression) {
auto [quantized_data, scale, zp] = quantize_data(data_ptr, v_head_size);
auto quantized_data_ptr = quantized_data.data();
- // shape: [num_blocks, num_heads, block_size, adjusted_head_size]
- size_t output_block_offset = (start_block_idx + block_idx) * num_heads * block_size * adjusted_head_size +
+ // shape: [num_blocks, num_kv_heads, block_size, adjusted_head_size]
+ size_t output_block_offset = (start_block_idx + block_idx) * num_kv_heads * block_size * adjusted_head_size +
head_idx * block_size * adjusted_head_size;
size_t output_offset = output_block_offset +
token_idx * v_head_size;
@@ -360,8 +364,8 @@ struct PagedAttentionManager {
set_values(test_stream, memory, &scale, 1, comp_offset + token_idx);
set_values(test_stream, memory, &zp, 1, comp_offset + block_size + token_idx);
} else {
- // shape: [num_blocks, num_heads, block_size, v_head_size]
- size_t output_offset = (start_block_idx + block_idx) * num_heads * block_size * v_head_size +
+ // shape: [num_blocks, num_kv_heads, block_size, v_head_size]
+ size_t output_offset = (start_block_idx + block_idx) * num_kv_heads * block_size * v_head_size +
head_idx * block_size * v_head_size +
token_idx * v_head_size;
@@ -501,12 +505,12 @@ private:
return memory;
}
- memory::ptr get_QKV_memory(std::vector<std::vector<ov::float16>>& input_data, int k_head_size, bool skip_past_len) {
+ memory::ptr get_QKV_memory(std::vector<std::vector<ov::float16>>& input_data, int num_heads, int head_size, bool skip_past_len) {
int total_tokens = 0;
for (const auto& subsequence_desc : subsequence_descs)
total_tokens += subsequence_desc.num_tokens;
- auto query_shape = ov::PartialShape{ total_tokens, num_heads * k_head_size };
+ auto query_shape = ov::PartialShape{ total_tokens, num_heads * head_size };
auto query_layout = layout{ query_shape, data_types::f16, format::bfyx };
auto memory = test_engine.allocate_memory(query_layout);
@@ -519,14 +523,14 @@ private:
input_token_offset += subsequence_descs[subsequence_idx].past_len;
ov::float16* data_ptr = input_data[subsequence_idx].data() +
- input_token_offset * num_heads * k_head_size +
- head_idx * k_head_size;
+ input_token_offset * num_heads * head_size +
+ head_idx * head_size;
size_t output_token_offset = subsequence_begins[subsequence_idx] + token_idx;
- size_t output_offset = output_token_offset * num_heads * k_head_size +
- head_idx * k_head_size;
+ size_t output_offset = output_token_offset * num_heads * head_size +
+ head_idx * head_size;
- set_values(test_stream, memory, data_ptr, k_head_size, output_offset);
+ set_values(test_stream, memory, data_ptr, head_size, output_offset);
}
}
}
@@ -650,7 +654,7 @@ struct PagedAttentionReference {
pam.rotation_trig_lut,
index,
subsequence_rotated_block_idx,
- pam.num_heads,
+ pam.num_kv_heads,
pam.k_head_size,
pam.block_size,
pam.rotation_config.per_block);
@@ -666,6 +670,7 @@ struct PagedAttentionReference {
subsequence_desc.num_tokens,
kv_seq_len,
pam.num_heads,
+ pam.num_kv_heads,
pam.k_head_size,
pam.v_head_size,
window_size,
@@ -692,18 +697,25 @@ private:
int num_queries,
int num_keys,
int num_heads,
+ int num_kv_heads,
int k_head_size,
int v_head_size,
int window_size,
int sliding_window_size,
float scale) {
auto query_shape = ov::PartialShape{1, num_queries, num_heads, k_head_size};
- auto key_shape = ov::PartialShape{1, num_keys, num_heads, k_head_size};
- auto value_shape = ov::PartialShape{1, num_keys, num_heads, v_head_size};
+ auto key_shape = ov::PartialShape{1, num_keys, num_kv_heads, k_head_size};
+ auto value_shape = ov::PartialShape{1, num_keys, num_kv_heads, v_head_size};
+ if (num_heads != num_kv_heads) {
+ query_shape = ov::PartialShape{num_queries, num_kv_heads, (num_heads / num_kv_heads), k_head_size};
+ key_shape = ov::PartialShape{num_keys, num_kv_heads, 1, k_head_size};
+ value_shape = ov::PartialShape{num_keys, num_kv_heads, 1, v_head_size};
+ }
auto query_layout = layout{query_shape, data_types::f16, format::bfyx};
auto key_layout = layout{key_shape, data_types::f16, format::bfyx};
auto value_layout = layout{value_shape, data_types::f16, format::bfyx};
+ auto scale_layout = cldnn::layout({1}, data_types::f16, format::bfyx);
OPENVINO_ASSERT(query_layout.count() == query_data.size());
OPENVINO_ASSERT(key_layout.count() == key_data.size());
@@ -713,27 +725,52 @@ private:
auto key_mem = test_engine.allocate_memory(key_layout);
auto value_mem = test_engine.allocate_memory(value_layout);
auto mask_mem = get_mask_mem(num_queries, num_keys, num_heads, sliding_window_size);
+ auto scale_mem = test_engine.allocate_memory(scale_layout);
set_values(query_mem, query_data);
set_values(key_mem, key_data);
set_values(value_mem, value_data);
+ set_values(scale_mem, {static_cast<ov::float16>(scale)});
topology topology;
- topology.add(input_layout("query", query_layout),
- input_layout("key", key_layout),
- input_layout("value", value_layout),
- data("mask", mask_mem),
- permute("query_transposed", input_info("query"), {0, 2, 1, 3}),
- permute("key_transposed", input_info("key"), {0, 2, 1, 3}),
- permute("value_transposed", input_info("value"), {0, 2, 1, 3}),
- gemm("qk_gemm", { input_info("query_transposed"), input_info("key_transposed") }, data_types::f16, false, true, scale),
- eltwise("eltwise", { input_info("qk_gemm"), input_info("mask") }, eltwise_mode::sum),
- softmax("softmax", input_info("eltwise"), -1),
- gemm("qkv_gemm", { input_info("softmax"), input_info("value_transposed") }, data_types::f16, false, false),
- permute("qkv_gemm_transposed", input_info("qkv_gemm"), {0, 2, 1, 3}),
- reorder("output_data", input_info("qkv_gemm_transposed"), format::bfyx, data_types::f16),
- reorder("scores_data", input_info("softmax"), format::bfyx, data_types::f16)
- );
+ if (num_heads == num_kv_heads) {
+ topology.add(input_layout("query", query_layout),
+ input_layout("key", key_layout),
+ input_layout("value", value_layout),
+ data("mask", mask_mem),
+ data("scale", scale_mem),
+ permute("query_transposed", input_info("query"), {0, 2, 1, 3}),
+ permute("key_transposed", input_info("key"), {0, 2, 3, 1}),
+ permute("value_transposed", input_info("value"), {0, 2, 1, 3}),
+ gemm("qk_gemm", { input_info("query_transposed"), input_info("key_transposed") }, data_types::f16, false, false),
+ eltwise("scale_div", { input_info("qk_gemm"), input_info("scale") }, eltwise_mode::prod),
+ eltwise("eltwise", { input_info("scale_div"), input_info("mask") }, eltwise_mode::sum),
+ softmax("softmax", input_info("eltwise"), -1),
+ gemm("qkv_gemm", { input_info("softmax"), input_info("value_transposed") }, data_types::f16, false, false),
+ permute("qkv_gemm_transposed", input_info("qkv_gemm"), {0, 2, 1, 3}),
+ reorder("output_data", input_info("qkv_gemm_transposed"), format::bfyx, data_types::f16),
+ reorder("scores_data", input_info("softmax"), format::bfyx, data_types::f16)
+ );
+ } else {
+ topology.add(input_layout("query", query_layout),
+ input_layout("key", key_layout),
+ input_layout("value", value_layout),
+ data("mask", mask_mem),
+ data("scale", scale_mem),
+ permute("query_transposed", input_info("query"), {1, 2, 0, 3}),
+ permute("key_transposed", input_info("key"), {1, 2, 3, 0}),
+ permute("value_transposed", input_info("value"), {1, 2, 0, 3}),
+ gemm("qk_gemm", { input_info("query_transposed"), input_info("key_transposed") }, data_types::f16, false, false),
+ eltwise("scale_div", { input_info("qk_gemm"), input_info("scale") }, eltwise_mode::prod),
+ eltwise("eltwise", { input_info("scale_div"), input_info("mask") }, eltwise_mode::sum),
+ softmax("softmax", input_info("eltwise"), -1),
+ gemm("qkv_gemm", { input_info("softmax"), input_info("value_transposed") }, data_types::f16, false, false),
+ reshape("qkv_gemm_reshape", input_info("qkv_gemm"), {1, num_heads, v_head_size, num_queries}),
+ permute("qkv_gemm_transposed", input_info("qkv_gemm_reshape"), {0, 2, 1, 3}),
+ reorder("output_data", input_info("qkv_gemm_transposed"), format::bfyx, data_types::f16),
+ reorder("scores_data", input_info("softmax"), format::bfyx, data_types::f16)
+ );
+ }
ExecutionConfig config = get_test_default_config(test_engine);
config.set_property(ov::intel_gpu::optimize_data(true));
@@ -916,6 +953,7 @@ public:
get_test_stream(),
p.subsequences,
p.num_heads,
+ p.num_kv_heads,
p.k_head_size,
p.v_head_size,
p.block_size,
@@ -982,10 +1020,20 @@ public:
// make layouts dynamic
query_layout.set_partial_shape(ov::PartialShape{ -1, p.num_heads * p.k_head_size });
- key_layout.set_partial_shape(ov::PartialShape{ -1, p.num_heads * p.k_head_size });
- value_layout.set_partial_shape(ov::PartialShape{ -1, p.num_heads * p.v_head_size });
- key_cache_layout.set_partial_shape(ov::PartialShape{ -1, p.num_heads, p.k_head_size, p.block_size });
- value_cache_layout.set_partial_shape(ov::PartialShape{ -1, p.num_heads, p.block_size, p.v_head_size });
+ key_layout.set_partial_shape(ov::PartialShape{ -1, p.num_kv_heads * p.k_head_size });
+ value_layout.set_partial_shape(ov::PartialShape{ -1, p.num_kv_heads * p.v_head_size });
+ // key_cache_layout.set_partial_shape(ov::PartialShape{ -1, p.num_heads, p.k_head_size, p.block_size });
+ {
+ auto pshape = key_cache_layout.get_partial_shape();
+ pshape[0] = -1;
+ key_cache_layout.set_partial_shape(pshape);
+ }
+ // value_cache_layout.set_partial_shape(ov::PartialShape{ -1, p.num_heads, p.block_size, p.v_head_size });
+ {
+ auto pshape = value_cache_layout.get_partial_shape();
+ pshape[0] = -1;
+ value_cache_layout.set_partial_shape(pshape);
+ }
past_lens_layout.set_partial_shape(ov::PartialShape{ -1 });
subsequence_begins_layout.set_partial_shape(ov::PartialShape{ -1 });
block_indices_layout.set_partial_shape(ov::PartialShape{ -1 });
@@ -1055,7 +1103,7 @@ public:
pa_prim.k_head_size = p.k_head_size;
pa_prim.v_head_size = p.v_head_size;
- pa_prim.kv_heads_num = p.num_heads;
+ pa_prim.kv_heads_num = p.num_kv_heads;
pa_prim.heads_num = p.num_heads;
pa_prim.scale_val = pam.get_default_scale();
pa_prim.has_alibi = false;
@@ -1168,6 +1216,7 @@ public:
struct paged_attention_test_params {
std::vector<SubsequenceDescriptor> subsequences;
int num_heads;
+ int num_kv_heads;
int k_head_size;
int v_head_size;
int block_size;
@@ -1203,111 +1252,123 @@ const auto DISABLE_FA_V2 = true;
INSTANTIATE_TEST_SUITE_P(smoke_paged_attention, paged_attention_test, ::testing::ValuesIn(std::vector<paged_attention_test_params>{
/* with scores output, use SnapKV */
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{36, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{1, 10}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{36, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{1, 10}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES_SNAPKV, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
/* with scores output */
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 16, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 128, 96, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{36, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{36, 0}}, 2, 64, 48, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{36, 0}}, 2, 96, 128, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{1024, 0}}, 2, 32, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 48, 96, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{1, 10}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 10}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 48, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 16, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 16, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 128, 96, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{36, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{36, 0}}, 2, 2, 64, 48, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{36, 0}}, 2, 2, 96, 128, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 32, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 48, 96, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{1, 10}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{1, 10}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 48, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 16, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
/* without scores output, dynamic input query paddings */
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
/* with scores, per_block rotation */
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{36, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{36, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 64, 48, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 48, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{1, 10}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 10}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION, ov::internal::CacheQuantMode::BY_TOKEN,STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{36, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{36, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 2, 64, 48, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 48, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{1, 10}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{1, 10}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
/* with scores, per_token rotation */
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 128, 192, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 32, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 128, 192, 16, 0, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
/* without scores output, dynamic input query paddings, KV-cache compression */
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{1024, 0}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
- paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{1024, 0}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token long
+ paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{10, 0}, {81, 0}, {129, 0}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
/* with scores, per_block rotation, KV-cache compression */
- paged_attention_test_params{ {{1, 34}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 34}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{1, 34}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{1, 34}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, DISABLE_FA_V2 }, // 2nd token
/* with scores, per_token rotation, KV-cache compression */
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
- paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {1, 515}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{1, 34}, {25, 0}, {10, 34}}, 2, 2, 64, 32, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
/* With sliding windows */
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 6, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}}, 2, 64, 64, 16, 6, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{512, 0}}, 2, 64, 32, 16, 20, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{512, 0}}, 2, 64, 32, 16, 20, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
- paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 64, 64, 16, 8, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
- paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 48, 64, 16, 128, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
- paged_attention_test_params{ {{1, 10}}, 2, 64, 64, 16, 4, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 10}}, 2, 64, 64, 16, 4, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{5, 10}}, 2, 64, 64, 16, 2, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{5, 10}}, 2, 64, 64, 16, 2, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
- paged_attention_test_params{ {{1, 34}, {2, 20}, {10, 34}}, 2, 64, 64, 16, 10, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 6, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}}, 2, 2, 64, 64, 16, 6, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{512, 0}}, 2, 2, 64, 32, 16, 20, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{512, 0}}, 2, 2, 64, 32, 16, 20, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, DYNAMIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{10, 0}, {30, 0}}, 2, 2, 64, 64, 16, 8, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token + 2nd token
+ paged_attention_test_params{ {{128, 0}, {256, 0}}, 2, 2, 48, 64, 16, 128, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_BLOCK_ROTATION, ENABLE_FA_V2 }, // 1st token + 1st token
+ paged_attention_test_params{ {{1, 10}}, 2, 2, 64, 64, 16, 4, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{5, 10}}, 2, 2, 64, 64, 16, 2, DISABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, DISABLE_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{8, 8}}, 16, 16, 256, 256, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{34, 0}}, 2, 2, 32, 32, 16, 2, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 1st token
+ paged_attention_test_params{ {{1, 1008}}, 32, 32, 128, 128, 16, 6, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // 2nd token
+ paged_attention_test_params{ {{6, 20}}, 2, 2, 128, 128, 16, 8, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{254, 10}}, 32, 8, 128, 128, 16, 10, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching, GQA
+ paged_attention_test_params{ {{84, 2}}, 32, 32, 128, 128, 16, 16, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{1008, 492}}, 32, 32, 32, 32, 16, 32, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{1008, 492}}, 16, 16, 64, 64, 16, 64, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{1008, 492}}, 8, 8, 128, 128, 16, 128, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{2, 30}}, 2, 2, 64, 64, 16, 0, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{232, 24}}, 2, 2, 512, 512, 16, 32, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_CHANNEL, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{1008, 592}}, 32, 32, 128, 128, 16, 64, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{1008, 692}}, 32, 32, 128, 128, 16, 128, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{1008, 792}}, 32, 32, 128, 128, 16, 256, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, DISABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: prefix caching
+ paged_attention_test_params{ {{1, 34}, {2, 20}, {10, 34}}, 2, 2, 64, 64, 16, 10, ENABLE_CACHE_COMPRESSION,ov::internal::CacheQuantMode::BY_TOKEN, STATIC_INPUT_PAD, ENABLE_SCORES, PER_TOKEN_ROTATION, DISABLE_FA_V2 }, // mixed: 2nd token + 1st token + part of 1st token
}));