Realizing Programming Models CS 258 Spring 99 David

  • Slides: 38
Download presentation
Realizing Programming Models CS 258, Spring 99 David E. Culler Computer Science Division U.

Realizing Programming Models CS 258, Spring 99 David E. Culler Computer Science Division U. C. Berkeley 3/5/99 CS 258 S 99

Network Transaction Primitive • one-way transfer of information from a source output buffer to

Network Transaction Primitive • one-way transfer of information from a source output buffer to a dest. input buffer – causes some action at the destination – occurrence is not directly visible at source • deposit data, state change, reply 3/5/99 CS 258 S 99 2

Programming Models Realized by Protocols CAD Database Multiprogramming Shared address Scientific modeling Message passing

Programming Models Realized by Protocols CAD Database Multiprogramming Shared address Scientific modeling Message passing Data parallel Compilation or library Operating systems support Parallel applications Programming models Communication abstraction User/system boundary Hardware/software boundary Communication hardware Physical communication medium Network Transactions 3/5/99 CS 258 S 99 3

Shared Address Space Abstraction • Fundamentally a two-way request/response protocol – writes have an

Shared Address Space Abstraction • Fundamentally a two-way request/response protocol – writes have an acknowledgement • Issues 3/5/99 – fixed or variable length (bulk) transfers – remote virtual or physical address, where is action performed? – deadlock avoidance and input buffer full • coherent? consistent? CS 258 S 99 4

The Fetch Deadlock Problem • Even if a node cannot issue a request, it

The Fetch Deadlock Problem • Even if a node cannot issue a request, it must sink network transactions. • Incoming transaction may be a request, which will generate a response. • Closed system (finite buffering) 3/5/99 CS 258 S 99 5

Consistency • write-atomicity violated without caching 3/5/99 CS 258 S 99 6

Consistency • write-atomicity violated without caching 3/5/99 CS 258 S 99 6

Key Properties of Shared Address Abstraction • Source and destination data addresses are specified

Key Properties of Shared Address Abstraction • Source and destination data addresses are specified by the source of the request – a degree of logical coupling and trust • no storage logically “outside the address space” » may employ temporary buffers for transport • Operations are fundamentally request response • Remote operation can be performed on remote memory – logically does not require intervention of the remote processor 3/5/99 CS 258 S 99 7

Message passing • Bulk transfers • Complex synchronization semantics – more complex protocols –

Message passing • Bulk transfers • Complex synchronization semantics – more complex protocols – More complex action • Synchronous – Send completes after matching recv and source data sent – Receive completes after data transfer complete from matching send • Asynchronous – Send completes after send buffer may be reused 3/5/99 CS 258 S 99 8

Synchronous Message Passing Processor Action? • • Constrained programming model. Deterministic! What happens when

Synchronous Message Passing Processor Action? • • Constrained programming model. Deterministic! What happens when threads added? Destination contention very limited. User/System boundary? 3/5/99 CS 258 S 99 9

Asynch. Message Passing: Optimistic • More powerful programming model • Wildcard receive => non-deterministic

Asynch. Message Passing: Optimistic • More powerful programming model • Wildcard receive => non-deterministic • Storage required within msg layer? 3/5/99 CS 258 S 99 10

Asynch. Msg Passing: Conservative • Where is the buffering? • Contention control? Receiver initiated

Asynch. Msg Passing: Conservative • Where is the buffering? • Contention control? Receiver initiated protocol? • Short message optimizations 3/5/99 11 CS 258 S 99

Key Features of Msg Passing Abstraction • Source knows send data address, dest. knows

Key Features of Msg Passing Abstraction • Source knows send data address, dest. knows receive data address – after handshake they both know both • Arbitrary storage “outside the local address spaces” – may post many sends before any receives – non-blocking asynchronous sends reduces the requirement to an arbitrary number of descriptors » fine print says these are limited too • Fundamentally a 3 -phase transaction – includes a request / response – can use optimisitic 1 -phase in limited “Safe” cases » credit scheme 3/5/99 CS 258 S 99 12

Active Messages Request handler Reply handler • User-level analog of network transaction – transfer

Active Messages Request handler Reply handler • User-level analog of network transaction – transfer data packet and invoke handler to extract it from the network and integrate with on-going computation • Request/Reply • Event notification: interrupts, polling, events? • May also perform memory-to-memory transfer 3/5/99 CS 258 S 99 13

Common Challenges • Input buffer overflow – N-1 queue over-commitment => must slow sources

Common Challenges • Input buffer overflow – N-1 queue over-commitment => must slow sources – reserve space per source (credit) » when available for reuse? • Ack or Higher level – Refuse input when full » backpressure in reliable network » tree saturation » deadlock free » what happens to traffic not bound for congested dest? – Reserve ack back channel – drop packets – Utilize higher-level semantics of programming model 3/5/99 CS 258 S 99 14

