
    in                     B   S SK Jr  S SKJr  S SKJrJrJrJrJ	r	J
r
JrJr  S SKrS SKJs  Jr  S SKJs  Js  Jr  S SKrS SKJrJr  S SKJr  S SKJr  S SKJr  S S	K J!r!  S S
K"J#r#  S SK$J%r%  S SK&J'r'J(r(J)r)  S SK*J+r+J,r,J-r-J.r.J/r/J0r0  Sr1 " S S\5      r2 " S S\/5      r3\2Rh                  SSSSSS.S\R(                  Rj                  S\Rl                  Rn                  Rp                  S\2S\9S\
\:   S\:S\
\\/\4      S\
\\;\4      S\R(                  Rj                  4S  jjr<g)!    )defaultdict)Enum)AnyCallableDefaultDictDictListOptionalTupleTypeN)INT4WeightObserverINT8WeightObserver)	NNCFGraph)nncf_logger)MinMaxQuantization)WeightCompressionParameters)$get_weight_compression_configuration)get_weight_tensor_port_ids)HistogramObserverPerChannelMinMaxObserverUniformQuantizationObserverBase)
EdgeOrNodeQuantizationAnnotationQuantizationSpecQuantizationSpecBase	QuantizerSharedQuantizationSpecquantization_annotationc                   4    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rg)QuantizationMode4   a  
Defines special quantization modes.

- INT8_SYM: INT8 symmetric quantization for both activations and weights.
- INT8_MIXED: INT8 asymmetric quantization for activations, symmetric for weights.
- INT8_TRANSFORMER: Optimized INT8 quantization for transformer-based models
- INT8WO_SYM: INT8 symmetric quantization for weights only.
- INT8WO_ASYM: INT8 asymmetric quantization for weights only.
- INT4WO_SYM: INT4 symmetric quantization for weights only.
- INT4WO_ASYM: INT4 asymmetric quantization for weights only
int8_sym
int8_mixedint8_transformer
int8wo_symint8wo_asym
int4wo_symint4wo_asym N)__name__
__module____qualname____firstlineno____doc__INT8_SYM
INT8_MIXEDINT8_TRANSFORMER
INT8WO_SYMINT8WO_ASYM
INT4WO_SYMINT4WO_ASYM__static_attributes__r)       o/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/executorch/backends/openvino/quantizer/quantizer.pyr    r    4   s-    
 HJ)JKJKr7   r    c                   V   \ rS rSrSr\R                  S\R                  S\R                  S\R                  S0r
