Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to...

71
fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU Dortmund Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 2008/12/14

Transcript of Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to...

Page 1: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

fakultät für informatikinformatik 12

technische universität dortmund

Mapping of Applicationsto Multi-Processor

Systems

Peter MarwedelInformatik 12TU Dortmund

Germany

Gra

phic

s: ©

Ale

xand

ra N

olte

, Ges

ine

Mar

wed

el, 2

003

2008/12/14

Page 2: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 2 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Structure of this course

New clustering

2: Specifications

3: Embedded System HW

4: Standard Software, Real-Time Operating Systems

5: Scheduling,HW/SW-Partitioning, Applications to MP-Mapping

6: Evaluation

8: Testing

7: Optimization of Embedded Systems

App

licat

ion

Kno

wle

dge

[Digression: Standard Optimization Techniques (1 Lecture)]

Page 3: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 3 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Energy Efficiency

Cou

rtes

y: P

hilip

s

© Hug

o D

e M

an,

IME

C,

200

7

IPE=Inherent power efficiencyAmI=Ambient Intelligence

GO

Ps/

J

Page 4: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 4 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Heterogeneous Architectures

http

://w

ww

.mps

oc-f

orum

.org

/200

7/sl

ides

/Hat

tori.

pdf

Page 5: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 5 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Homogeneous Architectures

© J. Goodacre,ARM, 2008

Page 6: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 6 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Problem Description

Given A set of applications Scenarios on how these applications will be used A set of candidate architectures comprising

• (Possibly heterogeneous) processors• (Possibly heterogeneous) communication architectures• Possible scheduling policies

Find A mapping of applications to processors Appropriate scheduling techniques (if not fixed) A target architecture (if DSE is included)

Objectives Keeping deadlines and/or maximizing performance Minimizing cost, energy consumption

Page 7: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 7 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Key distinctions between parallel processingfor embedded applications and PC-like systems

Embedded PC-like

Architectures Frequently heterogeneous,very compact

Mostly homogeneous,not compact (x86 etc)

x86 compatibility Not relevant Very relevant

Architecture fixed? Sometimes not Yes

MoCs C+multiple MoCs (SDF, …) Mostly von Neumann

Applications Several concurrent apps. Mostly single app.

Apps. known at design time

Most, if not all Only some (WORD, ..)

Objectives Multiple (energy, size, …) Average performance dominating

Real-time relevant Yes (!) Hardly

Page 8: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 8 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Practical problem in automotive design

Which processor should run the software?

Page 9: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 9 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Focus of the ArtistDesign Network

1st Workshop on Mapping ApplicationsTo MPSoCs, Rheinfels castle, June, 2008 Future architectures of MPSoCs (John Goodacre, ARM) SPEA2 (Lothar Thiele, ETHZ) Car-Entertainment Applications -> MP Systems (Marco Bekooij, NXP) MAPS (Rainer Leupers, Aachen) Overview over parallelization techniques (C. Lengauer, U. Passau) DSE of Heterogeneous MPSoCs (Ristau, Fettweis, TU Dresden) Daedalus (Ed Deprettere, U. Leiden) Mapping to the CELL processor (U. Bologna and others) Timing analysis issues (various)

Programme and slides: http://www.artist-embedded.org/artist/-Mapping-of-Applications-to-MPSoCs-.html

Page 10: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 10 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Related Work

Scheduling theory:Provides insight for the mapping task start times

Hardware/software partitioning:Can be applied if it supports multiple processors

High performance computing (HPC)Automatic parallelization, but only for

• single applications,• fixed architectures,• no support for scheduling,• memory and communication model usually different

High-level synthesisProvides useful terms like scheduling, allocation, assignment

Optimization theory

Page 11: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 11 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

A Simple Classification

Architecture fixed/Auto-parallelizing

Fixed Architecture Architecture to be designed

Starting from given model

Map to CELL, HOPES, ETHAM

COOL codesign tool;

EXPO/SPEA2

Auto-parallelizing Franke, O’Boyle et al.,Mnemee

Daedalus

MAPS

Page 12: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 12 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

A fixed architecture approach: Map CELL

Martino Ruggiero, Luca Benini: Mapping task graphs to the CELL BE processor, 1st Workshop on Mapping of Applications to MPSoCs, Rheinfels Castle, 2008

Page 13: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 13 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Partitioning into Allocation and Scheduling

R

© Ruggiero, Benini, 2008

Page 14: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 14 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 15: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 15 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 16: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 16 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 17: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 17 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 18: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 18 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 19: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 19 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 20: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 20 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 21: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 21 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 22: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 22 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Page 23: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 23 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Related work

