Fast Distributed Process Creation with the XMOS XS1 Architecture - - PowerPoint PPT Presentation

fast distributed process creation with the xmos xs1
SMART_READER_LITE
LIVE PREVIEW

Fast Distributed Process Creation with the XMOS XS1 Architecture - - PowerPoint PPT Presentation

Fast Distributed Process Creation with the XMOS XS1 Architecture James Hanlon Department of Computer Science University of Bristol, UK 20 th June 2011 Introduction Processors as a resource Scalable parallel programming Contributions


slide-1
SLIDE 1

Fast Distributed Process Creation with the XMOS XS1 Architecture

James Hanlon

Department of Computer Science University of Bristol, UK

20th June 2011

slide-2
SLIDE 2

Introduction Processors as a resource Scalable parallel programming Contributions Implementation Platform Explicit processor allocation Demonstration & evaluation Rapid process distribution Sorting Conclusions Future work

slide-3
SLIDE 3

Processors as a resource

◮ Current parallel programming models provide little support for

management of processors.

◮ Many are closely coupled to the machine and parameterised by the

number of processors.

◮ The programmer is left responsible for scheduling processes on

the underlying system.

◮ As the level of parallelism increases (106 processes at exascale), it

is clear that we require a means to automatically allocate processors.

◮ We don’t expect to have to write our own memory allocation

routines!

slide-4
SLIDE 4

Scalable parallel programming

◮ For parallel computations to scale it will be necessary to express

programs in an intrinsically parallel manner, focusing on dependencies between processes.

◮ Excess parallelism enables scalability (parallel slackness hides

communication latency).

◮ It is also more expressive:

◮ For irregular and unbounded structures. ◮ Allows composite structures and construction of parallel

subroutines.

◮ The scheduling of processes and allocation of processors is then a

property of the language and runtime.

◮ But this requires the ability to rapidly initiate processes and collect

results from them as they terminate.

slide-5
SLIDE 5

Contributions

  • 1. The design of an explicit, lightweight scheme for distributed

dynamic processor allocation.

  • 2. A convincing proof-of-concept implementation on a sympathetic

architecture.

  • 3. Predictions for larger systems based on accurate performance

models.

slide-6
SLIDE 6

Platform

◮ XMOS XS1 architecture:

◮ General-purpose, multi-threaded, message-passing and scalable. ◮ Primitives for threading, synchronisation and communication

execute in same time as standard load/store, branch and arithmetic

  • perations.

◮ Support for position independent code. ◮ Predictable.

◮ XK-XMP-64:

◮ Experimental board with 64 XCore processors connected in a

hypercube.

◮ 64kB of memory and 8 hardware threads per core. ◮ Aggregate 512-way concurrency, 25.6 GIPS and 4MB RAM.

◮ A bespoke language and runtime with a simple set of features to

demonstrate and experiment with distributed process creation.

slide-7
SLIDE 7

Explicit processor allocation: notation

◮ Processor allocation is exposed in the language with the on

statement:

  • n p do Q

This executes process Q synchronously on processor p.

◮ The execution of all processes are implicitly on the current

processor.

◮ We can compose on in parallel to exploit multi-threaded

parallelism:

{ Q1 || on p do Q2 }

which offloads and executes Q2 while executing Q1.

◮ Processes must be disjoint.

slide-8
SLIDE 8

Explicit processor allocation: implementation

source host Form C(P)

◮ on forms a closure C of process P including the variable context

and a list of procedures including P and those it calls.

slide-9
SLIDE 9

Explicit processor allocation: implementation

source host

◮ on forms a closure C of process P including the variable context

and a list of procedures including P and those it calls.

◮ A connection is initialised between the source and host processors

and the host creates a new thread for the incoming process.

slide-10
SLIDE 10

Explicit processor allocation: implementation

source host C(P)

◮ on forms a closure C of process P including the variable context

and a list of procedures including P and those it calls.

◮ A connection is initialised between the source and host processors

and the host creates a new thread for the incoming process.

◮ It then receives C(P) and initialises P on the new thread.

slide-11
SLIDE 11

Explicit processor allocation: implementation

source host Initialise P

◮ on forms a closure C of process P including the variable context

and a list of procedures including P and those it calls.

◮ A connection is initialised between the source and host processors

and the host creates a new thread for the incoming process.

◮ It then receives C(P) and initialises P on the new thread.

◮ All call branches are performed through a table (with the instruction

BLACP) so the host updates this to record the new address of each procedure contained in C.

slide-12
SLIDE 12

Explicit processor allocation: implementation

source host Updates

◮ on forms a closure C of process P including the variable context

and a list of procedures including P and those it calls.

◮ A connection is initialised between the source and host processors

and the host creates a new thread for the incoming process.

◮ It then receives C(P) and initialises P on the new thread.

◮ All call branches are performed through a table (with the instruction

BLACP) so the host updates this to record the new address of each procedure contained in C.

◮ When P has terminated, the host sends back any updated free

variables of P stored at the source (as P is disjoint).

slide-13
SLIDE 13

Rapid process distribution

