AVX-512: First Impressions on Performance and Programmability
shihab-shahriar.github.io
AVX-512: First Impressions on Performance and Programmability
1–10 of 54 posts
Re: AVX-512: First Impressions on Performance and Programmability
#2Use C as a common platform denominator without crazy optimizations (like tcc). If you need performance, specialize, C gives you the tools to call assembly (or use compiler some intrinsic or even inline assembly).
Complex compiler doing crazy optimizations, in my opinion, is not worth it.
Re: AVX-512: First Impressions on Performance and Programmability
#3The problem is that not all programming languages expose SIMD, and even if they do it is only a portable subset, additionally the kind of skills that are required to be able to use SIMD properly isn't something everyone is confortable doing.
I certainly am not, still managed to get around with MMX and early SSE, can manage shading languages, and that is about it.
Re: AVX-512: First Impressions on Performance and Programmability
#4Not if the data is small and in cache.
> The performant route with AVX-512 would probably include the instruction vpconflictd, but I couldn’t really find any elegant way to use it.
I think the best way to do this is duplicate sum_r and count 16 times, so each pane has a seperate accumulation bucket and there can't be any conflicts. After the loop, you quickly do a sum reduction for each of the 16 buckets.
Re: AVX-512: First Impressions on Performance and Programmability
#5> The answer, if it’s not obvious from my tone already:), is 8%. Not if the data is small and in cache. > The performant route with AVX-512 would probably include the instruction vpconflictd, but I couldn’t really find any elegant way to use it. I think the best way to do this is duplicate sum_r and count 16 times, so each pane has a seperate accumulation bucket and there can't be any conflicts. After the loop, you q…
Re: AVX-512: First Impressions on Performance and Programmability
#6Would be interesting to see if auto vec performs better with that addition.
Re: AVX-512: First Impressions on Performance and Programmability
#7Initial example takes array pointers without the __restrict__ keyword/extension so compiler might assume they could be aliased to same address space and will code defensively. Would be interesting to see if auto vec performs better with that addition.
auto aligned_p = std::assume_aligned(p)
Re: AVX-512: First Impressions on Performance and Programmability
#8See also https://www.numberworld.org/blogs/2024_8_7_zen5_avx512_teard...
Re: AVX-512: First Impressions on Performance and Programmability
#9Initial example takes array pointers without the __restrict__ keyword/extension so compiler might assume they could be aliased to same address space and will code defensively. Would be interesting to see if auto vec performs better with that addition.
Also trying to let the compilers know that the float* are aligned would be a good move. auto aligned_p = std::assume_aligned (p)
No reason for the compiler to balk at vectorizing unaligned data these days.
Re: AVX-512: First Impressions on Performance and Programmability
#10> In CPU world there is a desire to shield programmers from those low-level details, but I think there are two interesting forces at play now-a-days that’ll change it soon. On one hand, Dennard Scaling (aka free lunch) is long gone, hardware landscape is getting increasingly fragmented and specialized out of necessity, software abstractions are getting leakier, forcing developers to be aware of the lowest levels of a…