+
    "Ý³jP  ã                   óX  a € R tF0 t ^ RIHtHtHtHt ^ RIt^ RIHt ^ RI	H
t
Ht ^ RIHtHt ^ RIHt ]P"                  P$                  t]P"                  P&                  t]P"                  P(                  t/ t] ^ k RR R lltR	 tR
 t]! ]P2                  P4                  ]P6                  P4                  ]P8                  P4                  ]P:                  P<                  ]P>                  P@                  ]PB                  P4                  .4      R R l4       t"]! ]PF                  P4                  .4      R R l4       t$]! ]PJ                  P4                  ]PL                  PN                  .4      R R l4       t(]! ]PR                  P4                  .4      R R l4       t*]! ]PV                  P<                  .4      R R l4       t,]! ]PZ                  P4                  .4      R R l4       t.]! ]P^                  P`                  .4      R R l4       t1R R lt2]! ]Pf                  P4                  ]Ph                  P4                  .4      R R l4       t5]! ]Pl                  P4                  .4      R R l4       t7]! ]Pp                  P4                  .4      R R l4       t9]! ]Pt                  P4                  .4      R R l4       t;]! ]Px                  P4                  ]Px                  P4                  .4      R R l4       t=]! ]P|                  P4                  ]P|                  P4                  .4      R R l4       t?]! R4      '       d&   ]! ]P€                  P4                  .4      R R l4       tA]! ]P„                  P4                  .4      R R l4       tC]! ]Pˆ                  P4                  .4      R R l4       tER# )!é    )ÚAnyÚDictÚOptionalÚTupleN)Útree_map)ÚFloat8TrainingTensorÚchoose_scaled_mm_config)Úis_row_majorÚpad_tensor_for_matmul)Útorch_version_at_leastc                óP  € V ^8„  d   QhR\         P                  R\         P                  R\         P                  R\         P                  R\         P                  R\        \         P                  ,          R\        \         P                  ,          R\        R	\         P                  /	# )
é   Úa_dataÚa_scaleÚb_dataÚb_scaleÚoutput_dtypeÚoutput_scaleÚbiasÚuse_fast_accumÚreturn)ÚtorchÚTensorÚdtyper   Úbool)Úformats   "ÚZ/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchao/float8/float8_ops.pyÚ__annotate__r      sŒ   € ÷ ?ñ ?Ü�L‰Lð?ä�\‰\ð?ô �L‰Lð?ô �\‰\ð	?ô
 —+‘+ð?ô œ5Ÿ<™<Õ(ð?ô ”5—<‘<Õ
 ð?ô ð?ô ‡\�\ñ?ó    c                óò  € VP                  4       pVP                  4       p	Rp
VP                  V P                  ^ ,          ^38H  ;'       d#    VP                  ^VP                  ^,          38H  pV'       d3   V'       g+   W‰,          p
VP                  R4      pVP                  R4      p	TpV\        P                  \        P
                  39   d   V'       d   \        P                  pRpV\        P
                  8X  d   TpRp\        P                  ! V VVV	VVVVR7      pV
e	   Wê,          pVe	   Wí,          pV\        P                  \        P
                  39   d   V'       d   VP                  V4      pV# )zÓ
This is the unwrapped version of addmm_float8, which does not take in Float8TrainingTensors
as inputs. This is used to standardize the logic between subclassed and non subclassed
versions of the linear module.
N)Úscale_aÚscale_br   Úscale_resultÚ	out_dtyper   © )	Ú
reciprocalÚshapeÚnew_onesr   Úfloat16Úfloat32Úbfloat16Ú
_scaled_mmÚto)r   r   r   r   r   r   r   r   Úa_inverse_scaleÚb_inverse_scaleÚpost_inverse_scaleÚis_rowwise_scalingÚ
orig_dtypeÚ	post_biasÚoutputs   &&&&&&&&       r   Úaddmm_float8_unwrappedr5      sR  € ð ×(Ñ(Ó*€OØ×(Ñ(Ó*€OàÐØ Ÿ™¨6¯<©<¸­?¸AÐ*>Ñ>÷ ð À7Ç=Á=Ø	Ø�‰�Q�ðUñ DÐ÷
 §.ð -Õ>ÐØ)×2Ñ2°2Ó6ˆØ)×2Ñ2°2Ó6ˆð €JØ”e—m‘m¤U§]¡]Ð3Ô3×8JÜ—~‘~ˆà€IØ”u—}‘}Ô$àˆ	Øˆä×ÒØØØØØØ!ØØ%ô	€Fð Ò%ØÕ$ˆØÒØÕˆà”e—m‘m¤U§]¡]Ð3Ô3×8JØ—‘˜:Ó&ˆà€Mr   c                 óN   € \        VP                  4      R9   g   Q V  R24       hR# )r   z+ with axiswise scaling is not supported yetN)r   é   )Úlenr'   )Úaten_opÚscales   &&r   Ú_assert_tensorwise_scaler;   _   s1   € ô 	ˆE�K‰KÓ˜FÔ"ð?ð ˆÐ=Ð>ó	?ò 	#r   c                ó   a € V 3R lpV# )z(Register aten ops to the float8 op tablec                 óŽ   <€ S F=  pV\         9   d'   \        R V R\         V,          P                   24      hV \         V&   K?  	  V # )z
Float8 op z is already registered to )ÚFLOAT8_OPS_TABLEÚRuntimeErrorÚ__name__)ÚfuncÚopÚaten_opss   & €r   Ú	decoratorÚimplements.<locals>.decoratorj   sV   ø€ ÛˆBØÔ%Ô%Ü"Ø   Ð$>Ô?OÐPRÕ?S×?\Ñ?\Ð>]Ð^óð ð $(Ô˜RÓ ñ ð ˆr   r%   )rC   rD   s   f r   Ú
implementsrF   g   s   ø€ õð Ðr   c                 ó(  € \        W^ ,          P                  4       V ! V^ ,          P                  .VR,          O5/ VB p\        VV^ ,          P                  V^ ,          P                  V^ ,          P
                  V^ ,          P                  4      # ©r   ºr7   NN)r;   Ú_scaleÚ_datar   Ú_orig_dtypeÚ_linear_mm_configÚ_gemm_input_role)r9   ÚargsÚkwargsÚnew_datas   &&& r   Úfloat8_desugar_oprR   v   sv   € ô ˜W¨1¥g§n¡nÔ5Ù�t˜A•w—}‘}Ð: t¨B¥xÒ:°6Ñ:€HÜØØˆQ��‰ØˆQ�×ÑØˆQ�×!Ñ!ØˆQ�× Ñ óð r   c                 ó  € V ! V^ ,          P                   .VR,          O5/ VB pV ! V^ ,          P                  .VR,          O5/ VB p\        VVV^ ,          P                  V^ ,          P                  V^ ,          P
                  4      # rH   )rK   rJ   r   rL   rM   rN   )r9   rO   rP   rQ   Ú	new_scales   &&&  r   Ú float8_desugar_data_and_scale_oprU   Œ   s~   € ñ �t˜A•w—}‘}Ð: t¨B¥xÒ:°6Ñ:€HÙ˜˜Q�Ÿ™Ð<¨¨b­Ò<°VÑ<€IÜØØØˆQ�×ÑØˆQ�×!Ñ!ØˆQ�× Ñ óð r   c                 óD  € V ! V^ ,          P                   .VR,          O5/ VB pV^ ,          P                  P                  ^8”  d&   V ! V^ ,          P                  .VR,          O5/ VB pMV^ ,          P                  pV \        P                  P
                  8X  d   \        W^ ,          P                  4       V^ ,          P                  pTpVe   V^ 8X  d   RpM^ p\        VVV^ ,          P                  V^ ,          P                  V^ ,          P                  V4      # )r   rI   éÿÿÿÿ)rK   rJ   ÚndimÚatenÚ	transposeÚintr;   Ú_axiswise_dimr   rL   rM   rN   )r9   rO   rP   rQ   rT   Úold_axiswise_dimÚnew_axiswise_dims   &&&    r   Úfloat8_transposer_   �   sö   € ñ �t˜A•w—}‘}Ð: t¨B¥xÒ:°6Ñ:€HØˆA…w‡~�~×Ñ˜QÔÙ˜D �GŸN™NÐ@¨T°"­XÒ@¸Ñ@‰	à˜•G—N‘Nˆ	à”$—.‘.×$Ñ$Ô$Ü  ¨q­'¯.©.Ô9à˜A•w×,Ñ,ÐØ'ÐØÒ#Ø˜qÔ Ø!Ñà ÐäØØØˆQ�×ÑØˆQ�×!Ñ!ØˆQ�× Ñ Øóð r   c                 ó¢  € V^ ,          V^,          rCV\        VP                  P                  4      8X  dŠ   V ! V^ ,          P                  .VR,          O5/ VB p\        VV^ ,          P                  V^ ,          P
                  V^ ,          P                  V^ ,          P                  V^ ,          P                  4      # \        V^ ,          P                  P                  4      ^8  d   \        WV4      # VP                  p\        V4      ^8X  dþ   V^ 8X  dl   V ! VP                  V3/ VB p^VR,          .pV ! VP                  V3/ VB p\        VVVP
                  VP                  VP                  VP                  4      # VR8X  g"   V\        VP                  4      ^,
          8X  dd   V ! VP                  V3/ VB pV^ ,          ^.pV ! VP                  V3/ VB pRp	\        VVVP
                  VP                  VP                  V	4      # \        V  RVP                   RVP                  P                   RVP                   RV R2
4      h)r   rI   z# with axiswise scaling and t.shape z t._scale.shape z t._axiswise_dim z new_shape z is not supported yet.rW   )ÚlistrK   r'   r   rJ   rL   rM   rN   r\   r8   rR   ÚAssertionError)
r9   rO   rP   ÚtÚ	new_shaperQ   Úaxiswise_dimÚnew_scale_shaperT   r^   s
   &&&       r   Úfloat8_viewrg   ¿   sG  € à˜•7˜D �G€yð ”D˜Ÿ™Ÿ™Ó'Ô'Ù˜4 �7Ÿ=™=Ð>¨4°­8Ò>°vÑ>ˆÜ#ØØ��G�N‰NØ��G×ÑØ��G×%Ñ%Ø��G×$Ñ$Ø��G×!Ñ!ó
