Commit ac4657a
authored
Upcast gradually when computing variance (#4283)
Going all the way to f64 is undesirable, especially for low-precision
tensors in bf16 or f8 variants. Upcast only to the next type, e.g.,
bf16->f32 or f8->bf16. This is consistent with what Pytorch seems to be
doing internally.
Signed-off-by: Alex Zinenko <[email protected]>1 parent e03f7c6 commit ac4657a
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9465 | 9465 | | |
9466 | 9466 | | |
9467 | 9467 | | |
9468 | | - | |
9469 | | - | |
9470 | | - | |
| 9468 | + | |
| 9469 | + | |
| 9470 | + | |
| 9471 | + | |
| 9472 | + | |
| 9473 | + | |
| 9474 | + | |
| 9475 | + | |
| 9476 | + | |
9471 | 9477 | | |
9472 | 9478 | | |
9473 | 9479 | | |
| |||
0 commit comments