Lecture 4 - Instruction Level Parallelism (ILP) Flashcards

(9 cards)

1
Q

Introduction to Instruction Level Parallelism (ILP)

A
  • Pipelining, introduced in 1985, became a universal technique to overlap instruction execution and exploit ILP.
  • Two main approaches to ILP exist: hardware-based dynamic approaches (used in server and desktop processors, and modern phone/tablet processors) and compiler-based static approaches (less successful outside scientific applications).
  • Key techniques include VLIW (Very Long Instruction Word), Out-of-order execution, Speculative Execution, Branch Prediction, and Superscalar processing.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In-Order vs Out-of-Order Execution

A
  • In-order execution processes instructions in their original sequence. If one instruction stalls, all subsequent instructions stall.
    • Reordering can be done in software by the compiler, programmer, or binary optimization tools.
  • Out-of-order execution allows the processor to dynamically reorder instructions. If one instruction stalls, others may proceed.
    • Instructions may commit out of order, but the semantics of in-order execution must be preserved.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Instruction Level Parallelism (ILP)
(What is the goal?) (What is ILP)

A

ILP is a form of parallelism that involves executing multiple instructions simultaneously.

  • The goal of ILP is to minimize Cycles Per Instruction (CPI).
  • Pipeline CPI = Ideal pipeline CPI + Structural stalls + Data hazard stalls + Control stalls.
  • Parallelism within a basic block (straight-line code sequence) is limited (typically 3-6 instructions), and instructions are likely to depend on each other. Optimization must occur across branches.
  • For single-issue processors, the ideal CPI is 1.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Data Dependence (What is LLP) (Name three types RWW, TOA)

A
  • Data Dependency refers to a situation in which an instruction is dependent on a result from an earlier instruction.
  • Dependent instructions cannot be executed simultaneously.
  • There are three types of Data Dependencies:
    • Raw (Read After Write), (True Dependency): Instruction reads a value before it has been written.
    • WAW (Write After Write), (Output Dependency): Two instructions write to the same location, and the write operations are reordered.
    • WAR (Write After Read), (Anti-Dependency): An Instruction writes to a location before a previous instruction reads it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Loop Level Parallelism (LLP) (What is LLP) (How can it be achieved)

A

Loop-level parallelism is a form of parallelism that involves extracting parallel tasks from loops.

Loop-level parallelism can be achieved by unrolling loops statically or dynamically, or by using SIMD (vector processors and GPUs).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data Hazards (Data Dependency) (Name examples)

A
  • Types of data hazards: Read-after-write (RAW), Write-after-write (WAW), and Write-after-read (WAR).
  • RAW (true dependency): Instruction reads a value before it has been written.
  • WAW (output dependency): Two instructions write to the same location, and the write operations are reordered.
  • WAR (antidependency): An instruction writes to a location before a previous instruction reads it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Name Dependence

A
  • Occurs when two instructions use the same name (register or memory location) without any flow of information.
  • Not a true data dependence but can cause problems when reordering instructions.
  • Anti-dependence (WAR) and output dependence (WAW) are examples. Renaming techniques can resolve these.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Control Dependences

A
  • The ordering of an instruction relative to a branch instruction.
  • A control-dependent instruction cannot be moved before the branch, and a control-independent instruction cannot be moved after the branch.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Compiler Techniques for Exposing ILP (Name techniques PLS)

A
  • Pipeline scheduling: Separating dependent instructions by the pipeline latency of the source instruction.
  • Loop unrolling: Replicating the loop body to reduce loop overhead and expose more parallelism.
  • Strip mining: Handling loops with an unknown number of iterations by generating a pair of loops.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly