Repository navigation
Fix FP32 log IEEE-754 handling in NEON and SVE - #1326
harshith-roy wants to merge 2 commits into
Conversation
Signed-off-by: Jenkins <bsgcomp@arm.com>
Independent validation on physical Apple Silicon (NEON)Thanks for the upstream fix, @harshith-roy. I tested PR #1326 on a physical Apple M5 (macOS 27.2, Apple clang 21.0.0), comparing the unmodified v53.3.1 implementation ( Correctness
Performance — FP32 Log, 1M elements
The patch restores correctness in the tested cases, but the performance regression is significant, particularly for the single-threaded workload. It would be worth investigating whether the special-value handling can be optimized further before merging. Two review findings
Scope: All execution testing was native NEON on Apple Silicon. SVE was not executed on physical hardware. Overall, I can confirm the reported NEON correctness improvement on physical hardware, with the performance regression and Darwin test portability issue noted above. Thanks again for working on this upstream! |
morgolock
left a comment
There was a problem hiding this comment.
Please address these before merging:
-
Reduce the NEON log performance regression. In a native Arm microbenchmark (GCC 11.5.0,
-O3, one core, 1,048,576 positive normal FP32 inputs),vlogq_f32takes 2,271 us versus 619 us for the legacy helper: 3.7x slower. The new localstatic constdeclarations inNEMath.inlintroduce twelve initialization-guard checks per vector call. Replacing those declarations withconstreduced the slowdown to 2.4x in an isolated experiment, so please also optimize the ordinary-input path while retaining the exceptional-value handling. These timings measure the helper, not an end-to-end model. -
Drop the unrelated release commit
ff4646a968. It changes the library version/SONAME from 38.0.0 to 53.3.1 and updates release metadata inSConscript,CMakeLists.txt,README.md, anddocs/Doxyfile. These changes should not be part of this fix. -
Fix the submission checks. Keep the fix as a single commit, use the required commit-message format, and add the missing
Signed-off-by:line. The precommit and squash checks currently fail.
The numerical checks passed: 44 log tests and 755 activation tests on native Arm with SVE128, plus all 8,388,607 positive FP32 subnormal inputs through each of the NEON and SVE log helpers.
Summary
This change improves IEEE-754 exceptional-value handling and subnormal accuracy in the NEON and SVE FP32 logarithm implementations.
It also fixes an FP16 SOFT_RELU overflow regression exposed by the corrected logarithm behavior.
Changes
Validation
Validated using AArch64 cross-compilation and QEMU user-mode emulation.
Both NEON and SVE builds passed with warnings treated as errors.
Note: Runtime validation was performed under QEMU, not physical ARM hardware.