NNCF fix Conv layers remains in fp32

This commit is contained in:
Disty0
2025-04-23 19:04:43 +03:00
parent 75d169bc1c
commit 491ea6eea4
+2 -1
View File
@@ -47,7 +47,6 @@ def nncf_compress_layer(layer, num_bits, is_asym_mode, torch_dtype=None, quant_c
if layer.__class__.__name__ in allowed_types:
if torch_dtype is None:
torch_dtype = devices.dtype
layer.weight.data = layer.weight.data.float()
if layer.__class__.__name__ in conv_types:
if is_asym_mode or not quant_conv: # don't quant convs with asym mode
@@ -60,6 +59,8 @@ def nncf_compress_layer(layer, num_bits, is_asym_mode, torch_dtype=None, quant_c
else:
reduction_axes = [layer.weight.ndim - 1]
layer.weight.data = layer.weight.data.float()
if is_asym_mode:
level_low = 0
level_high = 2**num_bits - 1