+
    "Ý³j*+  ã                   óÎ   € ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RI	t	. ROt
^t ! R R] P                  4      t ! R R]P                  4      tR R lt0 RmtR	 R
 ltR# )é    N)ÚAnyÚDictÚAOBaseConfigc                   ó6   a € ] tR t^t o Rt ]tV 3R ltRtV t	R# )r   a¶  
If a workflow config inherits from this then `quantize_` knows
how to a apply it to a model. For example::

    # user facing code
    class WorkflowFooConfig(AOBaseConfig): ...
        # configuration for workflow `Foo` is defined here
        bar = 'baz'

    # non user facing code
    @register_quantize_module_handler(WorkflowFooConfig)
    def _transform(
        mod: torch.nn.Module,
        config: WorkflowFooConfig,
    ) -> torch.nn.Module:
        # the transform is implemented here, usually a tensor sublass
        # weight swap or a module swap
        ...

    # then, the user calls `quantize_` with a config, and `_transform` is called
    # under the hood by `quantize_.

c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )é   Úversion)Úint)ÚformatÚ__classdict__s   "€ÚT/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchao/core/config.pyÚ__annotate__ÚAOBaseConfig.__annotate__   s   ø‡ ‚ ñP Ñ#òQ ó    © N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú_DEFAULT_VERSIONr	   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s   ø‡ € ñð0ð $€G÷Q ƒ r   c                   ó<   a a€ ] tR t^Ft oRtV 3R ltR tRtVtV ;t	# )ÚConfigJSONEncoderz,Custom JSON encoder for AOBaseConfig objectsc                ór  <€ \        V\        4      '       d†   / pVP                  P                  4        F:  w  r4VP	                  R 4      '       d   K  VR8w  g   K'  V P                  V4      W#&   K<  	  RVP                  P                  R\        VR\        4      RV/# \        VR4      '       d€   \        VR4      '       dn   VP                  4       pVP                  4        UUu/ uF  w  r4W0P                  V4      bK  	  pppRVP                  P                  R\        VR\        4      RV/# \        P                  ! V4      '       d¤   \        V\        4      '       gŽ   / p\        P                  ! V4       FF  pVP                   R8w  g   K  V P                  \        WP                   4      4      W'P                   &   KH  	  RVP                  P                  R\        VR\        4      RV/# \        VR4      '       dM   VP"                  R8X  d<   \        V\        4      '       d&   RR	R\%        V4      P'                  R
4      R,          /# \        VR4      '       dŠ   RVP                  P                  9   do   RVP                  P                  RVP                  P                  4        UUu/ uF/  w  r4VP	                  R 4      '       d   K  W0P                  V4      bK1  	  upp/# \        V\(        P*                  4      '       d&   RVP                  P                   RVP                   /# \        V\,        P.                  4      '       d&   RR	R\%        V4      P'                  R
4      R,          /# \        V\0        4      '       d!   V Uu. uF  q€P                  V4      NK  	  up# \        V\2        4      '       d   \5        RV 24      h\        V\6        4      '       d4   VP                  4        UUu/ uF  w  r4W0P                  V4      bK  	  upp# \8        S	V `u  V4      # u uppi u uppi u upi u uppi )Ú_r	   Ú_typeÚ_versionÚ_dataÚ_fieldsÚ_asdictr   Útorchútorch.dtypeÚ.Ú	__class__ÚLayoutúiTuples will be serialized as List in JSON, so we recommend to use Lists instead to avoid surprises. got: éÿÿÿÿ)Ú
isinstancer   Ú__dict__ÚitemsÚ
startswithÚencode_valuer'   r   Úgetattrr   Úhasattrr#   ÚdataclassesÚis_dataclassÚtypeÚfieldsÚnamer   ÚstrÚsplitÚenumÚEnumr$   ÚdtypeÚlistÚtupleÚNotImplementedErrorÚdictÚsuperÚdefault)
ÚselfÚoÚ	data_dictÚkÚvÚasdict_dataÚprocessed_dataÚfÚitemr'   s
   &&       €r   rA   ÚConfigJSONEncoder.defaultI   sŠ  ø€ ä�aœ×&Ò&ØˆIàŸ
