You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Adds a FuseQATConvBN which folds the QAT Conv-BN simulation chain (`conv → q → dq → div(scale) → add(orig_bias) → batch_norm`) inserted by `prepare_qat_pt2e` into the conv's quantized bias and removes the chain.
The pass runs in two steps inside a single `call()`:
1. Bias prep — for each conv, create a zero-filled quantized bias if missing, or quantize a float bias as per-tensor int32. Required so step 2 has a quantized bias slot to write the BN correction into.
2. Fold — for each matched chain, compute the BN correction
C = (orig_bias - running_mean) * bn_weight / sqrt(running_var + eps) + bn_bias
and absorb it into the conv's quantized bias in place. Erase the chain + batch_norm.
Differential Revision: D104497938
0 commit comments