+
    œ°³j   ã                   ó>   € ^ RI t ^ RI Ht ^RIHt R R ltR R ltR# )é    N)Únn)ÚPagedAttentionCachec                ód   € V ^8„  d   QhR\         P                  R\        R\         P                  /# )é   Úhidden_statesÚn_repÚreturn)ÚtorchÚTensorÚint)Úformats   "Úf/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/integrations/eager_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                  R\        P                  R\        P                  R\        P                  R\        P                  R,          R\        /# )r   ÚmoduleÚqueryÚkeyÚvalueÚattention_maskNÚscaling)r   ÚModuler
   r   Úfloat)r   s   "r   r   r      s]   € ÷ =%ñ =%Ü�I‰Ið=%ä�<‰<ð=%ô 
�‰ð=%ô �<‰<ð	=%ô
 —L‘L 4Õ'ð=%ô ñ=%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\        V\        4      '       d&   \        V R^4      pV^8X  g   Vf   RMR	p	WI,          p
MTp
\        P                  ! WP	                  ^^4      4      V,          pV
e	   Wº,           p\        V R
4      '       dæ   V P                  P                  ^R^^4      P!                  VP"                  ^ ,          RVP"                  R,          R4      p\        P$                  ! W¼.RR7      pW»P'                  RRR7      P(                  ,
          p\*        P,                  P/                  VR\        P0                  R7      P3                  VP4                  4      pVRRR13,          pMI\*        P,                  P/                  VR\        P0                  R7      P3                  VP4                  4      p\        P                  ! W³4      pVP	                  ^^4      P7                  4       pWÛ3# )ÚcacheNzõ`paged|eager` 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 `eager` for a standard forward.Ú
read_indexÚwrite_index)Ú
key_statesÚvalue_statesÚ	layer_idxr&   r'   Únum_key_value_groupsÚsliding_windowÚfull_attentionÚsliding_attentionÚsinks)ÚdimT)r0   Úkeepdim)r0   Údtype.éÿÿÿÿéþÿÿÿ)ÚpopÚ
ValueErrorÚupdater*   Ú	transposeÚ	unsqueezeÚhasattrr   r+   Ú
isinstanceÚdictÚgetattrr
   Úmatmulr/   r   r   r   ÚcatÚmaxÚvaluesr   Ú
functionalÚsoftmaxÚfloat32Útor2   Ú
contiguous)r   r   r   r   r    r!   Úkwargsr%   r,   Ú
layer_typeÚcausal_maskÚattn_weightsr/   Úattn_outputs   &&&&&&,       r   Úeager_paged_attention_forwardrL      sY  € ð )/¯
©
°7¸DÓ(A€EØ‚}ÜðCó
ð 	
ð —‘ØØØ×"Ñ"Ø˜,Õ'Ø˜=Õ)ð ó �J€Cð �-‰-˜˜1Ó
×
'Ñ
'¨Ó
*€CØ�O‰O˜A˜qÓ!×+Ñ+¨AÓ.€Eô ˆvÐ-×.Ò.Ü˜×8Ñ8Ó9ˆÜ˜%×!<Ñ!<Ó=ˆô �.¤$×'Ò'Ü  Ð)9¸1Ó=ˆØ)7¸1Ô)<ÀÒ@VÑ%Ð\oˆ
Ø$Õ0‰à$ˆä—<’< §}¡}°Q¸Ó':Ó;¸gÕE€LØÒØ#Õ1ˆô ˆv�w×Òà—‘×$Ñ$ Q¨¨A¨qÓ1×8Ñ8¸¿¹ÀQ½ÈÈUÏ[É[ÐY[Í_Ð^`ÓaˆÜ—y’y ,Ð!6¸BÔ?ˆà#×&6Ñ&6¸2ÀtÐ&6Ó&L×&SÑ&SÕSˆä—}‘}×,Ñ,¨\¸rÌÏÉÐ,ÓW×ZÑZÐ[`×[fÑ[fÓgˆØ# C¨¨"¨ HÕ-‰ä—}‘}×,Ñ,¨\¸rÌÏÉÐ,ÓW×ZÑZÐ[`×[fÑ[fÓgˆä—,’,˜|Ó3€KØ×'Ñ'¨¨1Ó-×8Ñ8Ó:€KàÐ$Ð$r   )r
   r   Ú$generation.continuous_batching.cacher   r   rL   © r   r   Ú<module>rO      s   ðÛ Ý å Fõ	U÷=%r   