™
×(Ñ(Ö*‘�Ø—|‘| C×(Ô(¨Q°)®^à#'×#4Ñ#4°QÓ#7�I“Lñ +ð ˜Ÿ™×-Ñ-ØœG A yÔ2BÓCØ˜ð	ð ô �1�i× Ò ¤WØˆy÷&
ò &
ð Ÿ)™)›+ˆKàBM×BSÑBSÔBUÔVÑBU¹$¸!˜a×!2Ñ!2°1Ó!5Ò5ÑBUˆNÑVð ˜Ÿ™×-Ñ-ØœG A yÔ2BÓCØ˜ðð ô ×#Ò# A×&Ò&¬z¸!¼T×/BÒ/BØˆIä ×'Ò'¨Ö*�Ø—6‘6˜YÖ&Ø(,×(9Ñ(9¼'À!ÇVÁVÓ:LÓ(M�IŸf™fÓ%ñ +ð ˜Ÿ™×-Ñ-ØœG A yÔ2BÓCØ˜ð	ð ô �1�l×#Ò#¨¯©¸Ô(?ÄJÈqÔRV×DWÒDWØ˜]¨G´S¸³V·\±\À#Ó5FÀrÕ5JÐKÐKô �1�k×"Ò" x°1·;±;×3GÑ3GÔ'Gà˜Ÿ™×-Ñ-Øà !§
¡
× 0Ñ 0Ô 2ôá 2™˜ØŸ<™<¨×,ô ,�A×(Ñ(¨Ó+Ò+Ù 2òðð ô �aœŸ™×#Ò#à §¡× 4Ñ 4Ð5¸ÀÇÁÐHÐHä�aœŸ™×%Ò%Ø˜]¨G´S¸³V·\±\À#Ó5FÀrÕ5JÐKÐKô �aœ×ÒÙ89Ó:¹°×%Ñ% dÖ+¹Ñ:Ð:ä˜œ5×!Ò!Ü%ð:Ø:;¸ð>óð ô
 �aœ×ÒØ89¿¹¼	ÔB¹	±°�A×(Ñ(¨Ó+Ò+¹	ÒBÐBô ‰w‰˜qÓ!Ð!ùóy Wùó>ùò" ;ùó Cs   Ã$P"Ê,P(ËP(Î
P.Ï3P3c                óN   €  V P                  V4      pV#   \         d     T# i ; i)z+Helper method to recursively encode a value)rA   Ú	TypeError)rB   ÚvalueÚresults   && r   r/   ÚConfigJSONEncoder.encode_valuež   s5   € ð	ð —\‘\ %Ó(ˆFØˆMøÜô 	Øð ˆð	ús   ‚ •$£$r   )
r   r   r   r   r   rA   r/   r   r   Ú__classcell__)r'   r   s   @@r   r   r   F   s   ù‡ € Ù6õS"÷jò r   r   c                óR   € V ^8„  d   QhR\         R\        \        \        3,          /# )r   ÚconfigÚreturn)r   r   r7   r   )r   s   "r   r   r   ®   s&   € ÷ Añ Aœ<ð A¬D´´c°­Nñ Ar   c                ó¼   € \        V \        4      '       g   \        R\        V 4       24      h\        P
                  ! \        P                  ! V \        R7      4      # )z¶
Convert an AOBaseConfig instance to a dictionary suitable for serialization.

Args:
    config: An instance of AOBaseConfig subclass

Returns:
    Dict representation of the config
z$Expected AOBaseConfig instance, got )Úcls)r+   r   rM   r4   ÚjsonÚloadsÚdumpsr   )rS   s   &r   Úconfig_to_dictrZ   ®   sE   € ô �fœl×+Ò+ÜÐ>¼tÀF»|¸nÐMÓNÐNô �:Š:”d—j’j Ô->Ô?Ó@Ð@r   c                óR   € V ^8„  d   QhR\         \        \        3,          R\        /# )r   ÚdatarT   )r   r7   r   r   )r   s   "r   r   r   Î   s*   € ÷ eNñ eNœ4¤¤S �>ð eN¬lñ eNr   c           
     ó"  € \        V \        4      '       g   \        R\        V 4       24      hRV 9  g   RV 9  d   \	        R4      hV R,          pV P                  R\        4      pV R,          pVR8X  d   ^ RIp\        WC4      # Rp\         F%  p \        P                  ! V4      p\        Wq4      p M	  Vf'   RP                  \        4      p\	        R	V R
V 24      h\        VR\        4      p	W)8w  d    \        P                   ! RV: RV	: R24       \        V\        4      '       g5   \#        V\$        P&                  4      '       d   \        WS4      #  V! V4      # W)8w  d   RV/p
M/ p
VP)                  4        EF+  w  r¼\        V\        4      '       d   RV9   d   RV9   d   \+        V4      W«&   K9  \        V\,        4      '       dF   V Uu. uF4  p\        V\        4      '       d   RV9   d   RV9   d   \+        V4      MTNK6  	  upW«&   K”  \        V\.        4      '       d   \1        RV 24      h\        V\        4      '       dZ   VP)                  4        UUu/ uF7  w  rïT\        V\        4      '       d   RV9   d   RV9   d   \+        V4      MTbK9  	  uppW«&   EK'  WÊV&   EK.  	   V! R/ V
B #   \        \        3 d     EK>  i ; i   Tu # ; iu upi u uppi   \2         d!   p\	        RTP4                   RT 24      hRp?ii ; i)a  
Create an AOBaseConfig subclass instance from a dictionary.

Args:
    data: Dictionary containing serialized config data

Returns:
    An instance of the appropriate AOBaseConfig subclass

Raises:
    ValueError: If deserialization fails for other reasons
zExpected dictionary, got r   r!   z;Input dictionary missing required '_type' or '_data' fieldsr    r%   Nz, zFailed to find class z  in any of the allowed modules: r	   zXStored version is not the same as current default version of the config: stored_version=z, current_default_version=z&, please check the deprecation warningr)   zFailed to create instance of z: r   )r+   r?   rM   r4   Ú
ValueErrorÚgetr   r$   r0   ÚALLOWED_AO_MODULESÚ	importlibÚimport_moduleÚImportErrorÚAttributeErrorÚjoinÚwarningsÚwarnÚ
issubclassr9   r:   r-   Úconfig_from_dictr<   r=   r>   Ú	Exceptionr   )r\   Ú	type_pathÚstored_versionÚobj_datar$   rV   Úmodule_pathÚmoduleÚallowed_modules_strÚcurrent_default_versionrH   ÚkeyrN   rJ   rE   rF   Úes   &                r   ri   ri   Î   s-  € ô �dœD×!Ò!ÜÐ3´D¸³J°<Ð@ÓAÐAà�dÔ˜g¨TÔ1ÜÐVÓWÐWà�W•€IØ—X‘X˜jÔ*:Ó;€NØ�G�}€Hð �MÔ!Ûä�uÓ'Ð'à
€Cß)ˆð	Ü×,Ò,¨[Ó9ˆFÜ˜&Ó,ˆCÙñ	 *ð ‚{Ø"Ÿi™iÔ(:Ó;ÐÜØ# I ;Ð.NÐObÐNcÐdó
ð 	
ô & c¨9Ô6FÓGÐØÔ0Ü�ŠØgÐXfÑWhð  iDð  lCñ  kEð  Ekð  lô	
ô
 �h¤×%Ò%Ü�cœ4Ÿ9™9×%Ò%ä˜3Ó)Ð)ð Ù˜8“}Ð$ð
 Ô0Ø# ^Ð4‰àˆà—n‘n×&‰
