YouTube2Text

[CS61C FA20] Lecture 21.2 - Pipelining I: Processor Performance Iron Law — Transcript

by CS 61C Departmental · 1,457 words · 282 segments · language en · Watch on YouTube

Full transcript

  1. 0:01[Music]
  2. 0:09hello
  3. 0:10welcome back to 61c module on
  4. 0:13the measurement and improvement of
  5. 0:15performance
  6. 0:16through pipelining
  7. 0:19so we get some understanding that there
  8. 0:22are different views of performance
  9. 0:25and one of the main ways how we measure
  10. 0:27the performance is the time that it
  11. 0:29takes to execute a program
  12. 0:31but there are generally very many
  13. 0:34parameters that affect that execution
  14. 0:36time
  15. 0:37they are very difficult to detangle from
  16. 0:40each other
  17. 0:42so we need to break them down down
  18. 0:44somehow
  19. 0:46there is something that we call the iron
  20. 0:49law of processor performance
  21. 0:51that tells us how long does it take to
  22. 0:54execute a program
  23. 0:56based on some of the basic parameters of
  24. 0:59the machine
  25. 1:00and the program that is being executed
  26. 1:03so let's take a look at that in this
  27. 1:06diagram we have time
  28. 1:09that is the takes to execute the program
  29. 1:12simply expanded or this fraction get
  30. 1:16multiplied and divided by the number of
  31. 1:18instructions
  32. 1:19and the number of cycles
  33. 1:24so time to execute the program is equal
  34. 1:27to the number of instructions in the
  35. 1:29program
  36. 1:30the number of cycles per instruction
  37. 1:34and time to execute one cycle
  38. 1:38so this is now a lot easier to break
  39. 1:42down and understand the fundamental
  40. 1:44causes or fundamental parameters that
  41. 1:47affect each of these
  42. 1:50different programs may have
  43. 1:53different number of instructions one of
  44. 1:56the fundamental architectural
  45. 1:58parameters is the number of cycles that
  46. 2:01it takes to complete an instruction
  47. 2:03and finally often
  48. 2:07processor speed is associated with the
  49. 2:09time to
  50. 2:10to execute one cycle or the frequency at
  51. 2:13which processor runs
  52. 2:15but none of these parameters can be
  53. 2:18analyzed alone they all have to be put
  54. 2:22together
  55. 2:22to understand that how long does it take
  56. 2:25to perform a task
  57. 2:27so let's get into that let's analyze
  58. 2:30each one
  59. 2:31of these three basic components number
  60. 2:34of instructions per program
  61. 2:36number of cycles per instruction in time
  62. 2:38to complete a cycle
  63. 2:40to see how they what affects them
  64. 2:43and how do they how can they get
  65. 2:47put together in the end
  66. 2:51so first one how many does it
  67. 2:54how many instructions does it take to
  68. 2:56execute a program
  69. 2:57well it really depends on what kind of a
  70. 2:59task are we
  71. 3:00trying to complete here how is that
  72. 3:04task coded up for example if we are
  73. 3:07trying to perform image compression
  74. 3:10there are um it is very different than
  75. 3:13try a task of trying to play a game of
  76. 3:16go um
  77. 3:18each of these tasks can be implemented
  78. 3:21by using different algorithms
  79. 3:23and these algorithms can have vastly
  80. 3:26different number of instructions that
  81. 3:27they
  82. 3:28need to be executed for example
  83. 3:31things that we have learned in 61a
  84. 3:34whether it depends as of all then
  85. 3:37or of n squared matter a lot here
  86. 3:42then the number of instructions for a
  87. 3:45program
  88. 3:46will greatly depend on the programming
  89. 3:48language some
  90. 3:49higher level programming language will
  91. 3:51have languages will have a very
  92. 3:53compact description of of a task
  93. 3:56but may blow up to very many assembly
  94. 3:59instructions it will be much more
  95. 4:01efficient perhaps to code up this task
  96. 4:03in assembly
  97. 4:05but we have seen that already coding up
  98. 4:08things in assembly is tedious
  99. 4:10and not everybody is willing to do that
  100. 4:13especially not for every task that you
  101. 4:14would like to code up
  102. 4:17that is tightly combined with the
  103. 4:19compiler compiler performance and
  104. 4:21compiler effort
  105. 4:22some compilers are going to generate
  106. 4:26assembly level code that has less
  107. 4:29instructions
  108. 4:30but some other compilers may
  109. 4:33generate more instructions and finally
  110. 4:37it really depends on the isa
  111. 4:39some isas like most of the risks
  112. 4:43will require more assembly level
  113. 4:45instructions than
  114. 4:46cisc type processors
  115. 4:50but this cannot be locked in isolation
  116. 4:53the next metric that is
  117. 4:55really important is the second component
  118. 4:57of our iron law
  119. 4:59which is the average number of clock
  120. 5:02cycles
  121. 5:02that it takes to execute one instruction
  122. 5:06so in some architectures in our
  123. 5:08architecture we always used one
  124. 5:10cycle to execute one instruction but in
  125. 5:11some architectures
  126. 5:13that number or in some implementations
  127. 5:15of the same isa
  128. 5:16that number may vary so the number of
  129. 5:19clock cycles per instruction depends on
  130. 5:22the isa
  131. 5:23but within the isa we can have different
  132. 5:25processor electric
  133. 5:27implementations that have different
  134. 5:30cpi average cpi numbers and if you look
  135. 5:33at different
  136. 5:34you know performance measurements
  137. 5:38you'll find out that different
  138. 5:40processors from intel
  139. 5:41have different cpi's among them
  140. 5:45you know higher class ones versus lower
  141. 5:47class ones
  142. 5:48and then different implementations of
  143. 5:52the x86 architecture
  144. 5:54may have different cpi's between amd and
  145. 5:56intel
  146. 6:00in our case we always used one
  147. 6:05cycle to execute every instruction so
  148. 6:06far but that will change
  149. 6:08um in some cases there will be more
  150. 6:11complex instructions um
  151. 6:12at a higher level language or in the
  152. 6:15assembly language
  153. 6:16in higher language like string copy in
  154. 6:19in
  155. 6:20c is going to take way more than one
  156. 6:23cycle
  157. 6:24to copy a string
  158. 6:27finally we are going to soon see
  159. 6:30so-called superscalar processors
  160. 6:32where that cycle average cycle per
  161. 6:34instruction
  162. 6:35is much less than one meaning that we
  163. 6:37are be simultaneously
  164. 6:39executing multiple instructions in one
  165. 6:41cycle
  166. 6:43finally a third component of our law
  167. 6:46is the time for each cycle
  168. 6:49or how long does it take to complete the
  169. 6:53cycle or one over the frequency of a
  170. 6:54processor
  171. 6:56this is determined by the
  172. 6:57microarchitecture you know
  173. 7:00how many logic gates are
  174. 7:03in our critical path
  175. 7:06but it is not just about counting the
  176. 7:09number of logic gates it is
  177. 7:11relating the delay of each
  178. 7:14logic gates to the technology uh
  179. 7:17an inverter in one technology
  180. 7:20will be a lot faster than an inverter in
  181. 7:24a different technology
  182. 7:26we generally use cmos so inverters in
  183. 7:29five nanometer technologies
  184. 7:30are faster than inverters in 28
  185. 7:33nanometer technologies and much faster
  186. 7:35than inverters than say
  187. 7:3690 nanometer cmos technologies when we
  188. 7:39say
  189. 7:405 nanometers or um
  190. 7:4590 nanometers we refer to the minimum
  191. 7:47features of that technology
  192. 7:48how short generally a
  193. 7:52a gate or a wire can be
  194. 7:55in a particular technology
  195. 7:58and then finally within the same
  196. 8:01technology
  197. 8:01we may have different classes of
  198. 8:04implementations that have different
  199. 8:06power budgets for example we will
  200. 8:09encounter desktop processors that
  201. 8:11run at clock frequencies that are higher
  202. 8:14than four gigahertz but they burn
  203. 8:17in excess of 100 watts on the other hand
  204. 8:20and
  205. 8:20and they have um
  206. 8:23you know so they can run at excess of
  207. 8:27four gigahertz
  208. 8:28on the other hand those processors that
  209. 8:30we'll find in our
  210. 8:31cell phones will be running at two two
  211. 8:34and a half gigahertz
  212. 8:35but they're going to have a lot lower
  213. 8:38power
  214. 8:39and that is going to be largely due
  215. 8:42to the fact that they are often running
  216. 8:44at a lower supply voltage
  217. 8:46lower supply voltage as we'll see in the
  218. 8:49next segment
  219. 8:50saves us energy but makes things run
  220. 8:53slower
  221. 8:55okay let's take a look at the
  222. 8:58speed trade-off example that puts
  223. 9:00together these three components of the
  224. 9:02iron law
  225. 9:03so this tries to illustrate that just
  226. 9:06buying a processor based on clock
  227. 9:09frequency
  228. 9:10may not always matter you may not get
  229. 9:13the best machine for the task so for
  230. 9:16example
  231. 9:17we have one task that you would like to
  232. 9:19implement here which is the image
  233. 9:20compression
  234. 9:21and that image compression on two
  235. 9:24processors because they may be in
  236. 9:25different
  237. 9:26implemented thing different isas or
  238. 9:30may be described in a different
  239. 9:33framework
  240. 9:33can have different number of
  241. 9:35instructions that are needed
  242. 9:37to execute to complete the task to
  243. 9:38compress the image
  244. 9:40so for example in processor a we may
  245. 9:43need
  246. 9:43just one million instructions and
  247. 9:45processor b may need
  248. 9:4650 more may need 1.5 million
  249. 9:49instructions
  250. 9:50now when we look at the average cpi
  251. 9:55processor b may be better because it
  252. 9:57takes only
  253. 9:58one cycle to execute an instruction on
  254. 10:00the average on the other hand
  255. 10:02processor b takes two and a half cycles
  256. 10:04to execute that instruction
  257. 10:06and finally um the clock rate of
  258. 10:10processor a
  259. 10:12may be better may it may run at two and
  260. 10:14a half gigahertz processor b
  261. 10:15may run at two gigahertz so what's the
  262. 10:19what is the total execution time well
  263. 10:21when we multiply all of these together
  264. 10:22we'll find out that processor b
  265. 10:24completes the task faster than the
  266. 10:27processor a
  267. 10:29although it is
  268. 10:32worse in two of its performance metrics
  269. 10:35it takes more
  270. 10:36instructions to complete the task and it
  271. 10:39runs at a slower
  272. 10:41clock rate but it its cpi
  273. 10:44is significantly better and it helps it
  274. 10:47overcome the other disadvantages
  275. 10:51so keep that in mind whenever trying to
  276. 10:56buy for example a processor
  277. 11:00we are going to make a quick break here
  278. 11:02and come back
  279. 11:03and discuss the energy efficiency
  280. 11:05because it also
  281. 11:06affects the performance so see you in a
  282. 11:09bit

About this transcript

This page contains the full transcript of [CS61C FA20] Lecture 21.2 - Pipelining I: Processor Performance Iron Law by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,457 words across 282 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.