ð 	
ô ˆ4��7�>‰>×ÑÓ  1Ô$ä  °Ó7Ð7ð —?‘?€LÜ
ˆ9ƒ~˜ÔØ˜1ÔÙ˜qŸw™w¨	Ñ<°VÑ<ˆHØ  )¨B¥-Ð0ˆOÙ §¡¨/ÑD¸VÑDˆIÜ'ØØØ—‘Ø×#Ñ#Ø×"Ñ"Ø—‘óð ð ˜RÔ <´C¸¿¹³LÀ1Õ4DÔ#EÙ˜qŸw™w¨	Ñ<°VÑ<ˆHØ(¨�|¨QÐ/ˆOÙ §¡¨/ÑD¸VÑDˆIØ!ÐÜ'ØØØ—‘Ø×#Ñ#Ø×"Ñ"Ø óð ô Øˆ)Ð6°q·w±w°iÐ?OÐPQ×PXÑPX×P^ÑP^ÐO_Ð_pÐqr÷  rAñ  rAð  qBð  BMð  NWð  MXð  Xnð  	oóð r   c                 ó¾   a€ V ! S^ ,          P                   .SR,          O5/ VB p\        V S^ ,          P                  4       V3R lp\        WC4      p\	        V4      # )r   rI   c                 óª   <€ \        V S^ ,          P                  S^ ,          P                  S^ ,          P                  S^ ,          P                  4      # ©r   )r   rJ   rL   rM   rN   )ÚdatarO   s   &€r   Úmake_float8Ú!float8_split.<locals>.make_float8û   sE   ø€ Ü#ØØ��G�N‰NØ��G×ÑØ��G×%Ñ%Ø��G×$Ñ$ó
ð 	
r   )rK   r;   rJ   Úmapra   )r9   rO   rP   Únew_data_tensorsrl   Úouts   &f&   r   Úfloat8_splitrq   ö   sQ   ø€ á˜t A�wŸ}™}ÐB¨t°B­xÒB¸6ÑBÐÜ˜W d¨1¥g§n¡nÔ5õ
ô ˆkÓ
,€CÜ�‹9Ðr   c                 ó0  € V^ ,          pV^ ,          P                   pV^ ,          P                  pV^ ,          P                  pV^ ,          P                  P                  pV^ ,          P
                  p. p	V Fì  p