Challenges (cont) • Fetch Deadlock – For network to remain deadlock free, nodes must

Challenges (cont) • Fetch Deadlock – For network to remain deadlock free, nodes must continue accepting messages, even when cannot source msgs – what if incoming transaction is a request? » Each may generate a response, which cannot be sent! » What happens when internal buffering is full? • logically independent request/reply networks – physical networks – virtual channels with separate input/output queues • bound requests and reserve input buffer space – K(P-1) requests + K responses per node – service discipline to avoid fetch deadlock? • NACK on input buffer full – NACK delivery? 3/5/99 CS 258 S 99 15

Challenges in Realizing Prog. Models in the Large • One-way transfer of information •

Challenges in Realizing Prog. Models in the Large • One-way transfer of information • No global knowledge, nor global control – barriers, scans, reduce, global-OR give fuzzy global state • Very large number of concurrent transactions • Management of input buffer resources – many sources can issue a request and over-commit destination before any see the effect • Latency is large enough that you are tempted to “take risks” – optimistic protocols – large transfers – dynamic allocation • Many more degrees of freedom in design and engineering of these system 3/5/99 CS 258 S 99 16

Network Transaction Processing Scalable Network Message Output Processing – checks – translation – formating

Network Transaction Processing Scalable Network Message Output Processing – checks – translation – formating – scheduling M CA °°° Communication Assist P Node Architecture CA M P Input Processing – checks – translation – buffering – action • Key Design Issue: • How much interpretation of the message? • How much dedicated processing in the Comm. Assist? 3/5/99 CS 258 S 99 17

Spectrum of Designs • None: Physical bit stream – blind, physical DMA n. CUBE,

Spectrum of Designs • None: Physical bit stream – blind, physical DMA n. CUBE, i. PSC, . . . • User/System – User-level port CM-5, *T – User-level handler J-Machine, Monsoon, . . . • Remote virtual address – Processing, translation Paragon, Meiko CS-2 • Global physical address – Proc + Memory controller RP 3, BBN, T 3 D • Cache-to-cache – Cache controller Dash, KSR, Flash Increasing HW Support, Specialization, Intrusiveness, Performance (? ? ? ) 3/5/99 CS 258 S 99 18

Net Transactions: Physical DMA • DMA controlled by regs, generates interrupts • Physical =>

Net Transactions: Physical DMA • DMA controlled by regs, generates interrupts • Physical => OS initiates transfers sender auth dest addr • Send-side – construct system “envelope” around user data in kernel area • Receive 3/5/99 – must receive into system buffer, since no interpretation in. CA CS 258 S 99 19

n. CUBE Network Interface • independent DMA channel per link direction – leave input

n. CUBE Network Interface • independent DMA channel per link direction – leave input buffers always open – segmented messages • routing interprets envelope 3/5/99 – dimension-order routing on hypercube – bit-serial with 36 bit cut-through CS 258 S 99 Os 16 ins 260 cy 13 us Or 200 cy 15 us 18 - includes interrupt 20

Conventional LAN NI Host Memory NIC trncv NIC Controller Data Addr Len Status Next

Conventional LAN NI Host Memory NIC trncv NIC Controller Data Addr Len Status Next 3/5/99 addr TX RX Addr Len Status Next len mem bus DMA IO Bus Proc Addr Len Status Next CS 258 S 99 21

User Level Ports • • initiate transaction at user level deliver to user without

User Level Ports • • initiate transaction at user level deliver to user without OS intervention network port in user space User/system flag in envelope – protection check, translation, routing, media access in src CA – user/sys check in dest CA, interrupt on system 3/5/99 CS 258 S 99 22

User Level Network ports • Appears to user as logical message queues plus status

User Level Network ports • Appears to user as logical message queues plus status • What happens if no user pop? 3/5/99 CS 258 S 99 23

Example: CM-5 • Input and output FIFO for each network • 2 data networks

Example: CM-5 • Input and output FIFO for each network • 2 data networks • tag per message – index NI mapping table • context switching? • *T integrated NI on chip • i. WARP also 3/5/99 CS 258 S 99 Os 50 cy 1. 5 us Or 1. 6 us 53 cy interrupt 10 us 24

User Level Handlers U s e r /s y s te m D a

User Level Handlers U s e r /s y s te m D a ta A d d re s s D e st °° ° M em Mem P P • Hardware support to vector to address specified in message – message ports in registers 3/5/99 CS 258 S 99 25

J-Machine • Each node a small mdg driven processor • HW support to queue

