Commit 59b88bf
committed
fix: use update_deferred_stats for all observer types
MemorylessMinMaxObserver has no past_min_vals, so get_accumulated_min_max()
always returned None, causing scale to remain 0.
Fix: add update_deferred_stats() to Observer base class which maintains
_deferred_min/_deferred_max independently of subclass implementation.
calibrate_activations(stats_only=True) now calls this instead of observer(value).
Local validation on opt-125m (CPU, 32 calibration samples):
- 72/72 modules have input_scale
- Perplexity: 28.86 (FP32) -> 30.78 (INT8), 6.7% degradation
- No observer stats leaked after calibration1 parent 49e7208 commit 59b88bf
File tree
2 files changed
+39
-14
lines changed- src/llmcompressor
- modifiers/quantization
- observers
2 files changed
+39
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | | - | |
198 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
199 | 206 | | |
200 | 207 | | |
201 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
77 | 97 | | |
78 | 98 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 99 | + | |
| 100 | + | |
82 | 101 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 102 | + | |
86 | 103 | | |
87 | 104 | | |
88 | 105 | | |
89 | | - | |
90 | | - | |
| 106 | + | |
| 107 | + | |
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
94 | 111 | | |
95 | 112 | | |
96 | 113 | | |
97 | 114 | | |
98 | | - | |
99 | | - | |
| 115 | + | |
100 | 116 | | |
101 | 117 | | |
| 118 | + | |
| 119 | + | |
102 | 120 | | |
103 | 121 | | |
104 | 122 | | |
| |||
0 commit comments