Commit 52d7a1e
committed
[Fix] Disable use_cache during export dummy forward for custom configs
The export step's collect_shared_input_modules() runs a dummy forward pass to
trace shared input modules for resmoothing/requantization. This forward call
hits the same AttributeError as PR #1324 on configs that don't assign
use_cache (e.g., stepfun-ai/Step-3.5-Flash's Step3p5Config):
AttributeError: 'Step3p5Config' object has no attribute 'use_cache'
Wrap the dummy forward with the _disable_use_cache context manager so it
sets/restores config.use_cache around the call, mirroring the calibration
fix from #1324. Covers all callsites since both unified_export_hf and
plugins/vllm_fakequant_hf funnel through collect_shared_input_modules.
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>1 parent 097293b commit 52d7a1e
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
216 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| 224 | + | |
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
| |||
0 commit comments