ˆÜ�eœT×"Ò" w°%Ô'7¸GÀuÔ<Lä"2°5Ó"9ˆNÓÜ˜œt×$Ò$ñ "ó	#ñ "�Dô ˜d¤D×)Ò)¨g¸¬oÀ'ÈTÄ/ô ! Ô&àòñ "ñ	#ˆNÓô ˜œu×%Ò%Ü%ð:Ø:?¸ðBóð ô ˜œt×$Ò$ð "ŸK™KœMô	#ñ *‘D�Að Ü˜a¤×&Ò&¨7°a¬<¸GÀq¼Lô $ AÔ&àòñ *ò	#ˆNÔð #(˜3Ôñ5 'ð:NÙÑ$�^Ñ$Ð$øôA œ^Ð,ô 	Ûð	ûð2 Ø’üò#ùó#øô ô NÜÐ8¸¿¹¸ÀbÈÈÐLÓMÐMûðNúsB   Â!J6ÅK Ç:KÉ=KÊ.K# Ê6KËKËKË#LË.L	Ì	L)r   ri   rZ   r`   >   útorchao.dtypesútorchao.quantizationútorchao.prototype.awqútorchao.prototype.parqútorchao.sparsity.sparse_apiútorchao.prototype.mx_formatsútorchao.prototype.parq.quantútorchao.prototype.smoothquantútorchao.prototype.quantizationú%torchao.quantization.quantize_.commonú(torchao.quantization.quantize_.workflows)Úabcr2   r9   ra   rW   rf   Útypingr   r   r$   Ú__all__r   ÚABCr   ÚJSONEncoderr   rZ   r`   ri   r   r   r   Ú<module>r„      si   ðó Û Û Û Û Û ß ã ò€ð Ð ô($�3—7‘7ô ($ôVe˜×(Ñ(ô eõPAò"Ð ÷eNr   