ETHAM: An Energy-Aware Task Allocation Algorithm for Heterogeneous Multiprocessor (Chang et al. – DAC’08) Input: Directed Acyclic Task Graph (DAG) Combines mapping, scheduling + DVS utilization in 1 step Builds tree with all possible solutions Uses Ant Colony Optimizations (ACO) on this tree

Temperature Aware Task Scheduling in MPSoCs (Coskun et al. – DATE’07) Higher reliability through temperature optimized dynamic

OS scheduling Strategy is called “Adaptive Random” Considers history of core’s temperate for scheduling

Session on Task Mapping @ DATE 2009

Page 24: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 24 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

A Simple Classification

Architecture fixed/Auto-parallelizing

Fixed Architecture Architecture to be designed

Starting from given model

Map to CELL, HOPES, ETHAM

COOL codesign tool;

EXPO/SPEA2

Auto-parallelizing Franke, O’Boyle et al.Mnemee

Daedalus

MAPS

Page 25: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 25 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Design Space

Scheduling/Arbitration

proportionalshareWFQ

staticdynamicfixed priority

EDFTDMA

FCFS

Communication Templates

Architecture # 1 Architecture # 2

Computation Templates

DSP

E

Cipher

SDRAMRISC

FPGA

LookUp

DSP

TDMA

Priority

EDF

WFQ

RISC

DSP

LookUp

Cipher

E E E

E E E

static

Which architecture is better suited for our application?

© L. Thiele, ETHZ

Page 26: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 26 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Target Platform

Communication

micro-network on chip for synchronization and data exchange consisting of busses, routers, drivers

some critical issues: topology, switching strategies (packet, circuit), routing strategies (static – reconfigurable – dynamic), arbitration policies (dynamic, TDM, CDMA, fixed priority)

challenges: heterogeneous components and requirements, compose network that matches the traffic characteristics of a given application (domain)

© L. Thiele, ETHZ

Page 27: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 27 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Mapping Scenario: Overview

Given1. specification of the task structure (task model) = for each flow the

corresponding tasks to be executed2. different usage scenarios (flow model)

Soughtprocessor implementation (resource model) =

architecture* + task mapping + schedulingObjectives:

1. maximize performance2. minimize cost

Subject to:1. memory constraints2. delay constraints

*: 2 cases:1. fixed architecture2. architecture to be designed

based on Thiele’s slides

(performance model)

Page 28: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 28 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Example: System Synthesis

© L. Thiele, ETHZ

Page 29: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 29 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Basic Model – Problem Graph

© L. Thiele, ETHZ

Page 30: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 30 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Basic Model – architecture graph

© L. Thiele, ETHZ

Page 31: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 31 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Basic Model: Specification Graph

© L. Thiele, ETHZ

Page 32: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 32 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Basic model - synthesis

© L. Thiele, ETHZ

Page 33: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 33 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Basic model - implementation

© L. Thiele, ETHZ

Page 34: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 34 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Example

© L. Thiele, ETHZ

Page 35: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 35 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Evolutionary Algorithmsfor Design Space Exploration (DSE)

© L. Thiele, ETHZ

Page 36: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 36 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Challenges

© L. Thiele, ETHZ

Page 37: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 37 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Exploration Cycle

EXPO – Tool architecture (1)

MOSES

EXPO SPEA 2

selectionof “good” architectures

system architectureperformance values

task graph, scenario graph,

flows & resources

© L. Thiele, ETHZ

Page 38: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 38 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

EXPO – Tool architecture (2)

Tool available online:http://

www.tik.ee.ethz.ch/expo/expo.html

Tool available online:http://

www.tik.ee.ethz.ch/expo/expo.html

© L. Thiele, ETHZ

Page 39: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 39 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

EXPO – Tool (3)

© L. Thiele, ETHZ

Page 40: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 40 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Application Model

Example of a simple stream processing task structure:

© L. Thiele, ETHZ

Page 41: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 41 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Exploration – Case Study (1)

© L. Thiele, ETHZ

Page 42: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 42 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Exploration – Case Study (2)

© L. Thiele, ETHZ

Page 43: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 43 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Exploration – Case Study (3)

© L. Thiele, ETHZ

Page 44: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 44 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

EA Case Study – Design Space

© L. Thiele, ETHZ

Page 45: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 45 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Exploration Case Study – Solution 1

© L. Thiele, ETHZ

Page 46: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 46 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Exploration Case Study – Solution 2

© L. Thiele, ETHZ

Page 47: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 47 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

More Results

Performance for encryption/decryptio

nPerformance forRT voice processing