\R                  S.S\4S	 jjrS
\R                  R                  R                   R"                  R$                  4S jrS
\4S jrS
\\\4   4S jr     S/S\\\      S\\\      S\\\      S\\\\\   \\   4         S\S
S4S jjrS\R@                  RB                  S\"S
\RF                  RH                  4S jr%S\R@                  RB                  S\"S
\\\&   \\&   \\&   4   4S jr'S\R@                  RB                  S\R@                  RP                  S\"S\)\R@                  RT                  \+4   S
\)\R@                  RT                  \+4   4
S jr,S\R@                  RB                  S\R@                  RP                  S\"S\)\R@                  RT                  \+4   S
\)\R@                  RT                  \+4   4
S jr-S\R@                  RB                  S
\R@                  RB                  4S jr.\/S\"S\\0   S\RF                  RH                  S
\04S  j5       r1\/S\R@                  RP                  S\"S!\RF                  Rd                  S\\R@                  RT                  \+4   S
\\3\+4   4
S" j5       r4\/S#\R@                  RT                  S\"S
\5\R@                  RT                  \R@                  RT                  4   4S$ j5       r6\/S#\R@                  RT                  S!\RF                  Rd                  S\"S
\34S% j5       r7\/S&\3S'\8S(\+S
S4S) j5       r9\/S*\&S
\:4S+ j5       r;\/S!\RF                  Rd                  S
\:4S, j5       r<S\R@                  RB                  S
S4S- jr=S.r>g)0OpenVINOQuantizerJ   z
Implementation of the Torch AO quantizer which annotates models with quantization annotations
optimally for the inference via OpenVINO.
int4_sym	int4_asymr"   	int8_asym)moder?   c                   Xl         U R                   [        R                  ;  a  U[        R                  :X  a'  [
        R                  R                  R                  nSnOaU[        R                  :X  a'  [
        R                  R                  R                  nSnO&Sn[        R                  R                  R                  n[        SX4S.UD6U l        g[        R                  U   n[#        [        R$                  " U5      40 UD6nSUS'   [        R
                  R&                  R(                  R*                  R,                  " S0 UD6U l        g)a  
:param mode: Defines special quantization modes.
    - INT8_SYM: INT8 symmetric quantization for both activations and weights.
    - INT8_MIXED: INT8 asymmetric quantization for activations, symmetric for weights.
    - INT8_TRANSFORMER: Optimized INT8 quantization for transformer-based models
    Default value is INT8_SYM.
    - INT4_SYM: Symmetric INT4 Weights-Only Compression
    - INT4_ASYM: Asymmetric INT4 Weights-Only Compression
:param kwargs: Arguments to pass to the NNCF MinMaxQuantization algorithm.
N)preset
model_type   subset_sizer)   )r?   r:   WEIGHTS_ONLY_COMPRESSION_MODESr    r/   quantizationstructsQuantizationPresetPERFORMANCEr0   MIXEDnncf
parameters	ModelTypeTRANSFORMERr   _algor   CompressWeightsMode
algorithmsweight_compression	algorithmWeightCompression)selfr?   kwargsrA   rB   compression_mode weight_compression_configurations          r8   __init__OpenVINOQuantizer.__init__W   s&     	99-LLL'000%--@@LL!
)444%--@@FF!
!__66BB
+ 8>DJ  1OO  0T(()9:00,
  -]; **55HHRRdd 2DJr7   returnc                 .   [        U R                  [        R                  R                  R
                  R                  R                  5      (       d9  [        S[        U R                  5      R                   SU R                   S35      eU R                  $ )Nz5This method requires WeightCompression algo, but got  (mode=).)
isinstancerO   rK   rF   rQ   rR   rS   rT   	TypeErrortyper*   r?   rU   s    r8   _require_wc_algo"OpenVINOQuantizer._require_wc_algo   s     JJ((;;EEWW
 
 DJJ'0012G  zzr7   c                     [        U R                  [        5      (       d9  [        S[	        U R                  5      R
                   SU R                   S35      eU R                  $ )Nz6This method requires MinMaxQuantization algo, but got r]   r^   )r_   rO   r   r`   ra   r*   r?   rb   s    r8   _require_ptq_algo#OpenVINOQuantizer._require_ptq_algo   sY    $**&899DJJ'0012G  zzr7   c                     U R                  5       nUR                  UR                  UR                  UR                  S.nU$ )aw  
Returns a dictionary with all_layers, group_size, backup_mode and Quantization mode parameters
used by the compress_pt2e weight compression algorithm.

:return: A dictionary containing:
    1. mode: Quantization mode. One of INT4 Sym, INT4 Asym, INT8 Sym, INT8 Asym.
    2. group_size: group size to be used for group-wise compression.
    3. all_layers: Indicates whether embeddings and last MatMul layers should be compressed to a primary
        precision. By default, the backup precision is assigned for the embeddings and last MatMul layers.
    4. backup_mode: Defines a backup mode for mixed-precision weight compression.
)r?   
group_size
all_layersbackup_mode)rc   r?   ri   rj   rk   )rU   algo%quantizer_initialized_algo_attributess      r8   get_weights_compression_config0OpenVINOQuantizer.get_weights_compression_config   s@     $$&II////++	1
- 54r7   Nnamespatternstypes	subgraphsvalidatec           
          U R                   R                  [        R                  " U=(       d    / U=(       d    / U=(       d    / U=(       d    / US95        g)a  
Provides an option to specify portions of model to be excluded from compression.
The ignored scope defines model sub-graphs that should be excluded from the quantization process.

:param names: List of ignored node names.
:param patterns: List of regular expressions that define patterns for names of ignored nodes.
:param types: List of ignored operation types.
:param subgraphs: List of ignored subgraphs.
:param validate: If set to True, then a RuntimeError will be raised if any ignored scope does not match
  in the model graph.
)rp   rq   rr   rs   rt   N)rO   set_ignored_scoperK   IgnoredScope)rU   rp   rq   rr   rs   rt   s         r8   rv   #OpenVINOQuantizer.set_ignored_scope   sC    & 	

$$kr!Rkr#/r!	
r7   model
nncf_graphc                 f    U R                  5       nUR                  U5        UR                  X5      $ N)rf   _set_backend_entityfind_quantization_setuprU   ry   rz   rl   s       r8   get_nncf_quantization_setup-OpenVINOQuantizer.get_nncf_quantization_setup   s1     %%'  '++E>>r7   c                 f    U R                  5       nUR                  U5        UR                  X5      $ )a  
Collect weight compression parameters for the given FX model and NNCF graph.

:param model: FX GraphModule to analyze for weight compression.
:param nncf_graph: NNCFGraph representation of the model.
:return: A tuple of:
    - all parameters eligible for weight compression,
    - ratio-defining parameters used to set primary/backup precisions,
    - parameters that are not compressible and remain in original precision.
)rc   set_backend_entity!get_weight_compression_parametersr   s       r8   &get_nncf_weight_compression_parameters8OpenVINOQuantizer.get_nncf_weight_compression_parameters   s1    & $$&&55eHHr7   graphnode_vs_torch_annotationc           	         U R                  X5      tpVU H  nUR                  (       d.  [        R                  " S[	        UR
                  SS5      5        MB  UR
                  n[        R                  R                  X(R                  5      n	XI   n
U R                  X5      nU R                  US9nU R                  XU
5        M     U$ )a	  
Annotates the model graph with weight-only quantization specs.

Identifies compressible nodes in the NNCF graph and attaches the corresponding
TorchAO quantization specifications to their weight edges for later transformation.

:param model: The FX GraphModule to annotate.
:param graph: The underlying FX graph.
:param nncf_graph: The corresponding NNCF graph.
:param node_vs_torch_annotation: A mapping of FX nodes to quantization annotations.
:return: Updated mapping of FX nodes with weight compression annotations.
zPSkipping weight compression for node '%s' because compression_config is missing.	node_namez	<unknown>)wc_param)r   compression_configr   debuggetattrnode_with_weightnncf_fx
node_utilsget_graph_node_by_namer   _get_weight_edge+_get_torch_ao_qspec_from_nncf_config_for_wc_fill_torch_ao_annotation)rU   ry   r   rz   r   all_wc_params_r   r   target_node
annotationedge_or_nodeqspecs                r8   _annotate_weight_compression.OpenVINOQuantizer._annotate_weight_compression   s    & !GG
 &H..!!fH55{KP '88!,,CC11K 2>J00ILDDhDWE**<
K &  ('r7   c                   ^^ U R                  X5      mTR                  R                  5        H:  nU R                  X#XT5      u  pgU R	                  U5      nU R                  XhU5        M<     TR                  R                  5        GHH  n	U R                  X9T5      n
TR                  U
   m[        UU4S jU	 5       5      (       aq  U	 Vs/ s H  nTR                  U   PM     nn[        R                  " SU Vs/ s H-  oUR                  R                  [        UR                  5      4PM/     sn 35      e[        R                   R#                  UTR                  R$                  5      nU R'                  UTU5      nU	 HJ  nX:X  a  M
  [)        U5      nTR                  U   nU R                  X#XT5      u  pgU R                  XhU5        ML     GMK     U$ s  snf s  snf )ax  
Annotates the model graph with post-training quantization configurations.

:param model: The FX GraphModule to annotate.
:param graph: The underlying FX graph.
:param nncf_graph: The corresponding NNCF graph.
:param node_vs_torch_annotation: A mapping of FX nodes to quantization annotations.
:return: Updated mapping of FX nodes with post-training quantization annotations.
c              3   p   >#    U  H+  nTR                   TR                  U   R                   :g  v   M-     g 7fr|   )qconfigquantization_points).0q_idquantization_setuproot_qps     r8   	<genexpr>IOpenVINOQuantizer._annotate_post_training_quantization.<locals>.<genexpr>5  s3      )D #5#I#I$#O#W#WW)s   36zBDifferent quantization configs are set to one unified scale group:)r   r   values _get_edge_or_node_and_annotation,_get_torch_ao_qspec_from_nncf_config_for_ptqr   unified_scale_groups%_get_unified_scales_root_quantizer_idanyrK   InternalErrorinsertion_point__dict__strr   r   r   r   target_node_name_get_edge_or_noder   )rU   ry   r   rz   r   qpr   r   r   quantizer_idsroot_quantizer_idqidqpsroot_target_noderoot_edge_or_nodequantizer_idr   r   s                   @@r8   $_annotate_post_training_quantization6OpenVINOQuantizer._annotate_post_training_quantization  s     "==eP$88??AB'+'L'L2($L AA"E  **<
K B 0DDKKMM $ J J+=! )<<=NOG )  
 LYKXC&::3?=   ((XQTUQT2++44c"**oFQTUVX 
  '11HHw..??  !% 6 6 ':! !.4./@A';;LI+/+P+Pr,( ..|JO !.3 NH ('5
 Vs   
G:4Gc                    [         R                  R                  R                  U5      nUR                  n[        [        5      nU R                  [        R                  ;   a  U R                  XX$5      nOU R                  XX$5      nUR                  5        H-  u  pV[        UR                  ;  d   eXeR                  [        '   M/     U$ r|   )r   nncf_graph_builderGraphConvertercreate_nncf_graphr   r   r   r?   r:   rE   r   r   itemsQUANT_ANNOTATION_KEYmeta)rU   ry   rz   r   r   noder   s          r8   annotateOpenVINOQuantizer.annotateU  s    //>>PPQVW
./ 	! 99)HHH'+'H'Hj($ (,'P'Pj($ !9 > > @D'tyy888.8II*+ !A r7   r   quantizer_setupc                    SnSnU HZ  nUR                   U   R                  R                  nU R                  U5      nUb  UR                  U:  d  ML  UnUR                  nM\     Uc  Sn[
        R                  " U5      eU$ )a  
Identifies the earliest quantizer node ID based on the corresponding `nncf_node.node_id`
in the given NNCFGraph. This is required by the `_get_obs_or_fq_map` function.
Refer to: https://github.com/pytorch/ao/blob/main/torchao/quantization/pt2e/prepare.py

:param nncf_graph: The NNCFGraph instance.
:param quantizer_ids: The list of quantizer IDs to evaluate.
:param quantizer_setup: The instance of SingleConfigQuantizerSetup.
:return: The ID of the earliest quantizer node in terms of `nncf_node.node_id`.
Nz Root quantizer ids can't be None)r   r   r   get_node_by_namenode_idrK   r   )	rz   r   r   nncf_node_quantizer_idr   r   r   	nncf_nodemsgs	            r8   r   7OpenVINOQuantizer._get_unified_scales_root_quantizer_idk  s      "& )L.BB o..  #334DEI&.$$'==$0!)2):):& * $4C$$S))  r7   r   c                     [         R                  R                  XR                  R                  5      nX4   n[
        R                  XBU5      nXe4$ )a  
Retrieves the edge or node and its corresponding QuantizationAnnotation based on the given graph,
quantization point, and node-to-annotation mapping.

:param graph: torch.fx.Graph instance.
:param nncf_graph: NNCFGraph instance.
:param qp: QuantizationPointBase instance.
:param node_vs_torch_annotation: A dictionary mapping torch.fx.GraphNode objects to their respective
    QuantizationAnnotations.
:return: A tuple containing the EdgeOrNode and its associated QuantizationAnnotation.
)r   r   r   r   r   r:   r   )r   rz   r   r   r   r   r   s          r8   r   2OpenVINOQuantizer._get_edge_or_node_and_annotation  sN    $ ((??%%66
 .:
(::;JW''r7   r   c           	          UR                  U R                  5      n[        X!5      n[        U5      S:  a-  [        R
                  " SU R                   SUS    SU S35        U R                  US      nX@4$ )a  
Returns the FX node corresponding to the weight tensor input of a given operator node.
Uses the NNCF graph to identify which input port of the target node holds the weight.
If multiple weight ports are present, a warning is issued and only the first one is used.

:param target_node: FX node representing a weighted operation (e.g., Linear, Conv).
:param nncf_graph: NNCFGraph used to determine weight port indices.
:return: Edge represented by a Tuple of (weight_node, target_node), where weight_node is the FX node supplying the weight.
rC   z"Quantization of the weighted node zK is not yet supported by the OpenVINOQuantizer. Only the weight on port ID r   z> will be quantized. Quantizable weights are located on ports: .)r   namer   lenr   warningall_input_nodes)r   rz   r   weights_ports_idsweight_nodes        r8   r   "OpenVINOQuantizer._get_weight_edge  s     //0@0@A	6yM !A%4[5E5E4F//@/C.D E>>O=PPQS "112CA2FG))r7   c                     UR                   nUR                  5       (       a  [        R                  X5      $ UR                  c  U $ U R
                  UR                     nX@4$ )a$  
Returns the edge or node based on the given target node and quantization point.

:param target_node: Target node instance.
:param qp: QuantizationPointBase instance.
:param graph: NNCFGraph instance.
:return: The corresponding EdgeOrNode derived from the target node and quantization point.
)r   is_weight_quantization_pointr:   r   input_port_idr   )r   r   rz   ipr   s        r8   r   #OpenVINOQuantizer._get_edge_or_node  s`     **,,$55kNN#**2+;+;<""r7   r   r   annotation_to_updatec                     [        U [        R                  R                  5      (       a  Xl        gXR
                  U S   '   g)ak  
Helper method to update the annotation_to_update based on the specified edge_or_node and qspec.

:param edge_or_node: The target EdgeOrNode to be used for the update.
:param qspec: An instance of QuantizationSpecBase representing the quantization specification to apply.
:param annotation_to_update: The annotation to update based on the edge_or_node and qspec.
r   N)r_   torchfxNodeoutput_qspecinput_qspec_map)r   r   r   s      r8   r   +OpenVINOQuantizer._fill_torch_ao_annotation  s1     lEHHMM2205-DI00aAr7   r   c           
      j   0 nU R                   R                  nXS'   U R                   R                  nU[        R                  R
                  [        R                  R                  4;   aV  [        nU(       d  SOSnU(       d  SOSn[        R                  nSnU(       d  [        R                  O[        R                  n	OU[        nU(       d  SOSnU(       d  SOSn[        R                  nSnU(       d  [        R                  O[        R                  n	[        UUR                  " S0 UD6UUU	US	S
9$ )z
Returns a TorchAO QuantizationSpec based on NNCF weight compression parameter.

:param wc_param: NNCF Weight compression parameters for the node.
:return: A TorchAO QuantizationSpec.
r   ir               Fdtypeobserver_or_fake_quant_ctr	quant_min	quant_maxqschemech_axis
is_dynamicr)   )r   r?   is_asym_moderK   rP   	INT4_ASYMINT4_SYMr   r   int8per_channel_symmetricper_channel_affiner   r   	with_args)
r   
extra_argsqmoder   observerr   r   r   channel_axistorch_qschemes
             r8   r   =OpenVINOQuantizer._get_torch_ao_qspec_from_nncf_config_for_wc  s    &(
++00!):22??$$..$$--
 
 *H".AI!-2IJJEL $ ++-- * *H$0aI#/SIJJEL $ ++-- 
  '/'9'9'GJ'G! 
 	
r7   c           
         SS0nU R                  5       nU R                  n[        R                  nSnSnSnUR                  (       aR  UR
                  [        R                  R                  R                  L a  [        R                  O[        R                  nOQUR
                  [        R                  R                  R                  L a  [        R                  O[        R                  nU(       an  [        n	SnSn[        R                  nSnUR
                  [        R                  R                  R                  L a  [        R                  O[        R                  nOgU[        R                  [        R                  4;   a  [        O[        n	SnSnUR                   (       a  [        R                  O[        R"                  nSn[%        UU	R&                  " S0 UD6UUUUS	S
9$ )z
Returns a TorchAO QuantizationSpec based on NNCF quantization point.

:param qp: Quantization point from NNCF.
:return: A TorchAO QuantizationSpec.
epsgؗҜ<Nr   r   r   r   rC   Fr   r)   )r   r   r   r   per_channelr?   rF   rG   QuantizationScheme	SYMMETRICr   r   per_tensor_symmetricper_tensor_affiner   r   signedness_to_forceuint8r   r   )
r   r   	is_weightr   r   r   r   r   r  r   s
             r8   r   >OpenVINOQuantizer._get_torch_ao_qspec_from_nncf_config_for_ptq  s    ',U^
335	**

		 <<<#7#7#J#J#T#TT ++--  <<<#7#7#J#J#T#TT **,, 
 /HIIJJEL <<<#7#7#J#J#T#TT ++--  !..0G0GHI " .	  II")"="=EJJ5;;EL'/'9'9'GJ'G! 
 	
r7   c                     g r|   r)   )rU   ry   s     r8   rt   OpenVINOQuantizer.validatea  s    r7   )rO   r?   )NNNNT)?r*   r+   r,   r-   r.   r    r4   r5   r2   r3   rE   r/   rY   rK   rF   rQ   rR   rS   rT   rc   r   rf   r   r   r   rn   r
   r	   r   boolrv   r   r   GraphModuler   r   SingleConfigQuantizerSetupr   r   r   Graphr   r   r   r   r   r   staticmethodintr   QuantizationPointBaser   r   tupler   r   r   r   r   r   r   rt   r6   r)   r7   r8   r:   r:   J   s    	##Z$$k##Z$$k	&" "2!:!:, ,\				%	%	8	8	B	B	T	T#5 5S#X 50 &*(,%)AE
S	"
 49%
 S	"	

 DtCy$s)';!<=>
 
 

:?XX))?7@?		%	%	@	@?Ixx##I I 
()()()	+
	I.'(xx##'( xx~~'( 	'(
 #.ehhmm=S.S"T'( 
UXX]]$::	;'(R?(xx##?( xx~~?( 	?(
 #.ehhmm=S.S"T?( 
UXX]]$::	;?(Behh22 uxx7K7K , !!Cy! &55PP! 
	! !B (xx~~(( ((>>( #'uxx}}6L'L"M	(
 
z11	2( (0 *XX]]** 
uxx}}ehhmm+	,* *4 #XX]]#((>># # 
	# #. J J#J 5J 
	J J" 1
-1
	1
 1
f ?
((>>?
	?
 ?
Behh22 t r7   r:   i,  TF)r?   rD   fast_bias_correctionsmooth_quanttransform_fnextra_quantizer_optionscaptured_modelcalibration_datasetr?   rD   r  r  r  r  r[   c                    U=(       d    0 nSU;   a  [        SU 35        US	 [        SSU0UD6n	[        S5        SU;  a  SUS'   [        R                  " U U	4U[        R
                  " X5      UUS.UD6n
U
$ )a  
Quantizes a model using NNCF quantize_pt2e API.

:param captured_model: The model to be quantized, represented as a torch.fx.GraphModule.
:param calibration_dataset: A DataLoader containing calibration data for quantization.
:param mode: Defines special quantization modes.
    - INT8_SYM: INT8 symmetric quantization for both activations and weights.
    - INT8_MIXED: INT8 asymmetric quantization for activations, symmetric for weights.
    - INT8_TRANSFORMER: Optimized INT8 quantization for transformer-based models
    Default value is INT8_SYM.
:param subset_size: Size of a subset to calculate activations
    statistics used for quantization.
:param fast_bias_correction: Setting this option to `False` enables a different
    bias correction method which is more accurate, in general, and takes
    more time but requires less memory. None disables the bias correction algorithm.
:param smooth_quant: Setting this option to `True` enables the SmoothQuant algorithm.
:param extra_quantizer_options: A dictionary containing additional configuration options
    for the OpenVINOQuantizer.
:param kwargs: The keyword arguments for the nncf quantize_pt2e function.
:return: The quantized model as a torch.fx.GraphModule.
r?   zBIgnoring "mode" from the quantizer_config. Using parameter mode = zPTQ: Quantize the modelfold_quantizeF)rD   r  r  r  r)   )printr:   r   quantize_pt2erK   Dataset)r  r  r?   rD   r  r  r  r  rV   	quantizerquantized_models              r8   quantize_modelr%  e  s    B 6;((PQUPVW	
 $F+!GtG/FGI	
#$f$"'++   LL)<K1! O r7   )=collectionsr   enumr   typingr   r   r   r   r	   r
   r   r   rK   nncf.common.quantizationcommonrF   nncf.experimental.torch.fxexperimentalr   r   r   torch.fx0executorch.backends.openvino.quantizer.observersr   r   nncf.common.graph.graphr   nncf.common.loggingr   .nncf.quantization.algorithms.min_max.algorithmr   6nncf.quantization.algorithms.weight_compression.configr    nncf.quantization.quantize_modelr   nncf.torch.model_graph_managerr   torchao.quantization.pt2er   r   r   #torchao.quantization.pt2e.quantizerr   r   r   r   r   r   r   r    r:   r/   r  utilsdata
DataLoaderr  r  r   r%  r)   r7   r8   <module>r:     s:   $  P P P  / / , ,  . + 
  1  t  ,X	 X~ .66+/378<8HH((8))448 	8
 8 #4.8 8 8SE3J/08 &d38n58 XX8r7   