◮ We can combine recursion and parallelism to rapidly generate

processes: proc distribute (t, n) is if n = 1 then node (t) else

{ distribute (t, n/2) || on t + n/2 do distribute (t + n/2, n/2) }

◮ This distributes the process node over n processors in O(log n)

time.

◮ The execution of distribute (0, 4) proceeds in time and space:

p0 p1 p2 p3

slide-14
SLIDE 14

Rapid process distribution

◮ We can combine recursion and parallelism to rapidly generate

processes: proc distribute (t, n) is if n = 1 then node (t) else

{ distribute (t, n/2) || on t + n/2 do distribute (t + n/2, n/2) }

◮ This distributes the process node over n processors in O(log n)

time.

◮ The execution of distribute (0, 4) proceeds in time and space:

p0 p1 p2 p3 distribute (0,4)

slide-15
SLIDE 15

Rapid process distribution

◮ We can combine recursion and parallelism to rapidly generate

processes: proc distribute (t, n) is if n = 1 then node (t) else

{ distribute (t, n/2) || on t + n/2 do distribute (t + n/2, n/2) }

◮ This distributes the process node over n processors in O(log n)

time.

◮ The execution of distribute (0, 4) proceeds in time and space:

p0 p1 p2 p3 distribute (0,4) distribute (0,2) distribute (2,2)

slide-16
SLIDE 16

Rapid process distribution

◮ We can combine recursion and parallelism to rapidly generate

processes: proc distribute (t, n) is if n = 1 then node (t) else

{ distribute (t, n/2) || on t + n/2 do distribute (t + n/2, n/2) }

◮ This distributes the process node over n processors in O(log n)

time.

◮ The execution of distribute (0, 4) proceeds in time and space:

p0 p1 p2 p3 distribute (0,4) distribute (0,2) distribute (2,2) distribute (0,1) distribute (1,1) distribute (2,1) distribute (3,1)

slide-17
SLIDE 17

Rapid process distribution

◮ We can combine recursion and parallelism to rapidly generate

processes: proc distribute (t, n) is if n = 1 then node (t) else

{ distribute (t, n/2) || on t + n/2 do distribute (t + n/2, n/2) }

◮ This distributes the process node over n processors in O(log n)

time.

◮ The execution of distribute (0, 4) proceeds in time and space:

p0 p1 p2 p3 distribute (0,4) distribute (0,2) distribute (2,2) distribute (0,1) distribute (1,1) distribute (2,1) distribute (3,1) node (0) node (1) node (2) node (3)

slide-18
SLIDE 18

Rapid process distribution: execution time

20 40 60 80 100 120 10 20 30 40 50 60 Time (µs) Processors Predicted Measured

◮ 114.60µs (11,460 cycles) for 64 processors. ◮ Predicted 190µs for 1024 processors.

slide-19
SLIDE 19

Mergesort

◮ Same structure as distribute but with work performed at leaves.

p0 p0 p0 p0 p1 p2 p2 p3 p4 p4 p4 p5 p6 p6 p7 p0 p4 p6 p4 p0 p2 p0

slide-20
SLIDE 20

Mergesort: execution time I

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1 2 4 8 16 32 64 Time (ms) Processors Process distribution 256B 512B 1kB

◮ Minimum when input array is subdivided into 64B sections.

slide-21
SLIDE 21

Mergesort: execution time II

◮ Measured (up to 64 cores) and predicted (up to 1024 cores) for

256B input. 0.0001 0.001 0.01 0.1 1 10 1 2 4 8 16 32 64 128 256 512 1024 Time (ms) Processors Processes Processes and data Runtime

slide-22
SLIDE 22

Mergesort: execution time III

◮ Predicted up to 1024 cores for 1GB input.

0.001 0.01 0.1 1 10 100 1000 10000 100000 1e+06 1 2 4 8 16 32 64 128 256 512 1024 Time (ms) Processors Processes Processes and data Runtime

◮ Single-source data-distribution is a worst-case.

slide-23
SLIDE 23

Conclusions

◮ We have built a lightweight mechanism for dynamically allocating

processors in a distributed system.

◮ Combined with recursion we can rapidly distribute processes: over

64 processors in 114.60µs.

◮ It is possible to operate at a fine granularity: creation of a remote

process to operate on just 64B data.

◮ We can establish a lower bound on the performance of the

approach.

◮ Distribution over 1024 processors in ∼200µs (20,000 cycles).

◮ This scheme works well with large arrays of processors with small

memories and allows you to express programs to exploit this.

◮ Don’t need powerful cores with large memories. ◮ Emphasis changes from data structures to process structures.

slide-24
SLIDE 24

Future work

  • 1. Automatic placement of processes.
  • 2. MPI implementation for evaluation on and comparison with

supercomputer architectures.

  • 3. Optimisation of processor allocation mechanism such as pipelining

the reception and execution of closures.

slide-25
SLIDE 25

Any questions?

Email:

hanlon@cs.bris.ac.uk

Project web page:

http://www.cs.bris.ac.uk/~hanlon/sire