Minh Bui

Throwback to a writeup a did a long time ago about SMT titled "Simultaneous Multithreading: Is the performance gain enough to justify the hardware complexity?"

For a very long time, large chip manufacturers like AMD and Intel have included simultaneous threading (SMT) on their chips. Intel, more specifically, have been doing it for more than 20 years since the Pentium 4 released in 2002 (in Intel’s lingo - “hyperthreading”). The year is 2024, and after more than 2 decades of using SMT, the 2nd generation Core Ultra (really just 15th generation) a.k.a Lunar Lake will officially abandon SMT. This has left me and many others speculating their reasoning behind doing things.

In this blog post, I would like to discuss the technique of simultaneous multithreading, how it works, why companies have chosen to use it for so long, and, give my speculation as to why Intel has chosen to abandon it now.

To start, I will be referencing and summarizing a paper that goes very much into detail about SMT, and I think will be a great source of information for the reader. The paper is “Simultaneous Multithreading: Maximizing On-Chip Parallelism” - Dean M. Tullsen, Susan J. Eggers, and Henry M. Levy which I will refer to as “the paper” (https://www.princeton.edu/~rblee/ELE572Papers/SMT_Eggers.pdf)

Some concepts that the reader should briefly review are: Pipelining and Superscalar Microarchitectures, Hardware Threads, Issue Width, Concurrency vs. Parallelism

What is Multithreading?
To start, what is a hardware thread?
A simple way of thinking about hardware threads is just a duplication of units necessary to enable the execution of the functional unit. For example, in normal high performance Intel processors, there are usually two threads per core. This means that there are 2 copies of the program counter, regfile, etc… which hold separate “thread context” - or different values of registers and PC that could be run interleaved with each other. Imagine you have a 4-wide issue superscalar, and for the purpose of the discussion assume that you have the best scheduling available (in the paper the authors used the Multiflow trace scheduling compiler, which is state-of-the-art). The best case scenario, you are able to utilize all 4 of your functional units in each cycle. However in reality, 1. There isn’t enough to do every single cycle, creating “vertical waste” and 2. There isn’t enough inherent parallelism to utilize all 4 of your functional units, creating “horizontal waste”. The figure I’ve included from the paper below illustrates this.

What is Simultaneous Multithreading?
“The objective of SM (SMT) is to substantially increase processor utilization in the face of both long memory latencies and limited available parallelism per thread.”
So what is simultaneous multithreading?
To start, I will first discuss the other types of multithreading, being coarse-grain multithreading and fine-grain multithreading. Compared to single-threaded processors, coarse-grain multithreading allows for switching into another thread context on very large stalls, imagine missing the cache on all levels. So this eliminates vertical waste when there is still a period thats determined to be long enough to trigger a switch into another thread.
Fine-grain multithreading is not much different from this, just that we are now switching to another context between misses that are much shorter. This eliminates the vertical waste even more, but as you can imagine the cost for this higher. Imagine 3 vertical slots between executions in coarse grain multithreading, and imagine no vertical slots in the case of fine-grain multithreading.
Then, simultaneous threading eliminates the vertical waste similar to fine-grain multithreading, but now we also have different threads using different units in the same horizontal slot. I think the diagram below shows this very well.

Taken from “POWER5: IBM’s Next Generation POWER Microprocessor”, Ron Kalla (IBM)

In the paper, the authors showed that “even an 8-issue superscalar architecture fails to sustain 1.5 instructions per cycle, and a fine-grain multithreaded processor utilizes only about 40% of a wide superscalar, regardless of number of threads”. They followed by explaining SMT far outperforms these figures, which I will examine later on.

A problem to note though, you could probably imagine, but the complexity added to the architecture is very large, and the paper mainly argues that this added complexity is worth the massive boost to performance.

The simulation setup
To draw conclusions about the performance of various architectures, the authors have created a simulator that uses emulation-based instruction-level simulation. The simulation models an architecture containing execution pipelines and frontend logic based on the Alpha AXP 21164 superscalar processor. Note that they have created a speculation as to how a SMT processor would be implemented, because at this point, no SMT-enabled processor existed. Below are the parameters the authors have used for the instruction latencies and cache hierarchies. They noted that the cache in the model is much larger than that of the Alpha’s due to the increased overhead caused by SMT.

Further details of their simulated architecture can be found in the paper itself. The important thing to know is they used 8 hardware threads for multithreaded experiments, and made no changes to the pipeline, because as they’ve pointed out - “The Alpha devotes a full pipeline stage to arrange instructions for issue and another to issue. If simultaneous multithreading requires more than two pipeline stages for instruction scheduling, the primary effect would be an increase in the misprediction penalty”.
The workload
They used the SPEC92 benchmark suite 10. The single-threaded experiments used the default data set, whereas the multi-threaded experiments composed each data point into B runs, each T*500 million instructions in length, where T is the number of threads. Each of the B runs then use a different ordering of benchmarks. As mentioned before, they used the Multiflow scheduling compiler to avoid overstating any performance gain from having multiple threads.

In the figure below, they showed where the cycle waste went to in different applications in a single-threaded scenario.

The important insight to gain here is that there is not one dominant cause of cycle waste. Therefore the only way to resolve these issues is by using a general solution, that being multithreading. Traditional multithreading (coarse-grain and fine-grain) solves vertical waste, which they note to occupy about 61% of the wasted cycles. However, as traditional multithreading is not able to fill horizontal slots, it converts much of the vertical waste into horizontal waste. Therefore, the only remaining solution to this problem is simultaneous multithreading, where the leftover horizontal waste converted from the vertical waste can be occupied by having different thread contexts use the functional units in the same cycle.

The complexity of multithreading
We have now concluded that a multithreaded machine model eliminates waste much more efficiently. In the following comparisons, the authors compare the implementation complexity of different types of multithreading configurations. To provide a little context about each of the models they are describing:

Then, a table is nicely constructed to summarize the different implementation complexities of the mentioned models.

As you could observe, full simultaneous issue has the best performance, with the trade-off of having the most complex design.
Then below is the comparison between the performance of different schemes of multithreading.


We can see that SMT, although has the highest performance, was the only scheme that could achieve 6 instructions per cycle, which is still not sufficient to fill up the entirety of the issue width, but so far is the design with the most performance.

Cache Design
In the paper, they found that sharing caches between threads actually degraded performance. So using the 4-issue with up to 8-threads model, we will examine the results they aggregated from the simulations. Note that the cache sizes are described as [total I cache size in KB][private or shared].[D cache size][private or shared], for example 64p.64s means that since we have up to 8 threads, there are 8 private instruction caches of size 8KB each, and a shared 64KB data cache between threads.

The graph above shows the performance of various configurations. They have concluded that firstly, a shared data cache outperforms a private one in all number of threads, which could be attributed to the accessing patterns. Secondly, 64p.64s and 64s.64s are both attractive options in this scenario and gives the best performance. However if we had relaxed hardware complexity constraints then a 64KB private Icache will obviously perform better than a 8KB one.

SMT vs. Multiprocessors
Now that we’ve discussed the waste reduction benefits of multithreading, and how out of all types of MT, SMT is the best performing with the trade-off of being the most expensive. We will now examine SMT vs Multiprocessors.

SMT and Multiprocessors are fairly similar, the difference being how instructions are scheduled. In multiprocessors, the scheduler statically assigns functional units among the number of threads. In SMT, the partitioning of resources is allowed to change every cycle.

In the following experiments to compare multiprocessors (referred to as MP) and SMT, the authors used 8KB L1 private instruction and data caches (per thread for SMT and per processor for MP), a 256KB 4-way associative shared L2 cache, and a 2MB direct-mapped shared L3 cache. The table below shows the results for each of the experiments that were performed.

In tests A,B and C, we “compare the performance of the two schemes with an essentially unlimited number of functional units (FUs); i.e., there is a functional unit of each type available to every issue slot”. And we can see that in this case, SMT is able to utilize resources more effectively. In test D, we now limit the number of FUs available to the SMT scheme to only 10, and yet since the resources are divided dynamically, it still outperforms the MP configuration by almost the same amount of test case A. Even when MP has up to four times the issue bandwidth such as in the case of tests E and F, SMT still manages to perform equally as well. Finally in test G, with the same number of FUs and issue bandwidth (MP is limited to 2 cores now because each processor requires 4 FUs), SMT outperforms MP by more than two times.

Conclusion
Then from the summary of the paper I made above, we see that in the cases where it is possible to allocate extra hardware to enable SMT, it is a great choice to increase performance and throughput.
Now to get back to the question of why I think Intel has chosen not to use SMT anymore. This paper does mention hardware complexity that is needed to implement SMT, which is quite a large amount. In addition to this, it wasn’t mentioned but SMT harms single-threaded performance because in the case that there is enough parallelism, there will be contention between the different threads, which leads to a degraded single-thread performance. Therefore, I think that perhaps Intel has chosen a new direction and now believe that it is best to focus on multiprocessor platforms that are single-threaded, which could make sense depending on the necessity of running multiple threads in the common applications. Furthermore, I don’t have the entire picture as at this point Lunar Lake hasn’t been released to the public yet, so I have no knowledge of the particular architectural changes, but the extra area freed (from no more duplicated register sets, etc.) could potentially be used to implement certain accelerators that speeds up the work flow, which could potentially make up for the lack of multithreading.

← All posts