Sparsebit
Sparsebit copied to clipboard
A bug may have been resolved.
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)
I think this issue is from your misunderstanding. Please check your code to verify it.
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()
.
Hi, did you successfully reproduce the result of ViT_QAT?