File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
intel_extension_for_pytorch/nn/modules Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -287,14 +287,15 @@ def from_int4_weight(
287287 lowp_mode = 2
288288 act_quant_mode = 1
289289 cache_weight_for_large_batch = False
290- if qconfig is not None :
291- if hasattr (qconfig , "lowp_mode" ):
292- lowp_mode = qconfig .lowp_mode
293- if hasattr (qconfig , "act_quant_mode" ):
294- act_quant_mode = qconfig .act_quant_mode
295- if hasattr (qconfig , "cache_weight_for_large_batch" ):
290+ if qconfig is not None and hasattr ( qconfig , "global_qconfig" ) :
291+ if hasattr (qconfig . global_qconfig , "lowp_mode" ):
292+ lowp_mode = qconfig .global_qconfig . lowp_mode
293+ if hasattr (qconfig . global_qconfig , "act_quant_mode" ):
294+ act_quant_mode = qconfig .global_qconfig . act_quant_mode
295+ if hasattr (qconfig . global_qconfig , "cache_weight_for_large_batch" ):
296296 cache_weight_for_large_batch = (
297- qconfig .cache_weight_for_large_batch and lowp_mode == 2
297+ qconfig .global_qconfig .cache_weight_for_large_batch
298+ and lowp_mode in (2 , 3 )
298299 )
299300
300301 w_dtype = qweight .dtype
You can’t perform that action at this time.
0 commit comments