When performing QAT with Aimet, assuming my model consists of conv + BN + Silu, I use the following code:
sim = QuantizationSimModel(model=model,
quant_scheme=QuantScheme.post_training_tf_enhanced,
dummy_input=dummy_input,
default_output_bw=8,
default_param_bw=8)
Then I set model.train() and define the optimizer:
optimizer = optim.SGD(
model.parameters(),
lr=learning_rate,
momentum=0.9,
weight_decay=weight_decay,
)
(1) After setting quant_scheme=QuantScheme.post_training_tf_enhanced:
model.conv.weight obviously has requires_grad=True and is trainable. But do model.conv.param_quantizers.weight.min and model.conv.param_quantizers.weight.max also have requires_grad=True and are trainable?
(2) If I set quant_scheme=QuantScheme.training_range_learning_with_tf_init, what will the requires_grad status of model.conv.param_quantizers.weight.min andmodel.conv.param_quantizers.weight.maxbe?
What is the actual difference in the parameters being updated during QAT training between these two different quant_scheme settings?
When performing QAT with Aimet, assuming my model consists of conv + BN + Silu, I use the following code:
Then I set
model.train()and define the optimizer:(1) After setting
quant_scheme=QuantScheme.post_training_tf_enhanced:model.conv.weightobviously hasrequires_grad=Trueand is trainable. But domodel.conv.param_quantizers.weight.minandmodel.conv.param_quantizers.weight.maxalso haverequires_grad=Trueand are trainable?(2) If I set
quant_scheme=QuantScheme.training_range_learning_with_tf_init, what will the requires_grad status ofmodel.conv.param_quantizers.weight.minandmodel.conv.param_quantizers.weight.maxbe?What is the actual difference in the parameters being updated during QAT training between these two different quant_scheme settings?