J-Machine • Each node a small mdg driven processor • HW support to queue msgs and dispatch to msg handler task 3/5/99 CS 258 S 99 26

*T 3/5/99 CS 258 S 99 27

*T 3/5/99 CS 258 S 99 27

i. WARP Host Interface unit • Nodes integrate communication with computation on systolic basis

i. WARP Host Interface unit • Nodes integrate communication with computation on systolic basis • Msg data direct to register • Stream into memory 3/5/99 CS 258 S 99 28

Dedicated processing without dedicated hardware design 3/5/99 CS 258 S 99 29

Dedicated processing without dedicated hardware design 3/5/99 CS 258 S 99 29

Dedicated Message Processor Network dest °°° Mem NI P User MP System • General

Dedicated Message Processor Network dest °°° Mem NI P User MP System • General Purpose processor performs arbitrary output processing (at system level) • General Purpose processor interprets incoming network transactions (at system level) • User Processor <–> Msg Processor share memory • Msg Processor <–> Msg Processor via system network 3/5/99 CS 258 S 99 transaction 30

Levels of Network Transaction Network dest °°° Mem NI P User MP Mem NI

Levels of Network Transaction Network dest °°° Mem NI P User MP Mem NI MP P System • User Processor stores cmd / msg / data into shared output queue – must still check for output queue full (or make elastic) • Communication assists make transaction happen – checking, translation, scheduling, transport, interpretation • Effect observed on destination address space and/or events 3/5/99 31 • Protocol divided between. CS 258 two. S 99 layers

Example: Intel Paragon Service Network I/O Nodes Devices 16 Mem 175 MB/s Duplex 2048

Example: Intel Paragon Service Network I/O Nodes Devices 16 Mem 175 MB/s Duplex 2048 B NI i 860 xp 50 MHz 16 KB $ 4 -way 32 B Block MESI 3/5/99 °°° EOP rte MP handler Var data 64 400 MB/s $ $ P MP s. DMA r. DMA CS 258 S 99 32

User Level Abstraction (Lok Liu) IQ Proc IQ OQ OQ VAS Proc • Any

User Level Abstraction (Lok Liu) IQ Proc IQ OQ OQ VAS Proc • Any user process can post a transaction for any other in protection domain – communication layer moves OQsrc –> IQdest – may involve indirection: VASsrc –> VASdest 3/5/99 CS 258 S 99 33

Msg Processor Events User Output Queues Compute Processor Kernel System Event Rcv FIFO ~Full

Msg Processor Events User Output Queues Compute Processor Kernel System Event Rcv FIFO ~Full 3/5/99 DMA done Send DMA Dispatcher Rcv DMA Send FIFO ~Empty CS 258 S 99 34

Basic Implementation Costs: Scalar 10. 5 µs CP Registers 7 wds Cache Net FIFO

Basic Implementation Costs: Scalar 10. 5 µs CP Registers 7 wds Cache Net FIFO Net MP 2 1. 5 2 MP 2 CP 2 User OQ 2 User IQ 4. 4 µs 5. 4 µs 250 ns + H*40 ns • Cache-to-cache transfer (two 32 B lines, quad word ops) – producer: read(miss, S), chk, write(S, WT), write(I, WT), write(S, WT) – consumer: read(miss, S), chk, read(H), read(miss, S), read(H), write(S, WT) • to NI FIFO: read status, chk, write, . . . • from NI FIFO: read status, chk, dispatch, read, . . . 3/5/99 CS 258 S 99 35

Virtual DMA -> Virtual DMA s. DMA r. DMA Memory CP Registers MP 2

Virtual DMA -> Virtual DMA s. DMA r. DMA Memory CP Registers MP 2 1. 5 Net MP 2 2 MP 2 CP 2 7 wds Cache User OQ hdr 400 MB/s 2048 Net FIFO 400 MB/s User IQ 2048 175 MB/s • Send MP segments into 8 K pages and does VA –> PA • Recv MP reassembles, does dispatch and VA –> PA per page 3/5/99 CS 258 S 99 36

Single Page Transfer Rate Effective Buffer Size: 3232 Actual Buffer Size: 2048 3/5/99 CS

Single Page Transfer Rate Effective Buffer Size: 3232 Actual Buffer Size: 2048 3/5/99 CS 258 S 99 37

Msg Processor Assessment VAS User Output Queues User Input Queues Compute Processor Kernel DMA

Msg Processor Assessment VAS User Output Queues User Input Queues Compute Processor Kernel DMA done System Event Send DMA Dispatcher Rcv FIFO ~Full Rcv DMA Send FIFO ~Empty • Concurrency Intensive – Need to keep inbound flows moving while outbound flows stalled – Large transfers segmented • Reduces overhead but adds latency 3/5/99 CS 258 S 99 38