+
    "Ý³j•  ã                  óz   € ^ RI Ht ^ RIHt ^ RIHt ^RIHtHt ]'       d   ^ RI	t	^ RI
Ht R.t ! R R]4      tR# )	é    )Úannotations)ÚTYPE_CHECKING)ÚQ_ANNOTATION_KEY)ÚQuantizationAnnotationÚ	QuantizerN)ÚNodeÚComposableQuantizerc                  ób   a € ] tR t^tRtR V 3R lltR R ltR R ltR R	 ltR
 R lt	Rt
V ;t# )r	   a4  
ComposableQuantizer allows users to combine more than one quantizer into a single quantizer.
This allows users to quantize a model with multiple quantizers. E.g., embedding quantization
maybe supported by one quantizer while linear layers and other ops might be supported by another
quantizer.

ComposableQuantizer is initialized with a list of `Quantizer` instances.
The order of the composition matters since that is the order in which the quantizers will be
applies.
Example:
```
embedding_quantizer = EmbeddingQuantizer()
linear_quantizer = MyLinearQuantizer()
xnnpack_quantizer = XNNPackQuantizer() # to handle ops not quantized by previous two quantizers
composed_quantizer = ComposableQuantizer([embedding_quantizer, linear_quantizer, xnnpack_quantizer])
prepared_m = prepare_pt2e(model, composed_quantizer)
```
c               ó   € V ^8„  d   QhRR/# )é   Ú
quantizerszlist[Quantizer]© )Úformats   "Úy/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torchao/quantization/pt2e/quantizer/composable_quantizer.pyÚ__annotate__Ú ComposableQuantizer.__annotate__,   s   € ÷ Iñ I ?ñ Ió    c                	ó>   <€ \         SV `  4        Wn        / V n        R # ©N)ÚsuperÚ__init__r   Ú_graph_annotations)Úselfr   Ú	__class__s   &&€r   r   ÚComposableQuantizer.__init__,   s   ø€ Ü‰ÑÔØ$ŒØFHˆÖr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úgmútorch.fx.GraphModuleÚ	quantizerr   ÚreturnÚNoner   )r   s   "r   r   r   1   s$   € ÷ ñ Ø&ðØ3<ðà	ñr   c                	ó  € VP                   P                   Fç  p\        VP                  9   d›   W0P                  9   de   \        V P                  V,          4      \        VP                  \        ,          4      8w  d&   \        R VP                  P                   RV 24      hVP                  \        ,          V P                  V&   K²  W0P                  9   g   KÄ  \        R VP                  P                   RV 24      h	  R# )z
Quantizer z! has changed annotations on node z! has removed annotations on node N)	ÚgraphÚnodesr   Úmetar   ÚidÚRuntimeErrorr   Ú__name__)r   r   r   Úns   &&& r   Ú _record_and_validate_annotationsÚ4ComposableQuantizer._record_and_validate_annotations1   sÙ   € ð —‘—”ˆAÜ 1§6¡6Ô)ð ×/Ñ/Ô/Ü�t×.Ñ.¨qÕ1Ó2´b¸¿¹Ô@PÕ9QÓ6RÔRä&Ø$ Y×%8Ñ%8×%AÑ%AÐ$BÐBcÐdeÐcfÐgóð ð 23·±Ô8HÕ1I�D×+Ñ+¨AÓ.à×/Ñ/Ö/Ü&Ø$ Y×%8Ñ%8×%AÑ%AÐ$BÐBcÐdeÐcfÐgóð ó  r   c               ó    € V ^8„  d   QhRRRR/# ©r   Úmodelr   r    r   )r   s   "r   r   r   F   s   € ÷ ñ Ð2ð Ð7Kñ r   c                óp   € V P                    F%  pVP                  V4       V P                  W4       K'  	  V# )z!just handling global spec for now)r   Úannotater*   ©r   r.   r   s   && r   r0   ÚComposableQuantizer.annotateF   s3   € àŸœˆIØ×Ñ˜uÔ%Ø×1Ñ1°%ÖCñ )ð ˆr   c               ó    € V ^8„  d   QhRRRR/# r-   r   )r   s   "r   r   r   M   s   € ÷ ñ Ø)ðà	ñr   c                	óN   € V P                    F  pVP                  V4      pK  	  V# r   )r   Útransform_for_annotationr1   s   && r   r5   Ú,ComposableQuantizer.transform_for_annotationM   s'   € ð ŸœˆIØ×6Ñ6°uÓ=ŠEñ )àˆr   c               ó    € V ^8„  d   QhRRRR/# )r   r.   r   r    r!   r   )r   s   "r   r   r   T   s   € ÷ ñ Ð2ð °tñ r   c                	ó   € R # r   r   )r   r.   s   &&r   ÚvalidateÚComposableQuantizer.validateT   s   € Ùr   )r   r   )r(   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r*   r0   r5   r9   Ú__static_attributes__Ú__classcell__)r   s   @r   r	   r	      s-   ø† ñ÷&Ið Iõ
õ*õ÷ó r   )Ú
__future__r   Útypingr   Ú-torchao.quantization.pt2e.quantizer.quantizerr   r   r   r   ÚtorchÚtorch.fxr   Ú__all__r	   r   r   r   Ú<module>rG      s4   ðõ #å  å Jç 8çÛÝð ð€ô
=˜)ö =r   