At the start of 2018, the internet learned of two new serious exploits affecting major processor vendors, dubbed Meltdown and Spectre. These exploits are bugs in processors’ speculative execution that allows an attacker to read (and potentially exectute) memory locations outside of their respective process, meaning that programs could read sensitive data in other software’s memory.

In order to fix the bug, the Linux kernel merged a patch known as KAISER or PTI (page table isolation), which effectively fixes the Meltdown attack. However, this patch induces a hit to performance, with people reporting anywhere from a 5% to 35% reduction in CPU performance across the board (and some synthetic benchmarks even showing >50% performance drops).

However, the PTI performance issues are very largely dependent on the task at hand — it’s possible such large drops are only present in synthetic benchmarks such as FSMark. So the question is: what performance hit will we see in machine learning applications?

The Setup

In order to compare performance with and without PTI, I setup a fresh Ubuntu 16.04 machine with intel microcode installed, and compared the latest kernel installed automatically on Ubuntu 16.04 (4.10.0–42-generic) with the latest mainline kernel release (4.15.0–041500rc6-generic) which has the PTI patch. I used Anaconda with Python 3.6 (and extra packages from pip) to perform the testing.

The rig I used for testing included a Intel Core i7–5820K (Haswell-E, stock clocks) and 64GB of DDR4 @ 2400MHz. If people are interested, I can get my hands on more Intel CPUs to test across a wider range of generations. It’s worth noting that AMD processors do not have the PTI patch enabled, as they are immune to the Meltdown attack — so no performance hit should be expected if you’re on AMD 🙂.