Preserve BatchNorm running state in composable quantizer#21056
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21056
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@denizkilinc has exported this pull request. If you are a Meta employee, you can view the originating Diff in D112989631. |
|
|
This PR needs a
|
|
/easycla |
7b0a3ba to
b0fcdc3
Compare
rascani
left a comment
There was a problem hiding this comment.
LGTM, but you'll need to sign EasyCLA. Let me know if you need any help with that.
|
@rascani thank you for the review. I signed EasyCLA, now waiting for approval. If don't get approval today, I'll let you know. |
Summary: Quantization-aware training with the composable `PatternQuantizer` incorrectly observed BatchNorm affine parameters and running-state buffers as activation inputs. The inserted fake-quant nodes broke the connection between `aten.batch_norm.default` and the registered `running_mean` and `running_var` buffers, so training used batch statistics while evaluation consumed stale running statistics. Keep `aten.batch_norm.default` arguments 1-4 directly connected to registered state by excluding them from activation observation while retaining activation and output quantization. Add Arm and Sleep/ModAI regression tests that verify the state operands remain registered and the running statistics update during QAT. Differential Revision: D112989631
25a31a7 to
f972b88
Compare
|
@denizkilinc has imported this pull request. If you are a Meta employee, you can view this in D112989631. |
|
@pytorchbot merge |
|
Mergebot is not configured for this repository. Please use the merge button provided by GitHub. |
Summary:
Quantization-aware training with the composable
PatternQuantizerincorrectly observed BatchNorm affine parameters and running-state buffers as activation inputs. The inserted fake-quant nodes broke the connection betweenaten.batch_norm.defaultand the registeredrunning_meanandrunning_varbuffers, so training used batch statistics while evaluation consumed stale running statistics.Keep
aten.batch_norm.defaultarguments 1-4 directly connected to registered state by excluding them from activation observation while retaining activation and output quantization. Add Arm and Sleep/ModAI regression tests that verify the state operands remain registered and the running statistics update during QAT.Differential Revision: D112989631