Skip to content

Commit 7f9ccda

Browse files
authored
Arm backend: Add script to do quantization sensitivity report. (#23807)
## Summary Adds a VGF quantization sensitivity analysis tool for investigating which source modules contribute most to numerical degradation after PT2E quantization. The existing graph-wide quantization assessment shows **where** FP32 and quantized tensors diverge. This PR adds a complementary counterfactual experiment that asks whether keeping a selected source module in floating point actually improves downstream numerical quality. For each candidate module, the analyzer rebuilds and recalibrates the quantized model with that module excluded from quantization, then compares the mixed model against the FP32 reference. ## What is included The sensitivity analyzer supports: - automatic candidate selection based on worst local SNR; - explicit source-module FQNs; - mapping exported assessment FQNs back to quantizer-selectable source modules; - optional parent-module expansion for larger semantic interventions; - one-module-at-a-time FP32 rescue experiments; - local SNR, MSE and cosine rescue metrics; - final-output SNR, MSE and cosine rescue metrics; - multiple stable output views for models such as object detectors; - Q/DQ boundary inspection to verify that the requested quantization intervention was applied; - JSON-serializable reports. The analysis intentionally evaluates independent interventions rather than searching combinations or claiming task-level accuracy improvements. ## Example A small end-to-end example is added in: ```text examples/arm/vgf_quantization_sensitivity_toy_example.py ``` Assisted with Codex. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani Signed-off-by: Elena Zhelezina <elena.zhelezina@arm.com>
1 parent 70dc772 commit 7f9ccda

6 files changed

Lines changed: 1516 additions & 0 deletions

File tree

‎backends/arm/BUCK‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ fbcode_target(
110110
"vgf/model_converter.py",
111111
"vgf/quantization_quality.py",
112112
"vgf/quantization_assessment.py",
113+
"vgf/quantization_sensitivity.py",
113114
"vgf/quantization_visualization.py",
114115
"vgf/partitioner.py",
115116
"vgf/shaders/__init__.py",

0 commit comments

Comments
 (0)