Re: AVX-512 for LAME: code to try, if you have the hardware
Elio Blanca via Lame-dev <[email protected]> Sun, 26 Jul 2026 15:32:31 +0200
| Newsgroups | gmane.comp.audio.mp3.lame |
|---|---|
| Message-ID | <20260726153231.3218e145@faye> |
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: $ gcc --version gcc (Debian 14.2.0-19) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ uname -a Linux faye 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64 GNU/Linux $ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 126 model name : Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz stepping : 5 microcode : 0xcc cpu MHz : 400.000 cache size : 6144 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 27 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust sgx bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid sgx_lc fsrm md_clear flush_l1d arch_capabilities vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple pml ept_mode_based_exec tsc_scaling bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit srbds mmio_stale_data retbleed eibrs_pbrsb gds bhi its its_native_only bogomips : 2380.80 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: [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] then [...] ============================================================================ Testsuite summary for lame 4.1 ============================================================================ # TOTAL: 13 # PASS: 13 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ -V2 & -V2 --noasm avx512 Result: IDENTICAL -b 320 & -b 320 --noasm avx512 Result: IDENTICAL -V2 real 0m7,516s user 0m7,490s sys 0m0,029s real 0m7,511s user 0m7,470s sys 0m0,045s real 0m7,618s user 0m7,588s sys 0m0,031s -V2 --noasm avx512 real 0m7,551s user 0m7,512s sys 0m0,042s real 0m7,696s user 0m7,665s sys 0m0,036s real 0m7,547s user 0m7,520s sys 0m0,032s -b 320 real 0m11,793s user 0m11,773s sys 0m0,023s real 0m11,679s user 0m11,645s sys 0m0,037s real 0m11,726s user 0m11,693s sys 0m0,036s -b 320 --noasm avx512 real 0m13,003s user 0m12,972s sys 0m0,032s real 0m12,416s user 0m12,381s sys 0m0,039s real 0m12,672s user 0m12,643s sys 0m0,033s STAGE 2 [...] PASS: test_quantize_lines_vector FAIL: test_calc_sfb_noise_vector ============================================================================ Testsuite summary for lame 4.1 ============================================================================ # TOTAL: 13 # PASS: 12 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 ============================================================================ See test/unit/test-suite.log Please report to [email protected] ============================================================================ [contents of test/unit/test-suite.log later on...] -V2 & -V2 --noasm avx512 Result: IDENTICAL -b 320 & -b 320 --noasm avx512 Result: IDENTICAL -V2 real 0m7,990s user 0m7,969s sys 0m0,025s real 0m7,917s user 0m7,887s sys 0m0,034s real 0m7,984s user 0m7,943s sys 0m0,044s -V2 --noasm avx512 real 0m7,422s user 0m7,387s sys 0m0,039s real 0m7,627s user 0m7,588s sys 0m0,042s real 0m7,614s user 0m7,587s sys 0m0,030s -b 320 real 0m11,917s user 0m11,889s sys 0m0,032s real 0m11,746s user 0m11,704s sys 0m0,045s real 0m11,845s user 0m11,794s sys 0m0,055s -b 320 --noasm avx512 real 0m12,533s user 0m12,463s sys 0m0,070s real 0m12,471s user 0m12,429s sys 0m0,044s real 0m12,542s user 0m12,504s sys 0m0,040s $ cat test/unit/test-suite.log ======================================== lame 4.1: test/unit/test-suite.log ======================================== # TOTAL: 13 # PASS: 12 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 FAIL: test_calc_sfb_noise_vector ================================ [==========] tests: Running 5 test(s). [ RUN ] test_lengths [ OK ] test_lengths [ RUN ] test_index_boundaries [ OK ] test_index_boundaries [ RUN ] test_all_zero [ OK ] test_all_zero [ RUN ] test_reference_can_disagree [ OK ] test_reference_can_disagree [ RUN ] test_matches_sse2_exactly [ ERROR ] --- a == b [ LINE ] --- test_calc_sfb_noise_vector.c:253: error: Failure! [ FAILED ] test_matches_sse2_exactly [==========] tests: 5 test(s) run. [ PASSED ] 4 test(s). [ FAILED ] tests: 1 test(s), listed below: [ FAILED ] test_matches_sse2_exactly 1 FAILED TEST(S) FAIL test_calc_sfb_noise_vector (exit status: 1) Hope this can be useful! Elio