Commit 0de13f3
Fix sign-extension bug in fbgemm MX4 Python reference dequantize (#5706)
Summary:
X-link: facebookresearch/FBGEMM#2643
py_dequantize_mx4 viewed packed data as int8 and subtracted
FP32_EXP_BIAS directly. For biased exponents >= 128, the int8 value
is negative, producing incorrect results. Fix by viewing as uint8
then casting to int32 before subtracting the bias.
Same class of bug as D101680517 and the Triton kernel fix.
GH PR: #5706
Reviewed By: q10
Differential Revision: D1021959111 parent 91bf688 commit 0de13f3
2 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
| 258 | + | |
258 | 259 | | |
259 | | - | |
| 260 | + | |
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
463 | 489 | | |
464 | 490 | | |
465 | 491 | | |
0 commit comments