Skip to content
Snippets Groups Projects
Commit 8d694a03 authored by Guy Jacob's avatar Guy Jacob
Browse files

Bugfix in test_quantizer

parent 107e4825
No related branches found
No related tags found
No related merge requests found
...@@ -317,15 +317,17 @@ def test_param_quantization(model, optimizer, qbits, bits_overrides, explicit_ex ...@@ -317,15 +317,17 @@ def test_param_quantization(model, optimizer, qbits, bits_overrides, explicit_ex
if has_children(pre_quant_module): if has_children(pre_quant_module):
continue continue
num_bits = expected_qbits[name].wts num_qbits = expected_qbits[name].wts
for param_name, pre_quant_param in pre_quant_module.named_parameters(): for param_name, pre_quant_param in pre_quant_module.named_parameters():
quantizable = num_bits is not None quantizable = num_qbits is not None
if param_name.endswith('bias'): if param_name.endswith('bias'):
quantizable = quantizable and quantize_bias quantizable = quantizable and quantize_bias
# Bias number of bits is hard-coded to 32 for now... # Bias number of bits is hard-coded to 32 for now...
if quantizable: if quantizable:
num_bits = 32 num_bits = 32
else:
num_bits = num_qbits
if quantizable and train_with_fp_copy: if quantizable and train_with_fp_copy:
# "param_name" and "pre_quant_param" refer to the float copy # "param_name" and "pre_quant_param" refer to the float copy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment