Sparsebit icon indicating copy to clipboard operation
Sparsebit copied to clipboard

A bug may have been resolved.

Open haiduo opened this issue 1 year ago • 2 comments

There is a bug here, I thought of a simple way to fix it, which is applicable to QAT of ViT.

elif 'input_quantizer.scale' in dict(_module.state_dict()).keys():
      _module.input_quantizer.set_fake_fused()  # 有bug, quant_state会来回切.
else:
     print("no_set_fake_fused:", _user.name, _module.input_quantizer_generated)

haiduo avatar Oct 04 '22 15:10 haiduo

I think this issue is from your misunderstanding. Please check your code to verify it.

PeiqinSun avatar Oct 11 '22 04:10 PeiqinSun

Thanks for your Reply. First of all, I found the error by Vit_QAT training, and reporting: 'MatMul' object has no attribute 'input_quantizer', so I did this, to exclude this error by whether the operator has a scale. Otherwise, cannot continue model.init_QAT().

haiduo avatar Oct 11 '22 04:10 haiduo

Hi, did you successfully reproduce the result of ViT_QAT?

KenRamzes avatar Nov 09 '22 07:11 KenRamzes