简体   繁体   English

从 CPU 时间近似处理能力

[英]Approximating Processing Power from CPU-Time

In a particular scenario I found that a code has taken 20 CPU Years and 4 real Months time.在一个特定的场景中,我发现一个代码花费了 20 个CPU 年和 4 个实际月的时间。 My goal is to approximate the amount of processing power utilized considering the fact that all the processors were on 100% usage all the time.考虑到所有处理器始终处于 100% 的使用率这一事实,我的目标是估算使用的处理能力。 So, my approach is as follows,所以,我的方法如下,

20 CPU Years = 20 * 365 * 24 CPU Hours = 175,200 CPU Hours. 20 个 CPU 年 = 20 * 365 * 24 个 CPU 小时 = 175,200 个 CPU 小时。

Now, 1 CPU Year means 1 GFLOP machine working for 1 real Hour.现在,1 个 CPU 年意味着 1 个 GFLOP 机器工作 1 小时。 Which means, in this case, the work done is, 1 GFLOP machine working for 175,200 real Hours.这意味着,在这种情况下,完成的工作是 1 GFLOP 机器工作 175,200 实际小时。 But in reality it took 4 * 30 * 24 = 2,880 real hours.但实际上需要 4 * 30 * 24 = 2,880 个实际小时。 So, approximately 175,200/2,880 =(approx.) 61 GLFOP machine.因此,大约 175,200/2,880 =(大约)61 GLFOP 机器。

My question is am I doing the approximation correctly or misunderstanding some particular term as per the calculations given above ?我的问题是,根据上面给出的计算,我是否正确地进行了近似或误解了某些特定术语? Or I am mixing GFLOPS and GFLOP together ?或者我将 GFLOPS 和 GFLOP 混合在一起?

Definitions 定义

My question is am I doing the approximation correctly or misunderstanding some particular term as per the calculations given above ?我的问题是,根据上面给出的计算,我是否正确地进行了近似或误解了某些特定术语?

"100% usage" may mean the CPU spent 20% of its time doing nothing waiting for data to be transferred to/from RAM (and/or branch mispredictions or other stalls), 10% of its time running faster than normal because other CPUs where actually doing nothing, and 15% of its time running slower than normal for power/temperature management reasons; “100% 使用率”可能意味着 CPU 有 20% 的时间无所事事,等待数据传入/传出 RAM(和/或分支预测错误或其他停顿),10% 的时间运行速度比正常情况快,因为其他 CPU实际上什么都不做,并且由于电源/温度管理原因,有 15% 的时间运行速度比正常情况慢; and (depending on where you got that "100% usage" statistic) "100% usage" may be significantly more confusing (eg http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html ).并且(取决于您从何处获得“100% 使用率”统计数据)“100% 使用率”可能会更加混乱(例如http://www.brendangregg.com/blog/2017-08-08/linux-load-averages .html )。

Depending on context;视情况而定; GFLOPS is either "theoretical maximum under perfect conditions that will never occur in practice" (worthless marketing hype); GFLOPS 要么是“在实践中永远不会发生的完美条件下的理论最大值”(毫无价值的营销炒作); or a direct measurement of a specific case that ignores most of the work a CPU did (everything involving integers, all control flow, all data transfer, all memory management, ...)或忽略CPU所做的大部分工作的特定情况的直接测量(所有涉及整数,所有控制流,所有数据传输,所有内存管理,...)

In a particular scenario I found that a code has taken 20 CPU Years and 4 real Months time.在一个特定的场景中,我发现一个代码花费了 20 个 CPU 年和 4 个实际月的时间。 My goal is to approximate the amount of processing power utilized.我的目标是估算使用的处理能力。

From this;由此; you might (or might not) be able to say "most of the work that CPUs did was discarded due to lockless algorithm retries and/or transactions that couldn't be committed; and (partly because the bottleneck was RAM bandwidth and partly because of the way SMT works on this system) it would have been 4 times as fast if half as many CPUs were used."您可能(也可能不会)说“由于无锁算法重试和/或无法提交的事务,CPU 所做的大部分工作都被丢弃了;并且(部分是因为瓶颈是 RAM 带宽,部分是因为SMT 在这个系统上的工作方式)如果使用一半的 CPU,它的速度会提高 4 倍。”

TL;DR: Approximating processor power is just an inconvenient way to obfuscate the (more useful) information that you started with (eg that a specific piece of code running on a specific piece of hardware that was working on a specific piece of data happened to take 4 months of real time). TL; DR:近似处理器能力只是混淆您开始使用的(更有用的)信息的一种不方便的方式(例如,在特定硬件上运行的特定代码片段正在处理特定数据片段需要 4 个月的实时时间)。

Your Calculation :你的计算

Yes;是的; you're mixing GFLOP and GFLOPS (eg GFLOPS = GFLOP per second; and a "1 GFLOP machine" is a computer that can do a billion floating point operations in an infinite amount of time, which is every computer), and the web page you linked to is making the same mistake (eg saying "a 1 GFLOP reference machine" when it should be saying "a 1 GFLOPS reference machine").您正在混合 GFLOP 和 GFLOPS(例如 GFLOPS = GFLOP 每秒;“1 GFLOP 机器”是一台可以在无限时间内执行十亿次浮点运算的计算机,这是每台计算机),以及网页您链接到的是犯了同样的错误(例如,当它应该说“a 1 GFLOPS 参考机”时说“a 1 GFLOP 参考机”)。

Note that there's no need to care about GFLOPS or GFLOP for the calculation you're doing: If something was supposed to take 20 "reference CPU years" and actually took 4 months (or 4/12 years);请注意,对于您正在执行的计算,无需关心 GFLOPS 或 GFLOP:如果某件事应该花费 20 个“参考 CPU 年”而实际上花费了 4 个月(或 4/12 年); then you'd say that your hardware is equivalent to "20 / (4/12) = 60 reference CPUs".那么您会说您的硬件相当于“20 / (4/12) = 60 个参考 CPU”。 Of course this is horribly silly and it'd make more sense to say that your hardware happened to achieve 60 GFLOPS without bothering with the misleading "reference CPU" nonsense.当然,这是非常愚蠢的,而且说您的硬件碰巧达到了 60 GFLOPS 而不会打扰误导性的“参考 CPU”废话会更有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM