HyperThreading/SMT是一个有缺陷的概念吗? [英] Is HyperThreading / SMT a flawed concept?

查看:256
本文介绍了HyperThreading/SMT是一个有缺陷的概念吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HT/SMT背后的主要思想是,当一个线程停止运行时,同一内核上的另一个线程可以选择该内核的其余空闲时间并透明地运行它.

The primary idea behind HT/SMT was that when one thread stalls, another thread on the same core can co-opt the rest of that core's idle time and run with it, transparently.

2013年,英特尔放弃了SMT,转而采用乱序执行 Silvermont处理器内核,因为他们发现这样做可以提供更好的性能 性能.

In 2013 Intel dropped SMT in favor of out-of-order execution for its Silvermont processor cores, as they found this gave better performance.

ARM不再支持SMT(出于能源原因). AMD从未支持过它.在野外,我们仍然有支持它的各种处理器.

ARM no longer support SMT (for energy reasons). AMD never supported it. In the wild, we still have various processors that support it.

从我的角度来看,如果构建数据和算法是为了不惜一切代价避免高速缓存未命中和随后的处理停顿,那么在多核系统中,超线程无疑是一个冗余因素吗?尽管我意识到由于两个HyperThreads的分立硬件存在于同一物理内核中,所以上下文切换的开销很低,但我看不到这比根本没有上下文切换要好.

From my perspective, if data and algorithms are built to avoid cache misses and subsequent processing stalls at all costs, surely HT is a redundant factor in multi-core systems? While I appreciate that there is low overhead to the context-switching involved since the two HyperThreads' discrete hardware exists within the same physical core, I cannot see that this is better than no context switching at all.

我建议对HyperThreading的任何需求都指向有缺陷的软件设计.我在这里有什么想念的吗?

I'm suggesting that any need for HyperThreading points to flawed software design. Is there anything I am missing here?

推荐答案

超线程是否有帮助,以及在多大程度上取决于线程在做什么.这不仅仅是在一个线程中完成工作,而另一个线程在等待I/O或高速缓存未命中-尽管这是基本原理的重要组成部分.它是关于有效地使用CPU资源来增加系统总吞吐量.假设您有两个线程

Whether hyper-threading helps and by how much very much depends on what the threads are doing. It isn't just about doing work in one thread while the other thread waits on I/O or a cache miss - although that is a big part of the rationale. It is about efficiently using the CPU resources to increase total system throughput. Suppose you have two threads

  1. 一个人有很多数据缓存未命中(空间局部性差)并且不使用浮点数,较差的空间局部性不一定是因为程序员做得不好,某些工作负载是固有的.
  2. 另一个线程正在从内存中传输数据并进行浮点计算

使用超线程,这两个线程可以共享同一CPU,一个线程正在执行整数运算并导致高速缓存未命中和停顿,另一个线程正在使用浮点单元,并且数据预取器可以很好地预测内存中的顺序数据.系统吞吐量要比操作系统将两个线程同时安排在同一CPU内核上要好.

With hyper-threading these two threads can share the same CPU, one is doing integer operations and getting cache misses and stalling, the other is using the floating point unit and the data prefetcher is well ahead anticipating the sequential data from memory. The system throughput is better than if the O/S alternatively scheduled both threads on the same CPU core.

英特尔选择不在Silvermont中包括超线程,但这并不意味着它将在高端Xeon服务器处理器甚至是针对笔记本电脑的处理器中取消使用超线程.选择处理器的微体系结构需要权衡取舍,有很多注意事项:

Intel chose not to include hyper-threading in Silvermont, but that doesn't mean it will do away with it in high end Xeon server processors, or even in processors targeted at laptops. Choosing the micro-architecture for a processor involves trade-offs, there are many considerations:

  1. 目标市场是什么(将运行哪种应用程序)?
  2. 目标晶体管技术是什么?
  3. 绩效目标是什么?
  4. 什么是电力预算?
  5. 目标裸片尺寸是多少(影响产量)?
  6. 公司的未来产品在价格/性能方面适合什么地方?
  7. 目标发布日期是什么?
  8. 有多少资源可用于实施和验证设计?添加微体系结构功能会增加非线性的复杂性,与其他功能之间存在细微的交互作用,目标是在第一个磁带"之前识别出尽可能多的错误,以最大程度地减少必须执行的步骤"工作芯片.

Silvermont的每个内核的芯片尺寸预算和功率预算排除了乱序执行和超线程的情况,而乱序执行可提供更好的单线程性能. 这里是Anandtech的评估 :

Silvermont's die size budget per core and power budget precluded having both out-of-order execution and hyperthreading, and out-of-order execution gives better single threaded performance. Here's Anandtech's assessment:

如果我不得不用Silvermont描述英特尔的设计理念,那将是明智的扩展.我们已经从Apple的Swift到高通的Krait 200到Krait 300的过渡看到了这一点.记住最初的Atom所采用的设计规则:性能每提高2%,Atom架构师最多最多可以将功率提高1%.换句话说,性能可以提高,但每瓦性能不能降低. Silvermont保留了这种设计理念,我想我对此有一些了解.

If I had to describe Intel’s design philosophy with Silvermont it would be sensible scaling. We’ve seen this from Apple with Swift, and from Qualcomm with the Krait 200 to Krait 300 transition. Remember the design rule put in place back with the original Atom: for every 2% increase in performance, the Atom architects could at most increase power by 1%. In other words, performance can go up, but performance per watt cannot go down. Silvermont maintains that design philosophy, and I think I have some idea of how.

以前的Atom版本使用Hyper Threading来充分利用执行资源.超线程具有与之相关的功率损失,但是性能提升足以证明其合理性.在22纳米处,英特尔具有足够的裸片面积(由于晶体管缩放),因此仅添加更多内核即可,而不必依靠HT来获得更好的线程性能,因此超线程技术得以淘汰.然后,英特尔将摆脱超线程技术所节省的能源分配给Silvermont进行无序设计,这反过来又有助于在不使用HT的情况下提高对执行资源的有效利用.事实证明,在22nm处,英特尔用于启用HT的芯片面积与Silvermont的重新排序缓冲区和OoO逻辑大致相同,因此,此举甚至没有面积损失.

Previous versions of Atom used Hyper Threading to get good utilization of execution resources. Hyper Threading had a power penalty associated with it, but the performance uplift was enough to justify it. At 22nm, Intel had enough die area (thanks to transistor scaling) to just add in more cores rather than rely on HT for better threaded performance so Hyper Threading was out. The power savings Intel got from getting rid of Hyper Threading were then allocated to making Silvermont an out-of-order design, which in turn helped drive up efficient use of the execution resources without HT. It turns out that at 22nm the die area Intel would’ve spent on enabling HT was roughly the same as Silvermont’s re-order buffer and OoO logic, so there wasn’t even an area penalty for the move.

这篇关于HyperThreading/SMT是一个有缺陷的概念吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