\        V
\        4      '       g   Q R4       hV
P                   V8X  g   Q R4       hV
P                  VJ g   Q R4       hV
P                  VJ g   Q R4       hV
P                  P                  V8X  g   Q R4       hV
P
                  VJ g   Q R4       h\        W
P                  4       V	P                  V
P                  P                  \        P                  4      4       Kî  	  V ! V	.VR,          O5/ VB pVP                  V4      p\        WµWFV4      # )r   z7Expecting all chunks to be of type Float8TrainingTensorz,Expecting all chunks to be of the same dtypezCExpecting all chunks to have thee same scale as a result of a splitzGExpecting all chunks to have thee same mm config as a result of a splitzCExpecting all chunks to be of the same dtype as a result of a splitzLExpecting all chunks to have the same gemm_input_role as a result of a splitrI   )rL   rJ   rM   rK   r   rN   Ú
isinstancer   r;   ÚappendÚviewr   Úuint8)r9   rO   rP   Úchunked_tensorsr2   r:   Ú	mm_configÚ	fp8_dtypeÚgemm_input_roleÚ
chunk_dataÚchunkrQ   s   &&&         r   Ú
float8_catr}   	  s–  € à37¸µ7€Oà  Õ#×/Ñ/€JØ˜AÕ×%Ñ%€EØ Õ"×4Ñ4€IØ Õ"×(Ñ(×.Ñ.€IØ% aÕ(×9Ñ9€OØ€JÛ ˆÜ˜%Ô!5×6Ò6ð 	
ØEó	
Ð6ð × Ñ  JÔ.ð 	
Ø:ó	
Ð.ð �|‰|˜uÓ$ð 	
ØQó	
Ð$ð ×&Ñ&¨)Ó3ð 	
ØUó	
Ð3ð �{‰{× Ñ  IÔ-ð 	
ØQó	
Ð-ð ×%Ñ%¨Ó8ð 	
ØZó	
Ð8ô 	! ¯,©,Ô7Ø×Ñ˜%Ÿ+™+×*Ñ*¬5¯;©;Ó7Ö8ñ) !ñ, �zÐ7 D¨¥HÒ7°Ñ7€HØ�}‰}˜YÓ'€HÜ °ÈÓXÐXr   c                ó|   € \        W^ ,          P                  4       R p\        W14      p\        W24      pV ! V/ VB # )a  Be careful with this function, this is a "fallback" op that
casts the output of the op to the original precision. And performs the op.

We currently need this to support the backward for admmm bias.
"addmm" -> out
"hp_gradBias" <-"sum" <- "identity" <- gradOut <- "hp_gradOut"
c                 óR   € \        V \        4      '       d   V P                  4       # V # ©N)rs   r   Úto_original_precision)Úxs   &r   ÚunwrapÚ!float8_cast_up_op.<locals>.unwrap9  s$   € Ü�aÔ-×.Ò.Ø×*Ñ*Ó,Ð,Øˆr   )r;   rJ   r   )r9   rO   rP   rƒ   Únew_argsÚ
new_kwargss   &&&   r   Úfloat8_cast_up_opr‡   .  s?   € ô ˜W¨1¥g§n¡nÔ5òô
 ˜Ó%€HÜ˜&Ó)€JÙ�HÐ+ 
