Commit e25cbf1
authored
[bugfix][AWQ] make compute_layer_means not modify weight (#2114)
Summary
_compute_layer_means was making in-place changes to the weights which
made the first iteration (until the weights are refreshed from the
cached versions) useless
flow was
1) cache weight
2) compute mean (modify weight)
3) scale weight
4) calculate loss
4) restore weight, goto 3
so the first run of 3&4 were gibberish
note this bug has been around for a while and we hadn't detected it
because throwing away a single iteration was fine as long as the rest
worked
TEST PLAN: (new unit test)
python tests/llmcompressor/modifiers/awq/test_base.py
---------
Signed-off-by: HDCharles <[email protected]>1 parent 8cfb5ec commit e25cbf1
File tree
2 files changed
+42
-1
lines changed- src/llmcompressor/modifiers/awq
- tests/llmcompressor/modifiers/awq
2 files changed
+42
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
697 | | - | |
| 697 | + | |
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
299 | 340 | | |
300 | 341 | | |
301 | 342 | | |
| |||
0 commit comments