Glibc Math Code Sees 4x Improvement On AMD Zen By Changing FMA Implementation
([GNU] 5 Hours Ago
Glibc)
- Reference: 0001594095
- News link: https://www.phoronix.com/news/Glibc-4x-FMA-Improvement-Zen
- Source link:
Merged this week to the GNU C Library "glibc" code is dropping the ldbl-96 FMA implementation from this library as in doing so they found a 4x improvement to throughput and latency on AMD Zen 3 hardware.
Replacing Glibc's long double implementation using 96-bit precision for internal calculations with the 64-bit double FMA implementation ended up netting a nice win for this widely-used libc implementation.
On "recent x86 hardware" the ldbl-64 implementation far outpaces the ldbl-96 code that has been removed from Glibc Git. In x86_64 benchmarks the throughput on AMD Zen 3 testing was 4.06x and for latency was also a 4.00x improvement. For i686 mode it was still a hefty 2.2~2.3x improvement.
The change to drop the ldbl-96 FMA implementation from Glibc's math code happened with [1]this commit now in Glibc Git.
This will in turn be released with Glibc 2.43 due for release in February. Glibc 2.43 also is bringing [2]detection for newer CPUs , [3]the MSEAL function , and other performance optimizations.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=42f07a44ef88e0c9ff1bd5343786013272467414
[2] https://www.phoronix.com/news/Glibc-Nova-Lake-Wildcat-Lake
[3] https://www.phoronix.com/news/Glibc-Linux-mseal-Function
Replacing Glibc's long double implementation using 96-bit precision for internal calculations with the 64-bit double FMA implementation ended up netting a nice win for this widely-used libc implementation.
On "recent x86 hardware" the ldbl-64 implementation far outpaces the ldbl-96 code that has been removed from Glibc Git. In x86_64 benchmarks the throughput on AMD Zen 3 testing was 4.06x and for latency was also a 4.00x improvement. For i686 mode it was still a hefty 2.2~2.3x improvement.
The change to drop the ldbl-96 FMA implementation from Glibc's math code happened with [1]this commit now in Glibc Git.
This will in turn be released with Glibc 2.43 due for release in February. Glibc 2.43 also is bringing [2]detection for newer CPUs , [3]the MSEAL function , and other performance optimizations.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=42f07a44ef88e0c9ff1bd5343786013272467414
[2] https://www.phoronix.com/news/Glibc-Nova-Lake-Wildcat-Lake
[3] https://www.phoronix.com/news/Glibc-Linux-mseal-Function