Simple Answers & Key Points · 26 Questions
Flynn's Taxonomy (proposed by Michael J. Flynn in 1966) is the most widely used classification system for computer architectures. It categorizes systems based on the number of concurrent instruction streams and data streams they can process.
The Four Categories:
| Category | Instruction Streams | Data Streams | Description | Example |
|---|---|---|---|---|
| SISD | Single | Single | Traditional uniprocessor. One instruction operates on one data item at a time. Sequential execution. | Classic Pentium, older microcontrollers |
| SIMD | Single | Multiple | One instruction is broadcast to multiple processing elements, each operating on different data. Data-level parallelism. | GPUs, Vector processors (Cray), Intel AVX/SSE |
| MISD | Multiple | Single | Multiple instructions operate on the same data stream. Extremely rare in practice. | Fault-tolerant systems (Space Shuttle flight computers), systolic arrays (debatable) |
| MIMD | Multiple | Multiple | Multiple processors execute different instructions on different data independently. Most flexible and powerful. | Multi-core CPUs (Intel i9), Clusters, Distributed systems |
Significance: While simplified (it doesn't capture nuances like multi-threading or GPU architectures well), Flynn's Taxonomy remains the standard introductory framework for discussing parallel computing architectures.
UMA and NUMA are two models of shared-memory multiprocessor architectures, differing in how memory access latency is distributed.
| Feature | UMA (Uniform Memory Access) | NUMA (Non-Uniform Memory Access) |
|---|---|---|
| Memory Access Time | All processors have equal access time to all memory locations. Every memory address takes the same time regardless of which processor requests it. | Access time depends on the location of memory relative to the processor. Local memory is fast; remote memory (on another node) is slower. |
| Architecture | All processors share a single, centralized main memory connected via a common bus or crossbar switch. | Memory is physically distributed across nodes. Each processor has its own local memory, but can access other processors' memory via an interconnection network. |
| Scalability | Poor. The shared bus/crossbar becomes a bottleneck beyond ~8-16 processors. | Good. Can scale to hundreds of processors because most accesses are to local memory, reducing bus contention. |
| Programming | Simpler. Programmers don't need to worry about data placement. | More complex. Programmers must optimize data locality to minimize remote memory accesses for good performance. |
| Examples | Small SMP servers, Intel single-socket systems | AMD EPYC, Intel Xeon multi-socket servers, SGI Origin |
Key Insight: NUMA is essentially a compromise between shared-memory ease-of-programming and distributed-memory scalability. The programmer sees a single shared address space, but performance depends on data placement.
Memory Consistency (or Memory Consistency Model) defines the rules governing the order in which memory operations (reads and writes) performed by one processor become visible to other processors in a shared-memory multiprocessor system.
Why It Matters:
Modern processors reorder instructions for performance (out-of-order execution, write buffers, store-to-load forwarding). In a single processor, this is invisible because the hardware preserves the illusion of sequential execution. In a multiprocessor, however, reordering can cause one processor to see another processor's memory operations in a different order than they were issued, leading to bugs in parallel programs.
Common Consistency Models:
A Dataflow Computer is a non-Von Neumann architecture where instruction execution is determined entirely by the availability of input data (operands), rather than by a sequential Program Counter.
Key Principles:
Advantages: Naturally parallel, no hazards from sequential assumptions, excellent for functional programming paradigms.
Disadvantages: High overhead for token matching hardware, poor performance for sequential algorithms, difficulty handling irregular control flow and data structures. These limitations prevented widespread commercial adoption.
Matrix Multiplication is the most classic and widely cited application of systolic arrays.
Why Systolic Arrays Excel at Matrix Multiply:
Other Applications:
A Reduction Computer is a non-Von Neumann architecture based on demand-driven (lazy) evaluation. Instead of executing instructions eagerly from top to bottom, a reduction computer only evaluates an expression when its result is explicitly needed by another computation.
Key Concepts:
Difference from Dataflow:
Example: If the program computes if True then X else (expensive_computation), a reduction machine never evaluates expensive_computation because the else branch is never demanded.
Synchronization in parallel computing refers to the mechanisms and protocols used to coordinate the execution of multiple concurrent threads or processes to ensure correct program behavior when they access shared resources.
Why It's Needed:
When multiple processors/threads access shared data concurrently, without synchronization, race conditions can occur — the final result depends on the unpredictable timing of operations, leading to incorrect or inconsistent outcomes.
Types of Synchronization:
Test-and-Set or Compare-and-Swap (CAS).Hardware Support: Modern CPUs provide atomic instructions (Test-and-Set, Load-Linked/Store-Conditional, Compare-and-Swap) that guarantee indivisible read-modify-write operations on memory, forming the foundation for all software synchronization primitives.
Distributed Shared Memory (DSM) is an architecture (implemented in hardware, software, or both) that presents a single, unified shared address space to the programmer, even though the underlying physical memory is distributed across multiple separate nodes in a network.
How It Works:
Consistency Maintenance:
Advantage: Easier programming than message-passing (no explicit send/receive). Disadvantage: Remote accesses are much slower than local, and maintaining consistency adds overhead.
These four models form Flynn's Taxonomy, classifying architectures by the number of instruction and data streams.
1. SISD (Single Instruction, Single Data):
2. SIMD (Single Instruction, Multiple Data):
3. MISD (Multiple Instruction, Single Data):
4. MIMD (Multiple Instruction, Multiple Data):
A Centralized Shared Memory (also called Symmetric Multiprocessor or SMP) architecture is one where all processors are connected to a single, centralized physical main memory through a shared interconnect (typically a bus or crossbar switch).
Architecture:
CPU 0 CPU 1 CPU 2 CPU 3
| | | |
[L1$] [L1$] [L1$] [L1$]
| | | |
[L2$] [L2$] [L2$] [L2$]
| | | |
============ Shared Bus ===========
|
[ Main Memory ]
Advantages:
Limitations:
| Feature | Snooping-Based | Directory-Based |
|---|---|---|
| Mechanism | All cache controllers continuously monitor (snoop) a shared bus. Every memory transaction is broadcast to all processors. | A centralized or distributed directory keeps track of which caches hold copies of each memory block. Point-to-point messages are sent only to relevant caches. |
| Communication | Broadcast: Every coherence transaction is seen by every processor. | Unicast/Multicast: Messages are sent only to the processors that actually hold the data. |
| Scalability | Poor. Limited by shared bus bandwidth. Practical up to ~8-16 processors. | Excellent. No bus bottleneck. Scales to hundreds or thousands of processors. |
| Latency | Low for small systems (broadcast is fast on a bus). | Higher per-transaction (requires directory lookup + point-to-point message + response). |
| Hardware Complexity | Simpler. Cache controllers just need bus snooping logic. | More complex. Requires directory storage (memory overhead proportional to number of cache blocks × number of processors) and a scalable interconnection network. |
| Examples | Intel desktop multi-core (within a single socket), AMD Bulldozer. | AMD EPYC (Infinity Fabric), Intel Xeon multi-socket (QPI/UPI), SGI Origin. |
Key Insight: Snooping is preferred for small, tightly-coupled systems (desktops, single-socket servers) due to its simplicity and low latency. Directory protocols are essential for large-scale systems where bus bandwidth would be a fatal bottleneck.
Interconnection Networks are the communication fabric that connects processors, memories, and I/O devices in a multiprocessor or multicomputer system. The choice of network topology directly impacts bandwidth, latency, cost, and scalability.
Key Types:
Memory consistency models define the hardware/software contract specifying the legal ordering of memory accesses across processors.
| Feature | Strong Consistency (Sequential Consistency) | Weak / Relaxed Consistency |
|---|---|---|
| Operation Ordering | Strict order. No reordering of memory operations (loads/stores) is allowed. | Memory operations can be reordered freely by hardware/compiler for performance, except at explicit synchronization points. |
| Global Visibility | All processors see all memory operations in the exact same global order. | Updates become globally visible only when a synchronization barrier or memory fence is executed. |
| Performance | Low. Severely limits optimizations like write buffering, caching, and out-of-order execution. | High. Hardware can aggressively schedule and buffer memory operations to hide memory latency. |
| Programmability | Easy. Programs behave in an intuitive, sequential manner. | Difficult. Programmers must manually insert memory barriers/fences to ensure correctness. |
| Implementation | Rarely implemented directly in modern hardware due to high performance costs. | Standard in modern architectures (ARM, RISC-V use weak models; x86 uses TSO - a relaxed model). |
Practical Impact: Most modern processors use relaxed/weak models for performance. Programmers rely on high-level synchronization primitives (mutexes, atomics) provided by programming languages, which internally compile down to the correct hardware memory fences.
A Cluster Computer is a collection of independent, complete computers (nodes) connected via a high-speed local area network (LAN), working together as a single unified computing resource.
Key Characteristics:
Examples: Google's data centers, Amazon AWS EC2 instances, Beowulf clusters, most of the Top500 supercomputers are clusters.
| Feature | Centralized Shared Memory (SMP) | Distributed Shared Memory (DSM) |
|---|---|---|
| Physical Memory | Single, centralized memory module shared by all processors. | Memory is physically distributed across nodes, but logically shared (single address space). |
| Access Model | UMA (Uniform Memory Access). All accesses take equal time. | NUMA (Non-Uniform). Local accesses are fast; remote accesses are slow. |
| Scalability | Poor. Limited by bus/crossbar bandwidth (~2-16 processors). | Excellent. Can scale to hundreds or thousands of processors. |
| Coherence | Snooping protocols (MESI) on the shared bus. Simple but doesn't scale. | Directory-based protocols. More complex but scales well. |
| Programming | Easiest. Uniform access means no need to think about data placement. | Moderate. Programmers should optimize data locality for performance (place data near the processor that uses it most). |
| Cost | Moderate (single motherboard, shared memory). | Higher (multiple nodes, each with own memory, plus interconnect). |
| Latency | Uniform and low. | Variable. Local = low. Remote = high (10-100x local). |
| Examples | Intel Xeon single-socket, AMD Ryzen desktop. | AMD EPYC multi-socket, SGI Origin, Intel Xeon multi-socket with QPI. |
(Refer to Question 9 for detailed explanation. Below are additional modern examples.)
Limitations of Flynn's Taxonomy: It doesn't capture modern hybrid architectures well (e.g., a GPU has SIMD cores organized in MIMD fashion — sometimes called SIMT: Single Instruction, Multiple Threads). It also doesn't distinguish between shared-memory and message-passing MIMD systems.
Architecture:
Synchronization Mechanisms:
1. Shared Bus:
[P0] [P1] [P2] [P3]
| | | |
======================== (Single Bus)
|
[Memory]
2. Crossbar Switch:
M0 M1 M2 M3 P0 × × × × P1 × × × × P2 × × × × P3 × × × ×
3. 2D Mesh:
P0 — P1 — P2 — P3 | | | | P4 — P5 — P6 — P7 | | | | P8 — P9 — P10— P11
4. Hypercube (k-dimensional):
3D Hypercube (8 nodes): 000 — 001 100 — 101 | × | ↔ | × | 010 — 011 110 — 111
5. Torus: Same as Mesh but with wrap-around edges connecting border nodes. Reduces diameter and provides more uniform latency.
A DSM system provides the abstraction of a single shared address space over physically distributed memories. Here is how it works at a detailed level:
Hardware-Based DSM (e.g., ccNUMA):
Software-Based DSM:
Uses the OS Virtual Memory system. Pages are the unit of sharing. When a processor accesses a page not in its local memory, a page fault triggers the OS to fetch the page from the remote node over the network. This is much coarser-grained and higher-latency than hardware DSM, but cheaper to implement.
| Feature | Cluster Computing | Traditional Parallel (SMP/Mainframe) |
|---|---|---|
| Coupling | Loosely coupled. Independent nodes with separate OS instances. | Tightly coupled. Shared memory, shared OS. |
| Communication | Message passing (MPI) over network. Higher latency. | Shared memory variables. Lower latency. |
| Hardware | Commodity off-the-shelf (COTS) PCs/servers. | Custom-designed, proprietary hardware. |
| Cost | Much cheaper per FLOP. Incremental scaling. | Expensive. Requires large upfront investment. |
| Scalability | Excellent. Can scale to thousands of nodes. | Limited by hardware design (bus bandwidth, memory ports). |
| Fault Tolerance | Good. Individual node failure doesn't crash the system. Job can be rescheduled. | A single hardware failure can bring down the entire system. |
| Programming | More complex (explicit message passing, data distribution). | Easier (shared memory, implicit communication). |
Real-World Use Case:
Google's Search Infrastructure: Google's search engine runs on massive clusters of thousands of commodity servers. When you type a query, it is distributed across hundreds of machines that each search a fraction of the web index. Results are merged and returned in milliseconds. This architecture provides extreme scalability, fault tolerance (failed servers are simply bypassed), and cost efficiency.
| Feature | Von Neumann Architecture | Dataflow Architecture |
|---|---|---|
| Execution Model | Control-driven. A Program Counter (PC) sequentially fetches and executes instructions. | Data-driven. Instructions execute when all their input operands (tokens) are available. |
| Program Counter | Central PC dictates execution order. | No PC. Execution order is determined by data dependencies. |
| Memory Model | Shared, mutable global memory. Instructions read/write to global variables. | No global memory (in pure dataflow). Data flows through the computation graph as tokens on arcs. |
| Parallelism | Implicit. Hardware (OoO, superscalar) or compiler must discover parallelism. | Explicit and natural. All instructions with available data fire simultaneously. Maximum parallelism is exposed automatically. |
| Side Effects | Prevalent. Instructions can modify global state. | None (pure dataflow). Each instruction consumes input tokens and produces output tokens. |
| Synchronization | Requires explicit locks, barriers for parallel programs. | Implicit. Data availability inherently synchronizes operations. |
Dataflow Execution Example:
Expression: (A + B) × (C - D)
Von Neumann: Dataflow Graph:
1. LOAD A A B C D
2. LOAD B \ / \ /
3. ADD R1, A, B + -
4. LOAD C \ /
5. LOAD D \ /
6. SUB R2, C, D ×
7. MUL R3, R1, R2 Result
(Sequential: 7 steps) (Parallel: + and - fire simultaneously → 3 steps)
A Systolic Array is a network of tightly coupled, simple Processing Elements (PEs) arranged in a regular pattern (typically a 2D grid). Data flows through the array rhythmically, like blood pulsing through the circulatory system (hence "systolic," from the Greek word for heart contraction).
Architecture:
Matrix Multiplication (C = A × B) on a 3×3 Systolic Array:
Key Advantage: Extremely high data reuse. Each element of A and B is read from memory once but used by 3 PEs. This minimizes memory bandwidth requirements — the bottleneck of traditional architectures.
Modern Example: Google's TPU v1 contains a 256×256 systolic array (65,536 PEs) specifically for neural network matrix multiplications.
Reduction Computer Architectures are based on the principle of demand-driven computation (also called lazy evaluation or call-by-need). They execute programs by repeatedly reducing expressions to their simplest form.
How They Work:
How They Differ from Other Architectures:
| Aspect | Von Neumann | Dataflow | Reduction |
|---|---|---|---|
| Execution Trigger | Program Counter (control-driven) | Data availability (data-driven/eager) | Demand for result (demand-driven/lazy) |
| Evaluation Strategy | Eager (evaluate everything) | Eager (fire when data arrives) | Lazy (evaluate only when needed) |
| Unnecessary Computation | May compute unused results | May compute unused results | Never computes unused results |
| Best For | General purpose | Parallel numeric computation | Functional programming, symbolic computation |
Given: A 2D Mesh network with 4×4 = 16 processing nodes.
Step 1: Count the Links
In a 2D mesh with N rows and M columns:
Step 2: Latency Scaling (Diameter)
Conclusion:
The Problem — Cache Incoherence Scenario:
P0 and P1 now disagree on the value of X. This is a cache coherence violation.
Hardware-Based Solution: MESI Snooping Protocol
Result: P1 correctly reads X = 20. Coherence is maintained entirely in hardware, transparently to the software.
Setup: A 3×3 systolic array with 9 PEs performing a 2D convolution of an image with a 3×3 kernel (filter).
Weight-Stationary Design:
PE(0,0)=W00 PE(0,1)=W01 PE(0,2)=W02
PE(1,0)=W10 PE(1,1)=W11 PE(1,2)=W12
PE(2,0)=W20 PE(2,1)=W21 PE(2,2)=W22
Data Flow per Clock Cycle:
product = pixel × weight.partial_sum_out = partial_sum_in + product.Execution Steps for an N×N Image: