3 ms·
The "three observations that aren’t really part of the story" were really interesting and doesn't seem to be fully resolved. Will you be discussing them more in
by fyp 7y ago
The "three observations that aren’t really part of the story" were really interesting and doesn't seem to be fully resolved. Will you be discussing them more in the future post?
- BeeOnRope 7y agoMaybe. This is really a three part answer, since there were three quite-different effects I glossed over. The first one is interesting, but it is also well-covered elsewhere, e.g., [1], [2] and [3]. That said, I have a ton of stuff to say on branch prediction, so I probably will at some point. Those posts are slow going, however. It may never emerge. For the second and third points, I am partly blocked by the fact the effect disappeared or is only intermittently reproducible. I am more interested in the third uninteresting effect than the second. The second thing could be a lot of things, since it shows up when running a python script with results piped to disk. What I've seen in the past is that the "driver" program (driver.py) undergoes some kind of phase change, e.g., suddenly causing a bunch of context switches or allocating/freeing a munch of memory which affects the program under test (despite CPU pinning, since there are shared resources). They are phantoms (but still interesting!). The third one is very interesting to me, because it involves a CPU-bound loop with only L1 hits. It goes to the core of the Skylake uarch and the kind of fine-grained uarch details I'm interested in. However, it disappeared as I was tracking it down. I was getting a mix of 2.07 cycles and 1.57 cycles (slow and fast) running the benchmark repeatedly, trying differnet perf counters and doing the needful to track it down and then suddenly I only got 2.07. A new plot showed "blue" only at ~2.07. So I don't know. I have seen similar things though, and I've tracked down an similar "mode shift" and will post on it soon. Stay tuned. --- [1] https://lemire.me/blog/2019/11/12/unrolling-your-loops-can-improve-branch-prediction/ https://lemire.me/blog/2019/11/12/unrolling-your-loops-can-i... [2] https://lemire.me/blog/2019/10/16/benchmarking-is-hard-processors-learn-to-predict-branches/ https://lemire.me/blog/2019/10/16/benchmarking-is-hard-proce... [3] https://lemire.me/blog/2019/10/15/mispredicted-branches-can-multiply-your-running-times/ https://lemire.me/blog/2019/10/15/mispredicted-branches-can-...