Ñ+Ð+r   c                ó0   € V ^8„  d   QhR\         R\         /# )r   ÚaÚb)r   )r   s   "r   r   r   C  s   € ÷ &,ñ &,Ô,ð &,Ô1Eñ &,r   c                 óL  € V P                   pV P                  pVP                   p\        V P                  V P                  VP                  VP                  4      pVP
                  '       d“   V P                   P                  ^4      VP                   P                  ^ 4      8X  g@   Q RV P                   P                  ^4       RVP                   P                  ^ 4       24       h\        V^R7      p\        V^ R7      p\        VP                  4       4      '       g   VP                  4       p\        VP                  4       4      '       d-   VP                  4       P                  4       P                  4       pVP                  pV P                  fB   VP                  e4   VP                  VP                  ^ ,          4      P                  R^4      pMNV P                  eA   VP                  f3   VP                  VP                  ^,          4      P                  ^R4      pW#WF3# )r7   z"Inner dims must match for mm, got z and )ÚdimsrW   )rK   rJ   r	   rN   rM   Úpad_inner_dimÚsizer   r
   ÚstrideÚ
contiguousrc   r\   Úrepeatr'   Úreshape)r‰   rŠ   r   r   r   Úscaled_mm_configr   s   &&     r   Úpreprocess_addmmr”   C  s›  € Ø�W‰W€FØ�h‰h€GØ�W‰W€Fä.Ø	×ÑØ	×ÑØ	×ÑØ	×Ñó	Ðð ×%×%Ð%Ø�w‰w�|‰|˜A‹ !§'¡'§,¡,¨q£/Ô1ð 	
Ø0°·±·±¸a³Ð0AÀÀqÇwÁwÇ|Á|ÐTUÃÐFWÐXó	
Ð1ô ' v°AÔ6ˆÜ& v°AÔ6ˆä˜Ÿ™›×(Ò(Ø×"Ñ"Ó$ˆÜ�F—M‘M“O×$Ò$Ø—‘“×&Ñ&Ó(×*Ñ*Ó,ˆØ�h‰h€Gð 	‡�Ò 1§?¡?Ò#>Ø—.‘. §¡¨a¥Ó1×9Ñ9¸"¸aÓ@‰Ø	
�‰Ò	$¨¯©Ò)@Ø—.‘. §¡¨a¥Ó1×9Ñ9¸!¸RÓ@ˆà˜FÐ+Ð+r   c                 óÂ  € V^ ,          pV^,          p\        V\        4      '       d   \        V\        4      '       g*   Q RP                  \        V4      \        V4      4      4       h\	        W44      w  rVrxVP
                  p	\        VP                  VP                  VP                  VP                  4      p
