Repository navigation
Commit fd4cccf
authored
Keep the FACTO pow exponent representable in float32 (pytorch#24179)
Summary:
`pow.Tensor_Scalar`'s `exponent` fell into `facto_testcase_gen`'s generic scalar branch, `Gt(0)` and `Le(2)`. The open lower bound makes `nextup(0) = 5e-324` an edge value. That value flushes to 0 when a float32 kernel reads it, so `0 ** 5e-324` (0 in eager, computed with a double exponent) becomes `0 ** 0 = 1` on device. The exponent now gets its own lower bound of `torch.finfo(torch.float32).tiny`. Integer exponents are unchanged (≥ 1), and the upper bound stays 2.
Authored with Claude Code.
Reviewed By: DrJessop
Differential Revision: D127746756
Pull Request resolved: pytorch#241791 parent c1caad6 commit fd4cccf
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
521 | 532 | | |
522 | 533 | | |
523 | 534 | | |
| |||
0 commit comments