-
Notifications
You must be signed in to change notification settings - Fork 771
Use std::isfinite() instead of isfinite() in portable ops. #16340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Use std::isfinite() instead of isfinite() in portable ops. #16340
Conversation
This make it possible to build with a simpler libc and saves some flash space. When moving from NEWLIB_LIBC in ZephyrOS to the default one we saved almost 60 Kb in the flash memory (with a simple add model, larger models/code might save less as more libc stuff are probably used). Signed-off-by: Zingo Andersen <[email protected]> Change-Id: I7e9bee8646a503d109ecc6b6c72365fd8e78becf
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16340
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 1 Unrelated FailureAs of commit b3e30cd with merge base f3fd55c ( NEW FAILURES - The following jobs have failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| } | ||
| } else { | ||
| auto allowed_error = atol + fabs(rtol * b[i]); | ||
| auto actual_error = fabs(a[i] - b[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::fabs for consistency?
mergennachin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you for figuring this out
Summary
This make it possible to build with a simpler libc and saves some flash space. When moving from NEWLIB_LIBC in ZephyrOS to the default one we saved almost 60 Kb in the flash memory (with a simple add model, larger models/code might save less as more libc stuff are probably used).
Test plan
Test by building ExecuTorch from ZephyrOS with and without NEWLIB_LIBC by hand.
cc @freddan80 @per @oscarandersson8218 @digantdesai