Pipelining Size and Depth
Pipelining Size and Depth
by
Nazia Shahzadi
[email protected]
Lecturer (FCSE)
Ghulam Ishaq Khan Institute,
Topi, KPK, Pakistan
Pipelining
• Pipelining:
• A way of speeding up the execution of instructions
• Key Idea:
• Overlap execution of multiple instructions
Pipelining
• Pipelining is a technique of decomposing a sequential process into sub-operations,
with each sub-operation being executed in a special dedicated segment that
operates concurrently with all other segments.
• Each segment performs partial processing dictated by the way the task is
portioned.
• The result obtained from each segment is passed to the next segment.
• The final result is achieved when data is passed from all segments.
Pipelining Analogy: An Industrial Assembly Line
• The concept of pipeline in parallel processing is similar to an industrial
assembly line.
• As in industry there are three different divisions:
1. Manufacturing
2. Packaging
3. Delivery
• This overall process results in speed up of a system.
Load A and B
R1← A
R2← B
Multiply and Load C
R3 R1 * R2, R4 ← C
R5 R3 + R4
Contents of Registers in Pipelining
General Structure of a 3-Segment Pipelining
Determine the number of cycles that it takes to process 200 tasks in a six-
segment pipeline
Solution
K= 6
n = 200
Number of clock cycles required = (K + n – 1) clock cycles
= (6 + 200 – 1)
= 205 clock cycles
Arithmetic Pipeline
Instruction Pipeline
Processor Pipeline
Size and Depth in
Parallel Processors
Size and Depth in Parallel Processors
(1/3)
• Size:
Size refers to the amount of data or the number of tasks that are being processed in parallel. In
parallel processing, having a sufficiently large workload is crucial to fully utilize the available
resources.
Example: Imagine you have a set of 1,000,000 integers, and you want to calculate the sum of
these numbers using parallel processing. If you divide this task into smaller chunks of 100,000
integers each and distribute them across 10 processors, you have a size of 100,000 for each
chunk.
Size and Depth in Parallel Processors
(2/3)
• Depth:
Depth represents the level of parallelism or how many stages of processing occur in parallel.
It's about breaking down a task into subtasks that can be executed concurrently.
Example: Consider a sorting algorithm like Merge Sort. It involves dividing the array into
smaller subarrays, sorting those subarrays, and then merging them back together. The depth of
parallelism in Merge Sort is determined by how many levels of merging can be done
concurrently. If you have enough processors, you can reduce the depth, making the algorithm
faster.
Size and Depth in Parallel Processors
(3/3)
• Depth Example:
Let's consider a parallel matrix multiplication algorithm as an example of depth: Suppose you
want to multiply two 4x4 matrices, A and B, to get a resulting matrix C. In a parallel algorithm,
you can break down the task into stages:
1.Splitting:
Divide the matrices A and B into smaller submatrices, for example, into 2x2 submatrices.
2.Multiplication:
Multiply the corresponding submatrices in parallel. This is the depth of the algorithm, as it
involves performing multiplications concurrently.
3.Combining:
Combine the results of the submatrix multiplications to form the final matrix C.
The depth of parallelism in this case is the second stage, where matrix multiplications occur
simultaneously. In this specific example, the depth is 4 (as we have four 2x2 submatrices to
multiply in parallel).
THE END