+
    œ°³j�
  ã                   ó6   € ^ RI t ^RIHt R R ltRR R lltR# )é    N)ÚPagedAttentionCachec                ód   € V ^8„  d   QhR\         P                  R\        R\         P                  /# )é   Úhidden_statesÚn_repÚreturn)ÚtorchÚTensorÚint)Úformats   "Úe/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/integrations/sdpa_paged.pyÚ__annotate__r      s.   € ÷ 	Uñ 	UœUŸ\™\ð 	U´#ð 	U¼%¿,¹,ñ 	Uó    c                ó˜   € V P                   w  r#rEV^8X  d   V # V R,          P                  W#WV4      p V P                  W#V,          WE4      # )zÈ
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
)ºNNNr   Nr   r   )ÚshapeÚexpandÚreshape)r   r   ÚbatchÚnum_key_value_headsÚslenÚhead_dims   &&    r   Ú	repeat_kvr      sU   € ð
 2?×1DÑ1DÑ.€E Ø�„zØÐØ!Ð"2Õ3×:Ñ:¸5ÐW\ÐdlÓm€MØ× Ñ  ¸eÕ(CÀTÓTÐTr   c                ó:  € V ^8„  d   QhR\         P                  P                  R\         P                  R\         P                  R\         P                  R\         P                  R,          R\        R\        R,          R	\
        \         P                  R3,          /# )
r   ÚmoduleÚqueryÚkeyÚvalueÚattention_maskNÚdropoutÚscalingr   )r	   ÚnnÚModuler
   ÚfloatÚtuple)r   s   "r   r   r      s‡   € ÷ 5ñ 5Ü�H‰H�O‰Oð5ä�<‰<ð5ô 
�‰ð5ô �<‰<ð	5ô
 —L‘L 4Õ'ð5ô ð5ô �T�\ð5ô Œ5�<‰<˜ÐÕñ5r   c           
      ó¬  € VP                  R R4      pVf   \        R4      hVP                  VVV P                  VR,          VR,          R7      w  r#VP	                  ^ ^4      P                  ^ 4      pVP	                  ^ ^4      P                  ^ 4      p\        V R4      '       d+   \        W P                  4      p\        W0P                  4      pTp	VP                  4       pVP                  4       pVP                  4       p\        P                  P                  P                  VVVV	VVRR7      p
V
P	                  ^^4      P                  4       p
V
R3# )	ÚcacheNzó`paged|sdpa` was called without a paged attention cache. This implementation expects the packed inputs and the 4D mask that continuous batching prepares; on a standard forward it would attend bidirectionally. Use `sdpa` for a standard forward.Ú
read_indexÚwrite_index)Ú
key_statesÚvalue_statesÚ	layer_idxr(   r)   Únum_key_value_groupsF)Ú	attn_maskÚ	dropout_pÚscaleÚ	is_causal)ÚpopÚ
ValueErrorÚupdater,   Ú	transposeÚ	unsqueezeÚhasattrr   r-   Ú
contiguousr	   r"   Ú
functionalÚscaled_dot_product_attention)r   r   r   r   r   r    r!   Úkwargsr'   Úcausal_maskÚattn_outputs   &&&&&&&,   r   Úsdpa_attention_paged_forwardr>      sX  € ð )/¯
©
°7¸DÓ(A€EØ‚}ÜðBó
ð 	
ð —‘ØØØ×"Ñ"Ø˜,Õ'Ø˜=Õ)ð ó �J€Cð �-‰-˜˜1Ó
×
'Ñ
'¨Ó
*€CØ�O‰O˜A˜qÓ!×+Ñ+¨AÓ.€Eô ˆvÐ-×.Ò.Ü˜×8Ñ8Ó9ˆÜ˜%×!<Ñ!<Ó=ˆð !€Kð ×ÑÓ€EØ
�.‰.Ó
€CØ×ÑÓ€EÜ—(‘(×%Ñ%×BÑBØØØØØØàð Có 	€Kð ×'Ñ'¨¨1Ó-×8Ñ8Ó:€Kà˜ÐÐr   )g        N)r	   Ú$generation.continuous_batching.cacher   r   r>   © r   r   Ú<module>rA      s   ðÛ å Fõ	U÷5ñ 5r   