mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
NNCF fix Conv layers remains in fp32
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user