Logocpp-vs-torch
[Data Museum]GitHub

A9. The Mystery of Erratic Times

System Dive: OS Jitter, Thermal Throttling, and P-Core Migrations

Read the full raw markdown report on GitHub ↗

The Detective Work

During the execution of the 100-epoch training benchmark on the Intel i7-12700H, I noticed massive, inexplicable spikes in epoch execution times. A matrix multiplication that normally takes 0.23 seconds would suddenly jump to 0.50 seconds or even 0.85 seconds.

This is the harsh reality of modern hardware. The OS and the CPU Microcontroller are constantly fighting you. Let's analyze the trace of these 100 epochs.

The Three Culprits

  • Thermal Throttling (PL1): Around epoch 20, the CPU package hits 100°C. The Intel hardware automatically downclocks the cores from 4.7GHz to 2.3GHz (Power Limit 1 state) to prevent physical melting. Execution time doubles.
  • E-Core Migrations: At epoch 50, the Linux kernel scheduler decides my heavy AVX2 math thread has been running too long on a Performance Core. It migrates the thread to an Efficiency Core, which lacks the massive L2 cache and high clock speeds. Execution time quadruples until the thread is migrated back.
  • OS Jitter / Denormal Floats: Random, smaller spikes occur due to OS interrupts or when the neural network encounters tiny floating-point numbers near zero (denormals). The CPU handles denormals in microcode rather than hardware, incurring a 100x cycle penalty.