AVX2 and AVX-512 frequencies for W-2014

By: Travis (travis.downs.delete@this.gmail.com), August 23, 2018 11:25 pm
Room: Moderated Discussions
Jeff S. (fakity.delete@this.fake.com) on August 16, 2018 6:19 am wrote:

> AFAIK, you still have to do a heuristic from the APERF/MPERF register for lack of a direct queryable
> register. See: kernel patch for active MHz calculation Just making the system call might be

Yeah, APERF/MPERF ended up working nicely, I used them in avx-turbo which I used to measure the frequency:

https://github.com/travisdowns/avx-turbo

They are nice because they are free running counters rather than an instantaneous measurement, so you just read them at your endpoints and you get an average of the period automatically.

One tricky thing is that both APERF and MPERF count only "non-halted" cycles, which ends up lumping together two totally different effects: the CPU might be legitimately halted (by the OS) because there is no work to do, or it might be in the middle of running your code but halted internally for some CPU-specific reason. The big one of those even for well-cooled and configured systems is halting due to frequency transitions: I lose 5-10% of cycles on my Skylake laptop in halted states as the CPU cycles between 3500 MHz and 3300 MHz which are the 1 and 2 core turbo speeds. The net effect is often that I would have been better off just to run at 3300 MHz constantly (for performance (barely) and definitely for power).

Tools like turbostat don't show this well: they'll just show you the "Busy MHz" which doesn't include this effect or the "Avg MHz" which is often really low since it includes the time the CPU was idle. If you pin some process to a core and you know it's running 100% of the time then you can use "Avg MHz" as a better measure of the achieved frequency.
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
AVX2 and AVX-512 frequencies for W-2014Travis2018/08/14 08:37 PM
  Should say W-2104 (NT)Travis2018/08/14 08:50 PM
  AVX2 and AVX-512 frequencies for W-2014Adrian2018/08/15 12:17 AM
    AVX2 and AVX-512 frequencies for W-2014Travis2018/08/15 12:52 PM
      AVX2 and AVX-512 frequencies for W-2014Jeff S.2018/08/16 06:19 AM
        AVX2 and AVX-512 frequencies for W-2014Travis2018/08/16 09:09 AM
        AVX2 and AVX-512 frequencies for W-2014Travis2018/08/23 11:25 PM
      AVX2 and AVX-512 frequencies for W-2014Adrian2018/08/16 11:31 PM
        AVX2 and AVX-512 frequencies for W-2014Travis Downs2018/08/17 08:16 AM
          AVX2 and AVX-512 frequencies for W-2014Adrian2018/08/17 10:29 AM
            AVX2 and AVX-512 frequencies for W-2014Travis2018/08/19 11:40 AM
    AVX2 and AVX-512 frequencies for W-2104Travis2018/08/23 10:49 PM
      AVX2 and AVX-512 frequencies for W-2104Adrian2018/08/24 02:32 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell avocado?