ece 259 / cps 221 advanced computer architecture ii...

29
ECE 259 / CPS 221 Advanced Computer Architecture II (Parallel Computer Architecture) Interconnection Networks Copyright 2010 Daniel J. Sorin Duke University Slides are derived from work by Sarita Adve (Illinois), Babak Falsafi (CMU), Mark Hill (Wisconsin), Alvy Lebeck (Duke), Steve Reinhardt (Michigan), and J. P. Singh (Princeton). Thanks!

Upload: others

Post on 22-Jan-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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!

Page 2: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 3: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 4: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 5: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 6: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 7: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 8: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 9: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 10: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 11: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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)

Page 12: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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)

Page 13: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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 = ?

Page 14: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 15: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 16: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 17: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 18: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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)

Page 19: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 20: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 21: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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?

Page 22: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 23: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 24: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 25: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 26: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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 …

Page 27: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 28: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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

Page 29: ECE 259 / CPS 221 Advanced Computer Architecture II ...people.ee.duke.edu/~sorin/ece259/lectures/5.1-network.pdfABCs of Networks • Starting Point : Send bits between 2 computers

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?