V
P                  '       dy   \        P                  ! VP                  P                  4       VP                  ,          VP                  P                  4       VP                  ,          4      P                  V	4      # \!        VVVVV	RRV
P"                  R7      pV# )r   zFExpecting  both Float8TrainingTensor for mm inputs but found {} and {}N©r   r   r   )rs   r   r   Útyper”   rL   r	   rN   rM   Úemulater   ÚmmrK   ÚfloatrJ   r-   r5   r   )r9   rO   rP   r‰   rŠ   r   r   r   r   r   r“   Ú
tensor_outs   &&&         r   Ú	float8_mmrœ   l  s.  € àˆQ�€AØˆQ�€Aä�aÔ-×.Ò.´:Ø	Ô÷4ò 4ð àO×VÑVÜˆQ‹”�a“óóð ô
 (8¸Ó'=Ñ$€F�VØ—=‘=€LÜ.Ø	×ÑØ	×ÑØ	×ÑØ	×Ñó	Ðð ××ÐÜ�xŠx˜Ÿ™Ÿ™›¨!¯(©(Õ2°A·G±G·M±M³OÀaÇhÁhÕ4NÓO×RÑRØó
ð 	
ô (ØØØØØØØØ'×6Ñ6ô	€Jð Ðr   c                 ó0  € \        V^ ,          \        P                  4      '       d;   \        V^,          \        4      '       d   \        V^,          \        4      '       g   Q hV^ ,          pV^,          pV^,          p\	        WE4      w  rgr‰VP
                  p
VP                  V
8X  g   Q R4       h\        VP                  VP                  VP                  VP                  4      pVP                  '       d�   \        P                  ! VP                  P                  4       VP                  ,          VP                  P                  4       VP                  ,          4      P                  V
4      pWÃ,           # \!        VVVV	V
RVVP"                  R7      pV# )r   z"bias dtype must match output dtypeNr–   )rs   r   r   r   r”   rL   r   r	   rN   rM   r˜   r™   rK   rš   rJ   r-   r5   r   )r9   rO   rP   r   r‰   rŠ   r   r   r   r   r   r“   rp   r›   s   &&&           r   Úfloat8_addmmrž   �  sO  € ô 	�4˜•7œEŸL™L×)Ò)Ü�t˜A•wÔ 4×5Ò5Ü�t˜A•wÔ 4×5Ò5ðð	6ð ��7€DØˆQ�€AØˆQ�€AÜ'7¸Ó'=Ñ$€F�VØ—=‘=€LØ�:‰:˜Ô%ÐKÐ'KÓKÐ%Ü.Ø	×ÑØ	×ÑØ	×ÑØ	×Ñó	Ðð ××ÐÜ�hŠh�q—w‘w—}‘}“¨¯©Õ1°1·7±7·=±=³?ÀQÇXÁXÕ3MÓN×QÑQØó
ˆð �zÐÜ'ØØØØØØØØ'×6Ñ6ô	€Jð Ðr   c                 óˆ   € \        W^ ,          P                  4       V^ ,          P                  V^,          P                  8H  # rj   )r;   rJ   r'   ©r9   rO   rP   s   &&&r   Úfloat8_is_same_sizer¡   ´  s-   € ä˜W¨1¥g§n¡nÔ5Ø��7�=‰=˜D �GŸM™MÑ)Ð)r   c           	     óº  € \        V^ ,          \        4      '       g   Q h\        V4      ^8X  d   RV9   g   Q R4       hVR,          \        P                  \        P
                  09   g   Q R4       h\        V^ ,          P                  V^ ,          P                  VR,          V^ ,          P                  V^ ,          P                  V^ ,          P                  4      # )z{This gets called when running matmul under autocast
when the input is a Float8TrainingTensor, presenting as a fp32
tensor.
r   z%Only support dtype kwarg for autocastzKOnly support floating point conversion for autocast w/ Float8TrainingTensor)rs   r   r8   r   r)   r+   rK   rJ   rM   rN   r\   r    s   &&&r   Úautocast_to_copyr£   º  sÊ   € ô �d˜1•gÔ3×4Ò4Ð4Ð4Üˆv‹;˜!Ô ¨6Ô 1ð Ø/óÐ1ð �'�?Ü�‰Ü�‰ðô ð Uð UóUð ô  ØˆQ��‰ØˆQ��‰Øˆw�ØˆQ�×!Ñ!ØˆQ�× Ñ ØˆQ�×Ñóð r   c                ój  € \        W^ ,          P                  4       V^ ,          p\        V\        4      '       g   Q R\	        V4       24       hVP
                  pVP                  4       pV ! V.VR,          O5/ VB p\        VVP                  VP                  VP                  VP                  4      # )z#
override funcol with FP8 handling
z9expecting a Float8TrainingTensor for allgather but found rI   )
r;   rJ   rs   r   r—   rK   r�   rL   rM   rN   ©r9   rO   rP   Ú	fp8_inputÚfp8_dataÚfp8_outs   &&&   r   Úallgather_fp8r©   Ò  s¬   € ô ˜W¨1¥g§n¡nÔ5Ø�Q•€IÜ�iÔ!5×6Ò6ð Ø
CÄDÈÃOÐCTÐUóÐ6ð �‰€HØ×"Ñ"Ó$€HÙ�hÐ4  b¥Ò4¨VÑ4€GÜØØ×ÑØ×ÑØ×#Ñ#Ø×"Ñ"óð r   c                 ó(  € \        W^ ,          P                  4       V^ ,          p\        V\        4      '       g   Q hVP                  pV ! V.VR,          O5/ VB p\        VVP                  VP
                  VP                  VP                  4      # rH   ©r;   rJ   rs   r   rK   rL   rM   rN   r¥   s   &&&   r   Úwait_tensor_fp8r¬   î  s„   € ä˜W¨1¥g§n¡nÔ5Ø�Q•€IÜ�iÔ!5×6Ò6Ð6Ð6à�‰€HÙ�hÐ4  b¥Ò4¨VÑ4€GÜØØ×ÑØ×ÑØ×#Ñ#Ø×"Ñ"óð r   z
