ece 259 / cps 221 advanced computer architecture ii...
TRANSCRIPT
ECE 259 / CPS 221Advanced Computer Architecture II(Parallel Computer Architecture)
Interconnection Networks
Copyright 2010 Daniel J. SorinDuke University
Slides are derived from work bySarita Adve (Illinois), Babak Falsafi (CMU),
Mark Hill (Wisconsin), Alvy Lebeck (Duke), Steve Reinhardt (Michigan), and J. P. Singh (Princeton).
Thanks!
Interconnection Networks
• Goal : Communication between computers– Try to achieve low latency and high bandwidth
• We’ll focus on networks for parallel computing– Many concepts similar to general networking
» But the parameters can be very different!
2(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
ABCs of Networks
• Starting Point: Send bits between 2 computers
3(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
Queue on each end• Can send both ways (“Bi-directional, full duplex”)• Rules for communication? Protocol
– Synchronous send » Need request & response signaling
– Name for standard group of bits sent: Packet
A Simple Example
• What is the packet format?– Fixed? (for ease of hardware interpretation)– Variable? (for flexibility)
Request/Response
Address/Data
4(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
1 bit 32 bits
0: Please send data from Address1: Packet contains data corresponding to request
Questions About Simple Example
• What if more than 2 computers want to communicate?– Need node identifier field (destination) in packet– Routing and topology
• What if packet is garbled in transit?– Add error detection field in packet (e.g., CRC)
• What if packet is lost?– More elaborate protocols to detect loss (e.g., NAK, time outs)
5(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
– More elaborate protocols to detect loss (e.g., NAK, time outs)
• What if multiple processes/machine?– Queue per process
These issues ���� more complex protocols & packet formats
General Packet Format
• Header– Routing and control information
• Payload– Carries data (non hardware-specific information)– Can be further divided ( framing , protocol stacks…)
• Error code (detecting or correcting)– Generally at tail of packet so it can be generated on the way out
6(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
– Generally at tail of packet so it can be generated on the way out
Header Payload Error Code
Message vs. Packet
• A message may be composed of several packets
• Applications reason about messages• Networks transfers packets
• Small fixed -size packets
7(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Small fixed -size packets– Easy for network hardware– But can lead to fragmentation and reassembly (SW ov erhead)
• Variable-size packets– Can avoid some fragmentation– But can cause congestion and can be tougher for har dware
Classifying Networks
Network characterized primarily by 4 aspects
• Topology– Physical structure of the graph
• Routing Algorithm– What paths through network can a message follow
8(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Switching Strategy– How data in message traverses its route – Circuit Switched vs Packet Switched
• Flow Control– When does a packet (or portions of it) move along i ts route
Some Terminology
• Given a topology constructed by linking switches an d network interfaces, we must deliver a packet from node A to node B
• Link : wire/cable between components– Connects switches to other switches or network inte rfaces
• Switch : connect N inputs to N outputs (degree N)• Phit : Minimum # of bits physically moved across link
9(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Phit : Minimum # of bits physically moved across link in one cycle ( can pipeline on single wire )
• Flit : Minimum # of bits move across link as single unit (for purposes of flow control)
– Packet consists of one or more flits
Outline
• Topology• Routing• Flow Control
• Designing Switch Hardware• Case Studies
3 main aspects of networks
10(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Case Studies
Topology
• Topology is the structure of the interconnect– Geometric property ���� topology has nice mathematical properties
• Topology determines– Switch Degree : number of outgoing links from a switch– Diameter : number of links crossed between nodes on maximum
shortest path
11(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
shortest path– Average distance : number of hops to random destination– Bisection : minimum number of links that, if removed, would
separate the network into two parts (not necessaril y of equal size!)
• Direct vs Indirect Networks– Direct: All switches attached to host nodes (e.g., mesh)– Indirect: Many switches not attached to host nodes (e.g., tree)
Direct Topologies: k-ary d-cubes
• Often called k-ary n-cubes
• General class of regular, direct topologies– Subsumes rings, tori, cubes, etc.
• d dimensions: 2d (or 2d+1) equals switch degree
12(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
– d=1 for ring– d=2 for mesh or torus– d=3 for cube– Can choose arbitrarily large d, except for cost of switches
• k switches in each dimension– Note: k can be different in each dimension (e.g., 2 ,3,4-ary 3-cube)
Examples of k-ary d-cubes
• 1D Ring = k-ary 1-cube– d = 1 [always]– k = N [always] = 4 [here]– Degree = 2 (or 3, if you include host node)– Diameter = ? Ave dist = ?– Bisection = ?
13(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• 2D Torus = k-ary 2-cube– d = 2 [always]– k = log dN [always] = 3 [here]– Degree = 4 (or 5 with host node) [always]– Diameter = ? Ave dist = ?– Bisection = ?
k-ary d-cubes in Real World
• Compaq Alpha 21364 (and 21464, R.I.P.)– 2D torus (k-ary 2-cube)
• Cray T3D and T3E– 3D torus (k-ary, 3-cube)
14(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
Indirect Topologies
• Indirect topology – most switches not attached to nodes
• Some common indirect topologies– Crossbar– Clos– Tree– Butterfly
15(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
– Butterfly
• Each of the above topologies comes in many flavors
Indirect Topologies: Crossbar
• Crossbar = single switch that directly connects n inputs to m outputs
– Logically equivalent to m n:1 muxes
• Very useful component that is used frequently
in0
16(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
in1
in2
in3
out0 out3out2out1 out4
Indirect Topologies: Clos Networks
• Clos = multi-stage network composed of crossbars– Example: m=3, n=3, r=4 ���� r = 4 nxm input switches, m = 3 rxr
middle switches, and r = 4 mxn output switches
3x3crossbar
4x4crossbar
3x3crossbar
17(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
3x3crossbar
3x3crossbar
3x3crossbar
4x4crossbar
4x4crossbar
3x3crossbar
3x3crossbar
3x3crossbar
Indirect Topologies: Trees
• Indirect topology – most switches not attached to nodes
• Tree: send message up from leaf to closest common ancestor, then down to recipient
• N host nodes at leaves
18(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• k = branching factor of tree (k=2 ���� binary tree)– Switch degree = k+1 (k down links and one uplink)
• d = dimension = height of tree = log kN
• Diameter = 2log kN (up and then down)
Indirect Topologies: Fat Trees
• Problem with trees: too much contention at or near root
• Fat tree : same as tree, but with more bandwidth near the root (by adding multiple roots and high order switches)
19(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
CM-5 “Thinned” Fat Tree
Indirect Topologies: Butterflies
• Multistage: nodes at ends, switches in middle• Exactly one path between each pair of nodes• Each node sees a tree rooted at itself
20(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
Indirect Topologies: More Butterflies
• In general, called k-ary, n-flies
• n stages of radix-k switches
• Have many nice features, esp. log n distances
• But conflicts cause tree saturation
• How can we spread the traffic more evenly?
21(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
Benes (pronounced “BEN-ish”) Network
N Butterfly
ReversedN
Butterfly
°°°
• Routes all permutations w/o conflict
• Notice similarity to fat tree (fold in half)
• Randomization is major breakthrough
• How can we spread the traffic more evenly?
Indirect Networks in Real World
• Thinking Machines CM-5– Fat tree
• Sun UltraEnterprise E10000– 4 trees (interleaved by address)
22(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
Outline
• Topology• Routing• Flow Control
• Designing Switch Hardware• Case Studies
3 main aspects of networks
23(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Case Studies
Packet Routing
• There are three issues involved in routing
1. What to do with packets at each switch• Store-and-forward• Cut-through
2. Routing algorithms
24(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
3. Avoiding deadlock
Store and Forward
25(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Store-and-forward policy: each switch waits for the full packet to arrive in the switch before it is se nt on to the next switch
Cut Through
26(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Cut-through routing: switch examines the header, decides where to send the message, and then starts forwarding it immediately
• Two flavors of cut-through based on what switch does if output port is blocked …
Virtual Cut-Through
• What to do if output port is blocked?
• Allow the tail to continue when the head is blocked , absorbing the whole message into a single switch
– Requires a buffer large enough to hold the largest packet
27(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Degenerates to store-and-forward with high contention
Wormhole
• When the head of the message is blocked, the message stays strung out over the network
– Potentially blocks other messages (needs only buffe r the piece of the packet that is sent between switches).
– CM-5 used it, with each switch buffer being 4 bits per port– Myrinet uses it
28(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Can cause tree saturation
Store and Forward vs. Cut-Through
• Store and Forward latency is function of– Number of intermediate switches times the size of th e packet
• Cut-through latency is function of– time for 1st part of packet to negotiate the switch es +
(packet size ÷ interconnect bandwidth)
29(C) 2010 Daniel J. Sorin from Adve,Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221
• Which seems better?