pytorch / executorch

On-device AI across mobile, embedded and edge for PyTorch
https://pytorch.org/executorch/
Other
1.44k stars 234 forks source link

Does executorch support qat quant for qualcomm qnn backend? #2169

Open Novelfor opened 4 months ago

Novelfor commented 4 months ago

I want to use qat method for my model, but i can only find ptq quantizer in executorch, are there some examples of how to implement Quantization Aware Training (QAT) for qnn backend?

jerryzh168 commented 1 month ago

QAT is going through the same code path as PTQ. if you don't have some special handling for conv-bn, you could start with adding the configuration for QAT, like: https://github.com/pytorch/pytorch/blob/a0429c01ad665ffb2faa04a411913ecee9962566/torch/ao/quantization/quantizer/xnnpack_quantizer.py#L116