Repository navigation
Commit 7f9ccda
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
- test
- misc
- vgf
- examples/arm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
0 commit comments