© L. Thiele, ETHZ

Page 48: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 48 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

A 2nd approach based on evolutionary algorithms:SYMTA/S:

[R. Ernst et al.: A framework for modular analysis and exploration of

heteterogenous embedded systems, Real-time Systems, 2006, p. 124]

Page 49: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 49 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Additional Contributions

SystemCoDesigner (Teich et al.)

Compaan (B. Kienhuis et al.)

Milan (J. David et al.)

Charmed (S. Bhattacharyya et al.)

Metropolis (A. Sangiovanni-Vincentelli et al.)

Page 50: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 50 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

A Simple Classification

Architecture fixed/Auto-parallelizing

Fixed Architecture Architecture to be designed

Starting from given model

Map to CELL, HOPES, ETHAM

COOL codesign tool;

EXPO/SPEA2

Auto-parallelizing Franke, O’Boyle et al.Mnemee

Daedalus

MAPS

Page 51: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 51 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Daedalus Design-flow

System-level synthesis

Library ofIP cores

Platform specification

Sequentialapplication

Parallel application specification

AutomaticParallelization

High-levelModels

Mappingspecification

System-level design space exploration

Explore, modify, select instances

Multi-processor System on Chip(Synthesizable VHDL and C/C++ code for processors)

RTL-levelModels

Common XMLInterface

Library ofIP cores

KPNgenSesame

ESPAM

Xilinx Platform Studio (XPS)

RTL-LevelSpecification

System-LevelSpecification

Synthesizable VHDL

C/C++ code for processors

MP-SoC

Kahn Process Network

Sequentialapplication

© E. Deprettere,U. Leiden

Ed Deprettere et al.: Toward Composable Multimedia MP-SoC Design,1st Workshop on Mapping of Applications to MPSoCs, Rheinfels Castle, 2008

Page 52: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 52 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Example architecture instances for a single-tile JPEG encoder:

JPEG/JPEG200 case study

2 MicroBlaze processors (50KB) 1 MicroBlaze, 1HW DCT (36KB)

6 MicroBlaze processors (120KB) 4 MicroBlaze, 2HW DCT (68KB)

Vin

8KB

4x2KB

4x2KB

4x16KB

32KB

16KB 32KB2KB

32KB

2KB

2KB 2KB

2KB2KB 2KB

8KB

8KB

8KB

32KB 4KB

VLE, Vout

DCT, Q

DCT, Q

DCT, Q

DCT, Q

Vin,DCT Q,VLE,Vout Vin,Q,VLE,Vout

Vin

Q

Q

VLE, Vout

DCT

DCT

DCT

© E. Deprettere,U. Leiden

Page 53: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 53 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Sesame DSE results: Single JPEG encoder DSE

© E. Deprettere,U. Leiden

Page 54: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 54 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

A Simple Classification

Architecture fixed/Auto-parallelizing

Fixed Architecture Architecture to be designed

Starting from given model

Map to CELL, HOPES, ETHAM

COOL codesign tool;

EXPO/SPEA2

Auto-parallelizing Franke, O’Boyle et al.Mnemee

Daedalus

MAPS

Page 55: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 55 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

MAPS-TCT Framework

Rai

ner

Leup

ers,

Wei

hua

She

ng:

MA

PS

: A

n In

tegr

ated

Fra

mew

ork

for

MP

SoC

App

licat

ion

Par

alle

lizat

ion,

1st

Wor

ksho

p on

Map

ping

of

App

licat

ions

to

MP

SoC

s, R

hein

fels

Cas

tle,

2008

© Leupers, Sheng, 2008

Page 56: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 56 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

MAPS: MPSoC Application Programming Studio

© Leupers, Sheng, 2008

Page 57: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 57 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

A Simple Classification

Architecture fixed/Auto-parallelizing

Fixed Architecture Architecture to be designed

Starting from given model

Map to CELL, HOPES, ETHAM

COOL codesign tool;

EXPO/SPEA2

Auto-parallelizing Franke, O’Boyle et al.Mnemee

Daedalus

MAPS

Page 58: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 58 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Auto-Parallelizing Compilers

Discipline “High Performance Computing”: Research on vectorizing compilers for more than 25 years. Traditionally: Fortran compilers. Such vectorizing compilers usually inappropriate for Multi-

DSPs, since assumptions on memory model unrealistic:

Communication between processors via shared memory

Memory has only one single common address space

De Facto no auto-parallelizing compiler for Multi-DSPs!

© Falk, 2008

Page 59: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 59 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Auto-Parallelizing Compilers (2)

LooPo (C. Lengauer et al.)

Various commercial compilers

