4 ms·
Given the extreme complexity of the modern CPU chips and the parallelism of their internal processes, as well as the fact that the “architecture” (the instructi
by Koshkin 4y ago
Given the extreme complexity of the modern CPU chips and the parallelism of their internal processes, as well as the fact that the “architecture” (the instruction set, registers, etc.) is now far removed from how things are done at the hardware level, - does the notion of a “CPU cycle” still make sense?
- alar44 4y agoBy the very definition of having a clock, yes.
- fnordpiglet 4y agoA professor of mine who worked on transactional memory and speculative execution in the Intel processors said the notion of a clock doesn’t generally hold any more. He has a story of when he showed up and asked for a timing diagram and they laughed, one had not been possible for many years at that point. Cycles can take a variable amount of time depending on various non deterministic attributes including speculation and out of order execution under speculation. My understanding is cycle counting degenerates to some normalization of time to make how long instructions take to be generally comparable and stable. But this isn’t my area, so I may just be talking out my ass.
- hnuser123456 4y agoGiven that a constant clock speed is practically a security vulnerability in terms of EM emissions, it's not so surprising that determinism is out the window even at such a low level. Thanks for sharing
- intelVISA 4y agoCurious how that would work with modern pipelines and out of order execution, you could serialize but that would also impact the benchmarks afaik.
- themulticaster 4y agoI think your question is a little too broad to answer precisely, as it depends on your definition of "making sense" - however, CPU cycles are still relevant in many aspects. Generally speaking, just because modern x86 CPUs use numerous abstractions for high-level instruction set features does not mean they don't use cycles. (Clock) cycles are an inherent feature of synchronous logic, and all CPUs (modern as well as ancient) use synchronous logic. Yes, there might be some esoteric outliers, but 99.9% is synchronous. The difference to ancient CPUs is that modern CPUs don't necessarily retire (essentially, "execute") an instruction in every clock cycle. In any given clock cycle, a CPU might retire none, just one or even multiple instructions. A typical application (where clock cycles are important) is looking at the number of retired instructions per cycle (IPC), which can give a rough overview of whether a program is frontend-bound or backend-bound. You can try this yourself using "perf stat" (part of the Linux perf tools): Try running different applications using perf stat and look for "insn per cycle" in the report. You will generally find that interpreted programs (Python, Node etc.) will have a mediocre IPC of well below 1 (due to poor cache utilization and branch mispredictions) while compiled, optimized programs might reach an IPC of 2. A high IPC value is not necessarily better though, it's complicated^TM.