Are your memory-bound benchmarking timings normally distributed?
1–10 of 50 posts
Re: Are your memory-bound benchmarking timings normally distributed?
#2Statistical fallacies are rampant in performance eval, even in academic settings. When designing statistical tests for performance, the keyword you want to use here is non-parametric. I.e., a U-test is a non-parametric analog to the t-test. It just looks at the rank statistics of results instead of their value, thus eliminating dependence on the underling distribution.
Another issue that pops up is sample independence. Statistical tests are often predicated on each sample being independent and identically distributed (i.i.d.), but in reality this is often not the case. For instance, running all the tests of one group and then all the tests of the other could heat the CPU and cause reduced performance in the second trial.
Re: Are your memory-bound benchmarking timings normally distributed?
#3Re: Are your memory-bound benchmarking timings normally distributed?
#4Great article! Statistical fallacies are rampant in performance eval, even in academic settings. When designing statistical tests for performance, the keyword you want to use here is non-parametric. I.e., a U-test is a non-parametric analog to the t-test. It just looks at the rank statistics of results instead of their value, thus eliminating dependence on the underling distribution. Another issue that pops up is sam…
[1] https://clickhouse.com/blog/testing-the-performance-of-click...
Re: Are your memory-bound benchmarking timings normally distributed?
#5Some of my assumptions about latency were wrong. One thing I didn't realize is it takes about half the latency to main memory to get miss through L1, L2, and L3. Also that you need to have around 2x the memory references pending to keep the memory system busy. It makes sense in retrospect, you want 16 pending memory references to keep 8 memory channels busy, otherwise a memory channel will return a cache line, and there won't be any L3 cache misses pending for that channel.
Generally I like to keep a small histogram of cycle counters to make sure I'm seeing the distribution I expect, seeing an unusual distribution is key for tracking down something you didn't account for.
Re: Are your memory-bound benchmarking timings normally distributed?
#6Re: Are your memory-bound benchmarking timings normally distributed?
#7You might want to check out the gamma distribution. It is also zero-bounded just like the log normal distribution, but it was originally created to model waiting times within queue theory, which is actually an excellent parallel to the idea of measuring compute latency.
Re: Are your memory-bound benchmarking timings normally distributed?
#8I've been writing micro memory benchmarks and have been rather surprised how hard something as simple as quantifying latency and bandwidth under multicore loads can be. The memory hierarchy is getting ever more complex. Cacheline sizes, prefetch, 3 levels of cache, TLB effects, page alignments, cache associativity, etc. Also have to be careful that the compiler doesn't optimize away parts of your code. It's quite tri…
Maybe it could never have been then, but maybe it can be now, or soon.
For instance a borrow checker might be a very good way to help decide how and when to move working memory between processors and main memory. But what do you do with all of the existing C code? I think for backward compatibility you'd need to implement virtual memory at the working memory layer. It wouldn't be the fastest code, but it would work.
Re: Are your memory-bound benchmarking timings normally distributed?
#9A concrete example of this: Exponential backoff where each attempt has a 1/2 probability of succeeding independently of other attempts, and you double the time between each attempt.
If you try to benchmark this process, you'll find that no matter how big your sample size is you'll never get consistent results.
Re: Are your memory-bound benchmarking timings normally distributed?
#10Then I would run the same bench on my laptop and (with turbo disabled) ands its pretty much always consistent.
I can only guess why... turbo on the host cpu? Other transient tenants competing for the same cache? Something to do with VMs? Also I am not sure if AWS has this issue.