+
    QV-j–  ã                   ó†   € ^ RI t ^RIHt ^RIHt ]! 4       '       d   ^ RIHt ^ RIHt ^RI	H
t
  ! R R]
4      tR	 R
 ltR# )é    N)Úget_module_from_name)Úis_fouroversix_available)ÚModelQuantizationConfig©ÚFourOverSixConfig)ÚConversionOpsc                   ó<   a € ] tR t^t o R tRV 3R lR lltRtV tR# )ÚFourOverSixQuantizec                ó   € Wn         R # )N©Úhf_quantizer)Úselfr   s   &&Úv/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/transformers/integrations/fouroversix.pyÚ__init__ÚFourOverSixQuantize.__init__   s   € Ø(Öó    Nc                óî   <€ V ^8„  d   QhRS[ S[S[P                  3,          RS[P                  P
                  R,          RS[R,          RS[S[,          R,          RS[ S[S[P                  3,          /# )é   Ú
input_dictÚmodelNÚfull_layer_nameÚmissing_keysÚreturn)ÚdictÚstrÚtorchÚTensorÚnnÚModuleÚlist)ÚformatÚ__classdict__s   "€r   Ú__annotate__Ú FourOverSixQuantize.__annotate__   ss   ø€ ÷ &
ñ &
á™™eŸl™lÐ*Õ+ð&
ñ �x‰x�‰ Õ%ð&
ñ ˜t�ð	&
ñ
 ™3•i $Õ&ð&
ñ 
‰c‘5—<‘<ÐÕ	 ñ&
r   c                óü  € V P                   P                  P                  '       d   V# \        W#4      w  rgVP	                  R^4      ^ ,          p\        VP                  4       4      ^ ,          p	V	P                  V R2R^4      p
W,          ^ ,          pVP                  W«4      p\        Wj4      '       d   \        Wj4       V F  pVP                  V4       K  	  V Uu/ uF  pV RV 2WÎ,          bK  	  up# u upi )a2  
We need to store some parameters to create the quantized weight. For example, fouroversix
requires 4 values that are stored in the checkpoint to recover the quantized weight. So we
store them in a dict that is stored in hf_quantizer for now as we can't save it in the op
since we create an op per tensor.
Ú.Ú )r   Úquantization_configÚkeep_master_weightsr   Úrsplitr    ÚkeysÚreplaceÚget_quantized_parametersÚhasattrÚdelattrÚdiscard)r   r   r   r   r   ÚkwargsÚmoduleÚ_Úmodule_nameÚfull_parameter_nameÚparameter_nameÚ	parameterÚquantized_parametersÚkeyÚquantized_keys   &&&&&,         r   ÚconvertÚFourOverSixQuantize.convert   sÿ   € ð ×Ñ×0Ñ0×D×DÐDØÐä(¨Ó@‰	ˆØ%×,Ñ,¨S°!Ó4°QÕ7ˆä" :§?¡?Ó#4Ó5°aÕ8ÐØ,×4Ñ4¸°}ÀAÐ5FÈÈAÓNˆØÕ3°AÕ6ˆ	Ø%×>Ñ>¸~ÓYÐô �6×*Ò*Ü�FÔ+ó ˆCØ× Ñ  Ö%ñ ñ
 "6ó
á!5�ð ˆm˜1˜]˜OÐ,Ð.BÕ.QÒQÙ!5ñ
ð 	
ùò 
s   ÃC9r   )NNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r;   Ú__static_attributes__Ú__classdictcell__)r"   s   @r   r
   r
      s   ø‡ € ò)÷&
÷ &
ð &
r   r
   c                ó$   € V ^8„  d   QhR\         /# )r   Úconfigr   )r!   s   "r   r#   r#   <   s   € ÷ ñ Ô%6ñ r   c                 ób  € \        V P                  V P                  V P                  V P                  V P
                  V P                  V P                  V P                  V P                  V P                  V P                  V P                  V P                  V P                  V P                  R 7      # ))Úactivation_dtypeÚactivation_scale_ruleÚdtypeÚgradient_dtypeÚgradient_scale_ruler)   Úmatmul_backendÚoutput_dtypeÚquantize_backendÚ
scale_ruleÚweight_dtypeÚweight_scale_2dÚweight_scale_ruleÚmodules_to_not_convertÚmodule_config_overrides)r   rF   rG   rH   rI   rJ   r)   rK   rL   rM   rN   rO   rP   rQ   rR   rS   )rD   s   &r   Úadapt_fouroversix_configrT   <   s”   € Ü"Ø×0Ñ0Ø$×:Ñ:Ø�l‰lØ×,Ñ,Ø"×6Ñ6Ø"×6Ñ6Ø×,Ñ,Ø×(Ñ(Ø×0Ñ0Ø×$Ñ$Ø×(Ñ(Ø×.Ñ.Ø ×2Ñ2Ø%×<Ñ<Ø &× >Ñ >ôð r   )r   Úquantizers.quantizers_utilsr   Úutilsr   Úfouroversixr   Ú&transformers.utils.quantization_configr   Úcore_model_loadingr   r
   rT   © r   r   Ú<module>r[      s4   ðÛ å >Ý ,ñ ×ÒÝ3å Då .ô*
˜-ô *
÷Zr   