Re: AVX-512 for LAME: code to try, if you have the hardware

Alexander Leidinger via Lame-dev <[email protected]> Mon, 27 Jul 2026 09:10:35 +0200
Newsgroups gmane.comp.audio.mp3.lame
Organization No organization, this is a private message.
Message-ID <[email protected]>
Am 2026-07-26 15:32, schrieb Elio Blanca via Lame-dev:
> Il giorno Sun, 26 Jul 2026 15:24:42 +0200
> Alexander Leidinger via Lame-dev <[email protected]> ha
> scritto:
> 
>> In case someone has an Intel CPU with AVX-512, it would be
>> interesting to see the numbers there, it seems to have a 512bit
>> datapath.
> 
> Hello all,
> 
> here an almost-complete run on and Intel Core i5:
...
> [cut]
> 
> Stage 1
> 
> heading messages during encode:
> 
> $ ./frontend/lame -V2 audio_10m.wav a.mp3
> LAME 4.1 (alpha 0, Jul 26 2026 14:42:26) 64bits
> (https://lame.sourceforge.io) warning: alpha versions should be used
> for testing only CPU features: MMX, SSE, SSE2, AVX2, AVX-512
> vector routines: AVX-512                <----- AVX-512 !!!
> Using polyphase lowpass filter, transition band: 18671 Hz - 19205 Hz
> Encoding audio_10m.wav to a.mp3
> [cut]

Great! Thanks!

The variation of the numbers was a bit too much. Based on the CPU, I 
assume this is a laptop. There could be some heat-trottling involved. 
Please make sure nothing else is using the system during the test.

Ice Lake reduces clock frequency for 512-bit work, so a real win on your 
part would be a win against a headwind.

What this is supposed to determine is if the AVX-512 code for CBR is a 
win on Intel CPUs only.

Would it be possible for you to install the hyperfine tool (apt install 
hyperfine) and run:
hyperfine --warmup 1 --runs 25 --style basic \
   -n avx512 './frontend/lame -b 320 IN.wav /dev/null' \
   -n avx2   './frontend/lame -b 320 --noasm avx512 IN.wav /dev/null'
with IN.wav 16-bit stereo 44.1 kHz, and the laptop connected with the 
power-cord?

Bye,
Alexander.

-- 
http://www.Leidinger.net [email protected]: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    [email protected]  : PGP 0x8F31830F9F2772BF