[CS61C FA20] Lecture 32.1 - Flynn Taxonomy, SIMD Instructions: Parallelism — Transcript
Full transcript
- 0:00[Music]
- 0:10hey
- 0:11hello long time no see welcome back to
- 0:1461c
- 0:15we are getting into a brand new module
- 0:17this time we are talking about
- 0:19parallelism so we are still continuing
- 0:22our quest to make
- 0:23a better computer and to run our
- 0:27applications faster so we have learned
- 0:29some of the software techniques that are
- 0:31helping us with that but
- 0:33we spend most of the time trying to
- 0:35build a better computer understand the
- 0:36principles how these better computers
- 0:38are built
- 0:39one of those principles is
- 0:43the use of parallelism and we have
- 0:45encountered parallelism
- 0:46already we have encountered
- 0:50multi-programming as a way to better
- 0:51utilize a processor
- 0:54um while it's waiting for data to come
- 0:58from dram we can perform some other
- 1:01tasks
- 1:03we have seen pipelining
- 1:06as a way to increase the performance by
- 1:09having by
- 1:10working on multiple instructions at the
- 1:12same time
- 1:13in in the pipeline and that was the
- 1:16primary way how
- 1:17people tried to increase performance of
- 1:20processors in
- 1:21say the 90s up to early 2000s
- 1:26we kept building deeper and deeper
- 1:28deeper pipelines and simultaneously use
- 1:30that to
- 1:31crank up the clock frequencies
- 1:34but as a result the power kept shooting
- 1:37up
- 1:37in every processor generation and that
- 1:40was not sustainable
- 1:41we had to do something different
- 1:46in order to stay under reasonable power
- 1:49limits
- 1:49people explore the dimension of using
- 1:52parallelism and in this case
- 1:54we are going to take a look at how do we
- 1:58work
- 1:59with parallel data what does that mean
- 2:01simply
- 2:03we often in our applications work
- 2:06with some sorts of vectors and we can
- 2:10perform vector additions in this case
- 2:14in parallel if we have multiple units
- 2:16that are capable
- 2:18of adding multiple multiple
- 2:21elements of a vector at the same time
- 2:25there are many opportunities for for
- 2:27data parallelism out there
- 2:28one of them we have already encountered
- 2:31and it is one
- 2:32of the most popular workloads nowadays
- 2:35which is machine learning and inference
- 2:38in
- 2:38machine learning inference we often
- 2:41start with
- 2:42something and we would like to perform
- 2:45classification
- 2:46in this case you know we can start with
- 2:49an image of a cat and would like
- 2:51to say that's a cat and not a dog the
- 2:54way how we do that
- 2:56is by going through multiple layers of
- 3:00um classification pitch restriction here
- 3:05that in their essence are
- 3:09fairly parallel they could be
- 3:12convolutions
- 3:13matrix of vector multiplications or
- 3:15matrix matrix multiplications and after
- 3:18a sequence
- 3:19of those classification steps we can say
- 3:22that this image
- 3:23that there's a cat in this image and not
- 3:25a dog and
- 3:27in turn if we feed to our neural network
- 3:30an image of a dog it'll tell us it's a
- 3:32dog if we
- 3:34feed hand written numbers
- 3:37they'll be able to tell us whether that
- 3:38number is an eight or a nine
- 3:44there is parallelism here both
- 3:48within each layer but also we can
- 3:51process multiple layers
- 3:52concurrently we have introduced matrix
- 3:56multiplication
- 3:57matrix multiplication is not just common
- 4:00in
- 4:00in neural nets it's one of the
- 4:04most common operations that will
- 4:06encounter in
- 4:08engineering data science
- 4:11and many other application domains
- 4:14generally we'll find it in
- 4:16image filtering or blurring or noise
- 4:19reduction
- 4:20and many of the machine learning kernels
- 4:23[Music]
- 4:25but it's not a modern type of
- 4:29workload i mean it has been so prevalent
- 4:31engineering that it has been supported
- 4:33in
- 4:34languages since long time ago for
- 4:37example there was a language one of the
- 4:39first languages that i've learned as a
- 4:41student was something that is called
- 4:43fortran um you guys might not have even
- 4:46heard of a fortran
- 4:47um tell us something a little bit about
- 4:50my age
- 4:51um fortran was a common
- 4:54language for um engineering applications
- 4:59in the past up to probably early 2000s
- 5:02um when it was
- 5:06basically uh replaced in in
- 5:09most of the domains by c it took see a
- 5:12while to
- 5:13to displace fortran legacy fortran from
- 5:16everywhere um in the world um
- 5:19so in fortran there was this instruction
- 5:22which was d
- 5:23gem and d gem is a double precision
- 5:25floating point matrix multiplication
- 5:28so it was as prevalent
- 5:31or as important that it needed its own
- 5:36instruction
- 5:38just to quickly recap our matrices
- 5:40because it will be helpful
- 5:42um in understanding how we work on them
- 5:45a bit later
- 5:46you know here is an example of a square
- 5:49matrix with
- 5:50i rows and j columns
- 5:54important thing to keep in mind is we
- 5:56generally can't
- 5:57store this matrix as like a square
- 6:00matrix in a memory
- 6:01or in or on a disk
- 6:04it is generally stored sequentially
- 6:08so we have a choice here whether we
- 6:09would like to store it by
- 6:12serially by rows or columns
- 6:16generally it is serialized by columns so
- 6:20in this case the first element in the
- 6:22matrix a 0 0 will be followed by
- 6:25the second element in that column
- 6:28a 1 0 and then we will store them all
- 6:33up to a n minus 1 0
- 6:36and then we would continue with the
- 6:38second column
- 6:39a 0 1 store all of them up to
- 6:43a n minus 1.
- 6:47one and so on all right
- 6:51and what does the matrix multiplication
- 6:53do
- 6:54well it's if we say that we would like
- 6:56to multiply
- 6:57two matrices a and b and sort a result
- 6:59in a c what we are essentially doing
- 7:02we are performing an iterative process
- 7:06that computes elements of a resulting
- 7:09matrix c i
- 7:10j as sums of pairwise
- 7:13products a i k
- 7:17and b k j the inner coefficient k
- 7:21is the same and that basically means
- 7:24that
- 7:25the number of columns in matrix a has to
- 7:28be the same as the number of rows in
- 7:30matrix b
- 7:32that's the only way how the matrix
- 7:33multiplication is valid so we would like
- 7:35to find this element
- 7:38c i j we would perform
- 7:41pairwise multiplication of all the
- 7:44elements in
- 7:45row i with all the elements
- 7:49in column b
- 7:52and sum them together to get the element
- 7:54c i
- 7:55j notice that all these
- 7:58multiplications of elements a i k
- 8:02and b k j can be performed concurrently
- 8:06and then we will just add them together
- 8:09so we're going to look a little bit more
- 8:11into that after a
- 8:13quick break
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 32.1 - Flynn Taxonomy, SIMD Instructions: Parallelism by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,052 words across 198 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.