Lecture 24: Interconnection Networks Topics: communication latency, centralized and decentralized switches, routing, deadlocks (Appendix F) 1 Centralized Crossbar Switch P0 P1 P2 P3 P4 P5 P6 P7 2 Crossbar Properties
Assuming each node has one input and one output, a crossbar can provide maximum bandwidth: N messages can be sent as long as there are N unique sources and N unique destinations Maximum overhead: WN2 internal switches, where W is data width and N is number of nodes To reduce overhead, use smaller switches as building blocks trade off overhead for lower effective bandwidth 3 Switch with Omega Network 000 P0 000 001 P1 001
010 P2 010 011 P3 011 100 P4 100 101 P5 101 110 P6 110
111 P7 111 4 Omega Network Properties The switch complexity is now O(N log N) Contention increases: P0 P5 and P1 P7 cannot happen concurrently (this was possible in a crossbar) To deal with contention, can increase the number of levels (redundant paths) by mirroring the network, we can route from P0 to P5 via N intermediate nodes, while increasing complexity by a factor of 2 5 Tree Network Complexity is O(N) Can yield low latencies when communicating with neighbors Can build a fat tree by having multiple incoming and outgoing links
P0 P1 P2 P3 P4 P5 P6 P7 6 Bisection Bandwidth Split N nodes into two groups of N/2 nodes such that the
bandwidth between these two groups is minimum: that is the bisection bandwidth Why is it relevant: if traffic is completely random, the probability of a message going across the two halves is if all nodes send a message, the bisection bandwidth will have to be N/2 The concept of bisection bandwidth confirms that the tree network is not suited for random traffic patterns, but for localized traffic patterns 7 Distributed Switches: Ring Each node is connected to a 3x3 switch that routes messages between the node and its two neighbors Effectively a repeated bus: multiple messages in transit Disadvantage: bisection bandwidth of 2 and N/2 hops on average 8
Distributed Switch Options Performance can be increased by throwing more hardware at the problem: fully-connected switches: every switch is connected to every other switch: N2 wiring complexity, N2 /4 bisection bandwidth Most commercial designs adopt a point between the two extremes (ring and fully-connected): Grid: each node connects with its N, E, W, S neighbors Torus: connections wrap around Hypercube: links between nodes whose binary names differ in a single bit 9 Topology Examples Hypercube Grid Criteria Torus
Bus Ring 2Dtorus 6-cube Fully connected Performance Bisection bandwidth Cost Ports/switch Total links 10
Topology Examples Hypercube Grid Torus Criteria Bus Ring 2Dtorus 6-cube Fully connected
Performance Bisection bandwidth 1 2 16 32 1024 1 3 128 5
192 7 256 64 2080 Cost Ports/switch Total links 11 k-ary d-cube Consider a k-ary d-cube: a d-dimension array with k elements in each dimension, there are links between elements that differ in one dimension by 1 (mod k) Number of nodes N = kd Number of switches :
Switch degree : Number of links : Pins per node : Avg. routing distance: Diameter : Bisection bandwidth : Switch complexity : Should we minimize or maximize dimension? 12 k-ary d-Cube Consider a k-ary d-cube: a d-dimension array with k elements in each dimension, there are links between elements that differ in one dimension by 1 (mod k)
Number of nodes N = kd (with no wraparound) Number of switches : Switch degree : Number of links : Pins per node : N 2d + 1 Nd 2wd Avg. routing distance: d(k-1)/2 Diameter : d(k-1) Bisection bandwidth : 2wkd-1 Switch complexity : (2d + 1)2
Should we minimize or maximize dimension? 13 Routing Deterministic routing: given the source and destination, there exists a unique route Adaptive routing: a switch may alter the route in order to deal with unexpected events (faults, congestion) more complexity in the router vs. potentially better performance Example of deterministic routing: dimension order routing: send packet along first dimension until destination co-ord (in that dimension) is reached, then next dimension, etc. 14 Deadlock Deadlock happens when there is a cycle of resource dependencies a process holds on to a resource (A) and attempts to acquire another resource (B) A is not
relinquished until B is acquired 15 Deadlock Example 4-way switch Input ports Output ports Packets of message 1 Packets of message 2 Packets of message 3 Packets of message 4 Each message is attempting to make a left turn it must acquire an output port, while still holding on to a series of input and output ports 16 Deadlock-Free Proofs Number edges and show that all routes will traverse edges in increasing (or
decreasing) order therefore, it will be impossible to have cyclic dependencies Example: k-ary 2-d array with dimension routing: first route along x-dimension, then along y 1 2 17 18 1 2 18 17 1 2 19 16 1 2 2 1 3 0
2 1 3 0 2 1 3 0 2 1 3 0 17
Breaking Deadlock Consider the eight possible turns in a 2-d array (note that turns lead to cycles) By preventing just two turns, cycles can be eliminated Dimension-order routing disallows four turns Helps avoid deadlock even in adaptive routing West-First North-Last Negative-First Can allow deadlocks 18 Packets/Flits A message is broken into multiple packets (each packet has header information that allows the receiver to
re-construct the original message) A packet may itself be broken into flits flits do not contain additional headers Two packets can follow different paths to the destination Flits are always ordered and follow the same path Such an architecture allows the use of a large packet size (low header overhead) and yet allows fine-grained resource allocation on a per-flit basis 19 Flow Control The routing of a message requires allocation of various resources: the channel (or link), buffers, control state Bufferless: flits are dropped if there is contention for a link, NACKs are sent back, and the original sender has to re-transmit the packet Circuit switching: a request is first sent to reserve the channels, the request may be held at an intermediate router until the channel is available (hence, not truly
bufferless), ACKs are sent back, and subsequent packets/flits are routed with little effort (good for bulk transfers) 20 Buffered Flow Control A buffer between two channels decouples the resource allocation for each channel Cut-through Channel Channel Packet-buffer flow control: channels and buffers are Time-Space diagrams allocated per packet H
B B B T 0 Store-and-forward H B B B T 1 H B B B T 2 3 0 H B B H B 1 H 2 3 0 1 2
B T B B T B B B T 3 4 5 6 7 8 9 10 11 12 13 14 Cycle Wormhole routing: same as cut-through, but buffers in each router are allocated on a per-flit basis, not per-packet 21 Virtual Channels Buffers channel Buffers Flits do not carry headers. Once a packet starts going over a channel, another packet cannot cut in (else, the receiving buffer confuse the flits of the two packets). If the packet is
stalled, other packets cant use the channel. With virtual channels, the flit can be received into one of N buffers. This allows N packets to be in transit over a given physical channel. The packet must carry an ID to indicate its virtual channel. Buffers Buffers Physical channel Buffers Buffers 22 Virtual Channel Flow Control Incoming flits are placed in buffers For this flit to jump to the next router, it must acquire three resources: A free virtual channel on its intended hop We know that a virtual channel is free when the tail flit goes through
Free buffer entries for that virtual channel This is determined with credit or on/off management A free cycle on the physical channel Competition among the packets that share a physical channel 23 Title Bullet 24