Skip to content

[GPU] Fix PA micro-SDPA prefill KQ OOB read#36318

Open
ofirzaf wants to merge 2 commits into
openvinotoolkit:masterfrom
ofirzaf:sdpa-gen-micro-fix
Open

[GPU] Fix PA micro-SDPA prefill KQ OOB read#36318
ofirzaf wants to merge 2 commits into
openvinotoolkit:masterfrom
ofirzaf:sdpa-gen-micro-fix

Conversation

@ofirzaf

@ofirzaf ofirzaf commented Jun 9, 2026

Copy link
Copy Markdown

Details:

  • Fix GPU PagedAttention micro-SDPA prefill crash in sdpa_micro__prefill when the KQ microkernel handles a partial final K tile.
  • The PA prefill path passes raw, unpadded KEY input, but the selected KQ GEMM strategy treated matrix A/K as padded and used block loads. This could issue out-of-bounds K reads and surface as CL_OUT_OF_RESOURCES.
  • Scope the fix to PA prefill KQ only by forcing bounds-safe K access: clear A.padded, use AccessType::Scattered, and keep double masking enabled.
  • Add a focused GPU unit regression:
    paged_attention_micro_sdpa_prefill_oob_sequence_test.partial_kv_tile_unpadded_key_input

Validation:

  • Without the fix, the regression test reproduces the prefill failure/non-zero abort; traced during investigation to CL_OUT_OF_RESOURCES in sdpa_micro__prefill.
  • With the fix, the test passes and compares against PagedAttentionReference.

Tickets:

  • TBD

AI Assistance:

  • AI assistance used: yes
  • AI was used for root-cause investigation support and PR text drafting. The fix and regression test were manually reviewed and validated with the targeted GPU unit test.

@ofirzaf ofirzaf requested review from a team as code owners June 9, 2026 07:39
@github-actions github-actions Bot added the category: GPU OpenVINO GPU plugin label Jun 9, 2026
@sys-openvino-ci sys-openvino-ci added the ExternalIntelPR External contributor from Intel label Jun 9, 2026
@ofirzaf ofirzaf force-pushed the sdpa-gen-micro-fix branch from 963d616 to 9ea684d Compare June 9, 2026 07:42
@e-ddykim

e-ddykim commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

build_jenkins

@e-ddykim e-ddykim self-assigned this Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: GPU OpenVINO GPU plugin ExternalIntelPR External contributor from Intel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants