Commit Graph

3 Commits

Author SHA1 Message Date
ecao
fdb04c6a86 Add overflow check for stride calculation (#94900)
Fixes #94120 and #94128.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94900
Approved by: https://github.com/ezyang, https://github.com/jgong5
2023-04-09 01:30:55 +00:00
Rachel030219
70fb673e51 Use software approach to catch overflow ( c10/utils/safe_numerics.h ) on ARM devices (#89042)
Fixes #89040

Pull Request resolved: https://github.com/pytorch/pytorch/pull/89042
Approved by: https://github.com/malfet
2022-11-17 05:55:28 +00:00
Peter Bell
13a3e5c70c Catch overflows in calculating storage byte size
Fixes #73184

In the issue the output tensor's shape is `[2, 4, 536870912, 536870912]` which results in a `numel()` slightly below the point of overflow. When the storage is created it does `numel() * 8` which overflows and a much smaller storage is allocated than required.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/73719
Approved by: https://github.com/ezyang, https://github.com/malfet
2022-03-31 16:16:03 +00:00