You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Portable div(rounding_mode="trunc") and fmod round int64 values through double #24169
bugmodule: kernelsIssues related to kernel libraries and utilities, and code under kernels/triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
div.out_mode and div.Scalar_mode_out compute the integer quotient with /, then call std::trunc on it, which converts it to double and back. fmod.Tensor_out and fmod.Scalar_out switch every integer compute type to Double and use std::fmod. Integer division already truncates, and % gives the fmod result directly, so neither needs a double.
I'll open a PR that skips std::trunc for integer types and computes integer fmod with %.
Versions
executorch 1.5.1 (kernels/portable/cpu/op_div.cpp and op_fmod.cpp are the same on main at 5b14a2f), torch 2.14.1+cpu, Python 3.12, Linux x86_64 (WSL2).
bugmodule: kernelsIssues related to kernel libraries and utilities, and code under kernels/triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Activity
Keep int64 precision in portable div trunc mode and fmod (pytorch#24170)
Cadence: keep int64 precision in div trunc mode and HiFi fmod (pytorc…
Cadence: keep int64 precision in div trunc mode and HiFi fmod (#24349)