YouTube2Text

[CS61C FA20] Lecture 27.4 - Caches IV: Actual CPUs — Transcript

by CS 61C Departmental · 1,794 words · 289 segments · language en · Watch on YouTube

Full transcript

  1. 0:00and welcome back this is it we're at the
  2. 0:03end this is the last lecture of the
  3. 0:05caches series i love this
  4. 0:08let's let's show some pictures of actual
  5. 0:10cpus
  6. 0:11let's see what it looks like so let's
  7. 0:14take a look the early power pc
  8. 0:17so this is a long time ago this is a
  9. 0:19couple generations ago
  10. 0:21we mentioned before that we have
  11. 0:23separate
  12. 0:24l1 caches for instructions of data
  13. 0:27partly because they come from different
  14. 0:29places of memory so why corrupt them so
  15. 0:31how big are they 32 kbytes of
  16. 0:35instructions is data okay and data for
  17. 0:37each instructional data
  18. 0:39i've got an external l2 cache interface
  19. 0:42and the integrated controller and cache
  20. 0:44tags so look at this
  21. 0:46this l2 cache tags just the tags for l2
  22. 0:51are here
  23. 0:52okay here's my data cache this is my l1
  24. 0:55data cache this is my l1 instruction
  25. 0:58cache that's the big one
  26. 1:00and what i've stored is i don't have l2
  27. 1:02on chip but i have the
  28. 1:04tags are on chip so i can do the tag
  29. 1:06comparison really fast
  30. 1:07but that's it by the way here are the
  31. 1:10tags for data there's the tags for my l1
  32. 1:12this is my tags for my l1 and these are
  33. 1:14my tags
  34. 1:15for my l1 instruction so each of these
  35. 1:18related to that guy
  36. 1:19this is the l2 cache tags um
  37. 1:22i've got different units here so we can
  38. 1:23talk about this i've got uh here's maybe
  39. 1:26here's a memory management unit to kind
  40. 1:27of coordinate all this we don't know
  41. 1:28about the tlb for now
  42. 1:30i've got a load store unit an energy
  43. 1:32unit and a floating point unit
  44. 1:33and that lets me in the best case we
  45. 1:36talked about this a little bit of
  46. 1:37pipelining
  47. 1:38super scalar means i can run parallel
  48. 1:40jobs so i can actually have
  49. 1:41three i could have a load store
  50. 1:44situation i can
  51. 1:44integer i'm doing some aou kind of thing
  52. 1:46i'm doing a floating point thing
  53. 1:48all at the same time that was pretty
  54. 1:50cool
  55. 1:51so here is six execution units allow for
  56. 1:54two integer
  57. 1:56and double precision and one double
  58. 1:58precision at exactly the same time in
  59. 1:59terms of my execution units
  60. 2:01that's it this is this is a single core
  61. 2:02this wasn't a multi-core machine back in
  62. 2:04the day
  63. 2:06pentium m this is again early here we go
  64. 2:09same kind of thing here's uh so a
  65. 2:11completely different company that was
  66. 2:13motorola this is intel
  67. 2:14here's my here's my 32 kb of
  68. 2:17instructional and data here
  69. 2:19and anything else i want to say oh look
  70. 2:21this is
  71. 2:23here is my l2 cache
  72. 2:26so not just well here's the tags for l2
  73. 2:29i put
  74. 2:29the ca i put this is on the chip l2 is
  75. 2:32on the chip this is
  76. 2:33l2 there's my l2 there okay here's my l1
  77. 2:37and there's my l1 i love this so that's
  78. 2:39pretty cool and now
  79. 2:41watch what happens as i get to the next
  80. 2:42level
  81. 2:45intel core i7 it's hard to get more
  82. 2:48recent than this
  83. 2:49i've got six cores here's six cores
  84. 2:52okay in that core
  85. 2:56i'm not showing you what
  86. 2:59the cache looks like but rarely
  87. 3:05i'm going to show you something
  88. 3:06interesting each core
  89. 3:08has an l2 on it
  90. 3:12and probably i actually don't know where
  91. 3:15it is i think it's
  92. 3:16usually what happens is you look for the
  93. 3:17things that look all the same see how
  94. 3:19this looks like it's all the same
  95. 3:20housing
  96. 3:21i don't have it in this document so i'm
  97. 3:24not i'm just going to guess
  98. 3:25that i'm looking at here as an area and
  99. 3:28here there's a big area i'm not sure
  100. 3:30this is we can take a look at this
  101. 3:31but this has l1
  102. 3:34and l2 per core we talked about we saw
  103. 3:37that number from when i did under
  104. 3:38the perimeter of that and here's what's
  105. 3:40fun
  106. 3:42i also have on chip this is on chip i
  107. 3:44also have
  108. 3:46a shared l3 across all cores
  109. 3:50so all cores share this l3 which is
  110. 3:53pretty neat
  111. 3:55in conclusion boy bringing it all
  112. 3:57together
  113. 3:59we have talked about caching we spent
  114. 4:01four lectures talking about caching
  115. 4:03in detail i mean this is remarkable and
  116. 4:05caching shows up
  117. 4:06as i mentioned before in one of my first
  118. 4:08lectures caching is a big deal
  119. 4:09caching's a big deal in computer science
  120. 4:11it's one of the big ideas that we've
  121. 4:12contributed to the space
  122. 4:13i don't know if caching it like has an
  123. 4:16example
  124. 4:17abstraction exists in engineering you
  125. 4:19know there's abstraction you hide the
  126. 4:20details of how you
  127. 4:21you know have a shuttle flight or
  128. 4:22something how you build a bridge
  129. 4:24abstraction is there
  130. 4:25i don't know if caching occurs in a
  131. 4:28non-computer engineering computer
  132. 4:30science context if there's an equivalent
  133. 4:32thing
  134. 4:32like that i certainly know that i have
  135. 4:34you know
  136. 4:35any kind of technology where i can make
  137. 4:37a simple copy of something that's there
  138. 4:38but if i don't make
  139. 4:39if it's a physical element i don't know
  140. 4:41if the cat if the idea of a cache
  141. 4:43and a memory hierarchy exists outside of
  142. 4:45a computer engineering computer science
  143. 4:46kind of idea
  144. 4:47but we certainly have software caches
  145. 4:49and caches except everywhere
  146. 4:50file system caches web page caches game
  147. 4:53databases table bases
  148. 4:55phone most recent calls all those things
  149. 4:57are caches
  150. 4:58software memorization software my
  151. 5:00goodness software memorization is a big
  152. 5:02idea is a cache in some sense
  153. 5:04as i'm walking through fibonacci uh why
  154. 5:07don't you just write it down as you're
  155. 5:08seeing it
  156. 5:09and so you're kind of caching it and now
  157. 5:10if i have i seen it recently yes i have
  158. 5:12i forget about the recently part but i
  159. 5:13haven't seen it before yes well grab it
  160. 5:14from my
  161. 5:15cache and my memoization storage same
  162. 5:18idea so that same idea is with caches
  163. 5:21and again the big idea is if something's
  164. 5:23expensive we want to do repeatedly do it
  165. 5:24once and catch the result
  166. 5:26so if i have this computation as being
  167. 5:27really heavy i don't care what it is
  168. 5:29do it once and remember what it is
  169. 5:31that's what it is that's the kind of big
  170. 5:32idea in kind of computing
  171. 5:33but it's also don't go to sacramento
  172. 5:35don't compute it and spend an hour
  173. 5:36computing it if i'm going to ask for it
  174. 5:38twice computer once remember it now i've
  175. 5:39got it for the second time especially if
  176. 5:41it's a function and only and the output
  177. 5:44is only a function of its inputs if it's
  178. 5:45somehow a function of all these other
  179. 5:46state elements i can't cache it because
  180. 5:47it might be different
  181. 5:48but if it's a pure function so i
  182. 5:50remember that for the next time um
  183. 5:52similarly if i have to go to sacramento
  184. 5:54why go to sacramento all the time
  185. 5:55bring it to some local space don't have
  186. 5:57to go to the book i mean imagine the
  187. 5:59world without caches that
  188. 6:01really like dumb and dumber level okay
  189. 6:04i'm gonna write a paper
  190. 6:05i go to the find it look at the thing i
  191. 6:07find the book i get it out i read one
  192. 6:09line of it okay great put it back
  193. 6:10hashtag my paper oh what else did they
  194. 6:12say i have to go get the book again are
  195. 6:14you kidding me that's like going to
  196. 6:15sacramento all the time
  197. 6:16put it on your table that's the cash so
  198. 6:18that library analogy introduced
  199. 6:20you know first or second lecture same
  200. 6:22idea here
  201. 6:23go grab it and have it in a local space
  202. 6:24so it's handy you can use it that's the
  203. 6:26idea
  204. 6:27a ton of knobs holy moly how many knobs
  205. 6:31you have
  206. 6:31how big is your cash overall what's your
  207. 6:34technology behind that
  208. 6:36what's your block size how wide is your
  209. 6:38cash what's your right pilot what's your
  210. 6:39aspect ratio
  211. 6:40once you have your cash is it is it why
  212. 6:42you know fat and thin
  213. 6:44is it short and fat or one big block
  214. 6:47size or is it really small block size
  215. 6:49and now it's really tall and skinny
  216. 6:51what's my right policy right through
  217. 6:52versus right back we talked about that
  218. 6:55what's my associativity what's my knob
  219. 6:57for my
  220. 6:58n my m is it one or is it n
  221. 7:01what's my block replacement policy we
  222. 7:03talked about a couple of policies
  223. 7:05do i have a second level cash do i have
  224. 7:07a third level oh my gosh i mean
  225. 7:09but all that for a cash designer is just
  226. 7:12more
  227. 7:13more freedom more flex more pens of an
  228. 7:16artist
  229. 7:16to draw whatever i want to be able to
  230. 7:18create what i want to optimize for
  231. 7:19whatever usage case i have
  232. 7:21and again there are software usage cases
  233. 7:22there hardware uses caches all these
  234. 7:24things are out there
  235. 7:24for a cache designer which again is not
  236. 7:26always a hardware designer could be a
  237. 7:27software designer thinking about what
  238. 7:28parameters for the cache that you want
  239. 7:31and again what's your metric you're
  240. 7:32trying to think about you have some
  241. 7:34metric as you're having all these knobs
  242. 7:35don't just
  243. 7:36randomly okay i'll randomly set it i'm
  244. 7:37good thanks so much where's the paycheck
  245. 7:39no you
  246. 7:39you go and you kind of try to run it on
  247. 7:41traces you run it on practice things you
  248. 7:42see
  249. 7:43if it's performing and you adjust you
  250. 7:44tweak maybe i'll change the block
  251. 7:45replacement policy
  252. 7:46maybe i'll make it more associative all
  253. 7:48those things are parameters that you can
  254. 7:49play all the things listed here
  255. 7:50are things you can play with as you're
  256. 7:52trying to adjust it for that ever work
  257. 7:53whatever tracers you could be running
  258. 7:54those are simulated traces may not be
  259. 7:56perfect but it'll be a
  260. 7:58show me the example kind of how i'm
  261. 7:59going to be hitting this cache in the
  262. 8:00future
  263. 8:01thinking about that and use that
  264. 8:02performance model to adjust between all
  265. 8:04those choices
  266. 8:05and also factor in your budget factor in
  267. 8:07your technology your budget
  268. 8:08what's there all of a sudden flash comes
  269. 8:10around how am i that factor
  270. 8:12that was really fun watching the
  271. 8:13computer engineering world as flash
  272. 8:15became really
  273. 8:15interesting where that fit in by the way
  274. 8:18your hard drive has a cache
  275. 8:20go look at your hard drive specs there's
  276. 8:21a cache on your hard drive
  277. 8:23because going to disk spinning disk is
  278. 8:25really slow so there'll be a cache on
  279. 8:27your
  280. 8:27hard drive caches are everywhere so
  281. 8:30think about what technology you have the
  282. 8:31space
  283. 8:32based on and think of your cost for your
  284. 8:34particular workload
  285. 8:35that's it thank you so much for coming
  286. 8:37to these cast lectures i really had a
  287. 8:38good time teaching them to you
  288. 8:39and we'll see at the next module take
  289. 8:41care folks

About this transcript

This page contains the full transcript of [CS61C FA20] Lecture 27.4 - Caches IV: Actual CPUs by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,794 words across 289 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.