News for hackers. Stuff that matters.
Re:AVX-512, what’s useful for us by pkaye on Friday December 22, 2017 @02:12PM (#15990069)
I changed some Golang code to AVX in my last project. In isolation that code ran like 2-4x faster but as part of the full program, the program was 5% slower overall. Could never make a sense of it. Any thoughts on how to determine the cause?
Re:AVX-512, what’s useful for us by mscrivo on Friday December 22, 2017 @02:29PM (#15990178)
AVX code is known to make the CPU run way hotter than usual. Perhaps that caused throttling that made general code running at the same time, or within a short span thereafter, perform worse?
Re:AVX-512, what’s useful for us by pkaye on Friday December 22, 2017 @02:37PM (#15990244)
That is one theory I had but i'm not sure how to determine if CPU is throttling (on Ubuntu Linux.)
Re:AVX-512, what’s useful for us by thecompilr on Friday December 22, 2017 @05:16PM (#15991366)
You can either use lscpu, which is less accurate, or the best way is to check:

cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq

where instead of cpu0 you can write any core number, and it will give you the current frequency of that core in KHz.

Re:AVX-512, what’s useful for us by pkaye on Friday December 22, 2017 @06:15PM (#15991688)
I'll try that out. Thanks.
Re:AVX-512, what’s useful for us by lathiat on Saturday December 23, 2017 @12:59AM (#15993122)
Note that with pstate /proc/cpuinfo is not reflective (not suggested here but, in the past, the MHz used to change to reflect the scaling speed). You could also look at 'powertop'
Re:AVX-512, what’s useful for us by dpayne on Saturday December 23, 2017 @01:23AM (#15993171)
One way I've found to isolate this is to turn off turbo boost and underclock the cpu, while making sure the avx offset is set to 100%. While you would never want to run a production system like this, it does help to eliminate any issues with cpu throttling. If the avx-512 version of the program still runs slower then something else is interfering besides cpu throttling.
Re:AVX-512, what’s useful for us by jsheard on Friday December 22, 2017 @02:36PM (#15990233)
Did you remember to put a vzeroupper instruction at the end of your AVX functions? If not then you pay a performance penalty when transitioning from AVX to SSE code, and the rest of your program might be inadvertently touching SSE code hidden inside the Go runtime.
Re:AVX-512, what’s useful for us by pkaye on Friday December 22, 2017 @02:38PM (#15990245)
Yes I already do that.
Re:AVX-512, what’s useful for us by sathvikl on Friday December 22, 2017 @08:47PM (#15992433)
Running AVX-512 on all cores will lower all core operating frequency, in order to maintain the TDP of the processor.

When you run it in isolation, there's more headroom since only one core can run at the higher freq. and use AVX512 registers.

Also the power license ensures the cores running AVX512 code runs at a lower frequency.

Make sure to guard your AVX512 code block with VZEROUPPER when exiting it

Re:AVX-512, what’s useful for us by crististm on Saturday December 23, 2017 @04:58AM (#15993615)
cache invalidation may be a reason