Mostly focusing on HPC

Page 60: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 60 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Workflow of Auto-Parallelization for Multi-DSPs(B. Franke, M. O’Boyle)

Program Recovery Removal of undesired low-level constructs in IR Replacement by equivalent high-level constructs

Parallelism Detection Identification of parallelizable loops

Partitioning and Mapping of Data Minimization of communication overhead between DSPs

Memory Access Localization Minimization of accesses to remote memories

Data Transfer Optimization Exploitation of DMA for burst transfers

Beyond Loop Parallelization and Static Analysis

© Falk, 2008

Page 61: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 61 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Problems with Real Codes

“Hand-optimized” for specific platform

• E.g. pointer based array traversals for efficient address calculation

Unusual idioms to implement frequently used operations

• E.g. modulo operations in array index expressions for circular buffers

Defeat auto-parallelization!

• “Plain C” is best for parallelization

• Need to recover canonical program representation

© Björn Franke, 2008

Page 62: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 62 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Program Recovery- Eliminate Pointer Conversion -

int A[N],B[N],C[N];

int *ptr_a = &A[0];

int *ptr_b = &B[0];

int *ptr_c = &C[N-1];

for (i = 0; i < N; i++)

{

*ptr_a++ = *ptr_b++ * *ptr_c--;

}

© Björn Franke, 2008

Affine array index expressions are critical!

int A[N],B[N],C[N];

for (i = 0; i < N; i++){ A[i] = B[i] * C[N-i-1];}

Affine Index Expressions

Page 63: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 63 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Program Recovery- Modulo Elimination -

int A[N], B[M];

for (i = 0; i < N; i++){ X = A[i] * B[i%M];}

© Björn Franke, 2008

Affine array index expressions are critical!

int A[N], B[M];

for (i = 0; i < N/M; i++){ for (j = 0; j < M; j++) { X = A[i*M+j] * B[j]; }}

Affine Index Expressions

Page 64: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 64 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Rank Modifying Code and Data Transformations

Unified Linear Algebra Framework for Code and Data Transformations

Extensions to Unimodular Transformations

• Elements of transformation matrix are functions with div & mod

Representation of additional transformations

• Array dimensionality transformations

• Strip-mining and linearization of loops

© Björn Franke, 2008

Page 65: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 65 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Coarse Grain Parallelism & Task Graph Extraction

Profiling Infrastructure

© Björn Franke, 2008

Page 66: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 66 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Coarse Grain Parallelism & Task Graph Extraction

© Björn Franke, 2008

Page 67: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 67 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Coarse Grain Parallelism & Task Graph Extraction

© Björn Franke, 2008

Page 68: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 68 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Memory architecture aware compilation:Proposed Mnemee Tool Flow (Simplified)

Mnemee=Memory management technology for adaptive and efficient design of embedded systems,

(European Project: IMEC, Dortmund, Eindhoven, U. Athens, Intracom, Thales)

C-Source Codes

C-Source Codes

C-Source Codes

Task Graph Extraction

Task To Processor -

Mapping

MemoryOptimization

sCompilation

Load Time Optimization

Run Time Optimization

ArchitectureArchi-tecture

GUI

Using ICD-C Compiler Tool-Box (www.icd.de/es)

Page 69: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 69 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Future Work

Implementation of the Mnemee tool flow

2nd Workshop on Mapping ofApplications to MPSoCs

• To be held June 29-30, 2009,at Rheinfels Castle

• Information:http://www.artist-embedded.org/artist/Mapping-Applications-to-MPSoCs.html

Work by other researchers inthe area

Page 70: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 70 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Summary (1)

Mapping applications onto heterogeneous MP systems needs

allocation (if hardware is not fixed)

binding of tasks to resources

scheduling

There exists a large design space

Evolutionary algorithms currently are the only algorithms known to solve the existing multi-objective optimization problems.

Details on the encoding, optimization strategies etc. are available in papers by L. Thiele et al. (ETH Zürich) and R. Ernst (TU Braunschweig)

Page 71: Fakultät für informatik informatik 12 technische universität dortmund Mapping of Applications to Multi-Processor Systems Peter Marwedel Informatik 12 TU.

- 71 -technische universitätdortmund

fakultät für informatik

p. marwedel, informatik 12, 2008

Summary (2)

Clear trend toward multi-processor systems for embedded systems

Using architecture crucially depends on mapping tools ArtistDesign network cluster focusing on mapping Providing an overview of available techniques Two criteria for classification

• Fixed / flexible architecture• Auto parallelizing / non-parallelizing

Introduction to proposed Mnemee tool chain Future work Summary