2.11.0.devc                ó(  € \        W^ ,          P                  4       V^ ,          p\        V\        4      '       g   Q hVP                  pV ! V.VR,          O5/ VB p\        VVP                  VP
                  VP                  VP                  4      # )zÃ
Handle _wrap_tensor_autograd for Float8TrainingTensor.
This wraps the underlying fp8 data in AsyncCollectiveTensor while
preserving the Float8TrainingTensor wrapper with its scale and metadata.
rI   r«   r¥   s   &&&   r   Úwrap_tensor_autograd_fp8r®     s†   € ô 	! ¨q­'¯.©.Ô9Ø˜•Gˆ	Ü˜)Ô%9×:Ò:Ð:Ð:à—?‘?ˆÙ˜(Ð8 T¨"¥XÒ8°Ñ8ˆÜ#ØØ×ÑØ×!Ñ!Ø×'Ñ'Ø×&Ñ&ó
ð 	
r   c                 ó@  € V^ ,          pV^,          p\        V\        4      '       g   Q h\        V\        4      '       g   Q h\        W1^ ,          P                  4       VP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP
                  VP
                  8X  g   Q hVP                  pVP                  pV ! WQ^,          V.VR,          O5/ VB p\        VVP                  VP
                  VP                  VP                  4      # )r   :é   NN)	rs   r   r;   rJ   r   rL   rK   rM   rN   )r9   rO   rP   Úfp8_selfÚ
fp8_valuesr§   Úfp8_values_datar¨   s   &&&     r   Úindex_put_fp8r´     sú   € à�A�w€HØ�a•€JÜ�hÔ 4×5Ò5Ð5Ð5Ü�jÔ"6×7Ò7Ð7Ð7Ü˜X¨A¥w§~¡~Ô6Ø�?‰?˜j×/Ñ/Ô/Ð/Ð/Ø�>‰>˜Z×-Ñ-Ô-Ð-Ð-Ø×Ñ :×#9Ñ#9Ô9Ð9Ð9à�~‰~€HØ ×&Ñ&€OÙ�h Q¥¨ÐN¸4À½8ÒNÀvÑN€GÜØØ�‰Ø×ÑØ×"Ñ"Ø×!Ñ!óð r   c                 óÄ  € V^ ,          pV^,          p\        V\        4      '       gO   \        V\        4      '       d9   VP                  4       p\        WP                  4       V ! W5.VR,          O5/ VB # \        V\        4      '       EdJ   \        V\        4      '       Ed3   \        WP                  4       VP
                  VP
                  8X  g   Q R4       hVP                  VP                  8X  g   Q R4       hVP                  VP                  8X  g   Q R4       hVP                  P                  VP                  P                  8X  g   Q R4       hVP                  VP                  8X  g   Q R4       hV ! VP                  VP                  .VR,          O5/ VB p\        VVP                  VP
                  VP                  VP                  4      # \        R4      h)r   :r   NNz<Expecting both Float8TrainingTensors to be of the same dtypez<Expecting both Float8TrainingTensors to have thee same scalez@Expecting both Float8TrainingTensors to have thee same mm configz=Expecting both Float8TrainingTensors to be of the same dtypetzEExpecting both Float8TrainingTensors to have the same gemm_input_rolez7Unsupported semantics for copy_ in Float8TrainingTensor)rs   r   r�   r;   rJ   rL   rM   rK   r   rN   r?   )r9   rO   rP   ÚselfÚsrcÚsrc_hpr¨   s   &&&    r   Úcopy_fp8r¹   /  s¹  € ð ��7€DØ
ˆq�'€Cä�dÔ0×1Ò1´jØÔ!÷7ò 7ð ×*Ñ*Ó,ˆÜ  ¯*©*Ô5Ù�tÐ9 d¨2¥hÒ9°&Ñ9Ð9Ü	�DÔ.×	/Ó	/´JØÔ!÷5ó 5ô 	! ¯*©*Ô5Ø×Ñ 3§?¡?Ô2ð 	
ØJó	
Ð2ð �{‰{˜cŸj™jÔ(ð 	
ØJó	
Ð(ð ×%Ñ%¨×)>Ñ)>Ô>ð 	
ØNó	
Ð>ð �z‰z×Ñ 3§9¡9§?¡?Ô2ð 	
ØKó	
Ð2ð ×$Ñ$¨×(<Ñ(<Ô<ð 	
ØSó	
Ð<ñ ˜$Ÿ*™* c§i¡iÐE°$°rµ(ÒE¸fÑEˆÜ#ØØ�K‰KØ×ÑØ×"Ñ"Ø×!Ñ!ó
ð 	
ô ÐTÓUÐUr   c                ób   € V ^8„  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   # )r   r>   )Ú__conditional_annotations__r   r   )r   s   "r   r   r      s"   € × -Ñ -÷ &Ò %”$”sœC�x•.Ñ %ò .r   )NNFr€   )Gr»   Útypingr   r   r   r   r   Útorch.utils._pytreer   Ú%torchao.float8.float8_training_tensorr   r	   Útorchao.float8.float8_utilsr
   r   Útorchao.utilsr   ÚopsrY   Úc10d_functionalÚ_c10d_functionalr>   r5   r;   rF   Ú_unsafe_viewÚdefaultÚ
as_stridedÚcloneÚslicer   Úfill_ÚScalarr’   rR   ÚdetachrU   rc   rZ   r[   r_   ru   rg   Úsplitrq   Úcatr}   ÚsumÚdim_IntListr‡   r”   r™   Úmatmulrœ   Úaddmmrž   Úis_same_sizer¡   Ú_to_copyr£   Úall_gather_into_tensorr©   Úwait_tensorr¬   Ú_wrap_tensor_autogradr®   Ú
index_put_r´   Úcopy_r¹   r   )r»   s   @r   Ú<module>rÙ      sx  øð÷ .× -Ð -ã Ý (÷÷ LÝ 0à‡y�y‡~�~€Ø—)‘)×+Ñ+€Ø—9‘9×-Ñ-Ð Ø#%Ð Ó %÷?òD?òñ à×Ñ×!Ñ!Ø�‰×ÑØ�
‰
×ÑØ�
‰
×ÑØ�
‰
×ÑØ�‰×Ñðó	ó	ó	ð	ñ à�‰×Ñðóó
	óð
	ñ à�‰�‰Ø�‰×Ñðóóóðñ8 ˆT�Y‰Y×ÑÐÓ ó3ó !ð3ñl ˆT�Z‰Z×ÑÐÓ óó !ðñ$ ˆT�X‰X×ÑÐÓó!Yó  ð!YñH ˆT�X‰X×!Ñ!Ð"Ó#ó,ó $ð,õ(&,ñR ˆT�W‰W�_‰_˜dŸk™k×1Ñ1Ð2Ó3óó 4ðñD ˆT�Z‰Z×ÑÐ Ó!ó!ó "ð!ñH ˆT×Ñ×&Ñ&Ð'Ó(ó*ó )ð*ñ
 ˆT�]‰]×"Ñ"Ð#Ó$óó %ðñ. à×.Ñ.×6Ñ6Ø×/Ñ/×7Ñ7ðóóóðñ, ˆ_×(Ñ(×0Ñ0Ð2B×2NÑ2N×2VÑ2VÐWÓXóó Yðñ" ˜,×'Ò'áÐ!×7Ñ7×?Ñ?Ð@ÓAó
ó Bð
ñ* ˆT�_‰_×$Ñ$Ð%Ó&óó 'ðñ, ˆT�Z‰Z×ÑÐ Ó!ó-Vó "ò-Vr   