Leveraging Prior Knowledge for Effective Design-Space Exploration - - PowerPoint PPT Presentation

leveraging prior knowledge for effective design space
SMART_READER_LITE
LIVE PREVIEW

Leveraging Prior Knowledge for Effective Design-Space Exploration - - PowerPoint PPT Presentation

Universit della Svizzera italiana Leveraging Prior Knowledge for Effective Design-Space Exploration in High-Level Synthesis Authors: Lorenzo Ferretti 1 , Jihye Kwon 2 , Giovanni Ansaloni 1 , Giuseppe Di Guglielmo 2 , Luca Carloni 2 , Laura


slide-1
SLIDE 1

Leveraging Prior Knowledge for Effective Design-Space Exploration in High-Level Synthesis

Università della Svizzera italiana

Lorenzo Ferretti1, Jihye Kwon2, Giovanni Ansaloni1, Giuseppe Di Guglielmo2, Luca Carloni2, Laura Pozzi1,

1 Università della Svizzera italiana, Lugano, Switzerland 2 Columbia University, New York, United States

Authors: ESWEEK 2020

slide-2
SLIDE 2

Area Latency

for(i;i<10;i++){ A[i] = B[i]*i; } bar(&A,&B);

HLS Loop unrolling

2

Motivation

Software description Hardware description Application

slide-3
SLIDE 3

for(i;i<10;i++){ A[i] = B[i]*i; } bar(&A,&B);

Area Latency

Loop unrolling Function inlining HLS

3

Motivation

Application Software description Hardware description

slide-4
SLIDE 4

Area Latency

Loop unrolling Function inlining

for(i;i<10;i++){ A[i] = B[i]*i; } bar(&A,&B);

HLS

4

Motivation

Application Software description Hardware description

slide-5
SLIDE 5

5

Table of Contents

✓ Motivation ➡ HLS-driven Design Space Exploration

  • State of the Art
  • The Idea: Leveraging Prior Knowledge
  • The Methodology
  • Signature Encoding
  • Similarity Evaluation
  • Inference Process
  • Results
slide-6
SLIDE 6

Goal: get close to the Pareto solutions while minimising the number of synthesis.

Legend

Synthesised configurations Pareto configurations Exhaustive configurations

x

Design space exploration problem

Area Latency

6

HLS-driven Design Space Exploration (DSE)

slide-7
SLIDE 7

7

HLS-driven Design Space Exploration (DSE)

Goal: get close to the Pareto solutions while minimising the number of synthesis.

Legend

Synthesised configurations Pareto configurations Exhaustive configurations

x

Design space exploration problem

Area Latency

slide-8
SLIDE 8

8

HLS-driven Design Space Exploration (DSE)

Goal: get close to the Pareto solutions while minimising the number of synthesis.

Legend

Synthesised configurations Pareto configurations Exhaustive configurations

x

Design space exploration problem

Area Latency

slide-9
SLIDE 9

9

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

➡ State of the Art for DSE

  • The Idea: Leveraging Prior Knowledge
  • The Methodology
  • Signature Encoding
  • Similarity Evaluation
  • Inference Process
  • Results
slide-10
SLIDE 10

MODEL

Area Latency C/C++ HLS directives

10

State of the Art for DSE

Two main approaches:

  • Model-based methodologies

[11] Zhong et al. International Conference on Computer Design, 2014. [12] N. K. Pham et al. Design, Automation Test in Europe Conference Exhibition, 2015. [13] Zhong et al. International Conference on Computer Design, 2016. [14] J. Zhao et al. International Conference on Computer Aided Design, 2017.

slide-11
SLIDE 11

MODEL

Area Latency C/C++ HLS directives Training set

11

State of the Art for DSE

Two main approaches:

  • Model-based methodologies
  • Black-box-based methodologies
  • Training-based
  • Refinement-based

[15] Schafer et al. IET Computers & Digital Techniques, 2012. [16] A. Mahapatra et al, Electronic System Level Synthesis Conference, 2014

,
slide-12
SLIDE 12

12

State of the Art for DSE

Two main approaches:

  • Model-based methodologies
  • Black-box-based methodologies
  • Training-based
  • Refinement-based

MODEL

Area Latency C/C++ HLS directives

[8] H. Liu et al. Design Automation Conference, 2013. [9] L. Ferretti et al. IEEE Transactions on Emerging Topics in Computing, 2018. [10] L. Ferretti et al. International Conference on Computer Design, 2018. [11] Zhong et al. International Conference on Computer Design, 2014.

slide-13
SLIDE 13

13 13

State of the Art for DSE

Two main approaches:

  • Model-based methodologies
  • Black-box-based methodologies
  • Training-based
  • Refinement-based

MODEL

Area Latency C/C++ HLS directives

[8] H. Liu et al. Design Automation Conference, 2013. [9] L. Ferretti et al. IEEE Transactions on Emerging Topics in Computing, 2018. [10] L. Ferretti et al. International Conference on Computer Design, 2018. [11] Zhong et al. International Conference on Computer Design, 2014.

slide-14
SLIDE 14

14

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

✓ State of the Art for DSE ➡ The Idea: Leveraging Prior Knowledge

  • The Methodology
  • Signature Encoding
  • Similarity Evaluation
  • Inference Process
  • Results
slide-15
SLIDE 15

15

The Idea: Leveraging Prior Knowledge

Standard approach

XT XT P(T, XT)

XT Set of configurations explored in the DSE of a design T. P(T, XT) Set of Pareto-optimal configurations identified with the DSE of T.

slide-16
SLIDE 16

16

The Idea: Leveraging Prior Knowledge

Leveraging Prior Knowledge approach

g(.) XS XS P(S, XS) XT XT

S

P(T, XT) P(T, XT) P(T, XT) XT

S

= ^

XS Set of configurations explored in the DSE of a design S. P(S, XS) Set of Pareto-optimal configurations identified with the DSE of S. XT Set of configurations explored in the DSE of a design T. P(T, XT) Set of Pareto-optimal configurations identified with the DSE of T. P(T, XS) = P(T, XT) Approximation of the Pareto-optimal configurations of S obtained synthesizing the configuration inferred through g(.) from P(T, XT).

XT

^

XT

S

slide-17
SLIDE 17

17

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

✓ State of the Art for DSE ✓ The Idea: Leveraging Prior Knowledge ➡ The Methodology

  • Signature Encoding
  • Similarity Evaluation
  • Inference Process
  • Results
slide-18
SLIDE 18

18

The Methodology

Design &

  • Config. Space

DSEs database Target signature Inference process Synthesised designs Similarity evaluation Source signature Target configurations Signature encoding

A B C

HLS tool

Area Latency

slide-19
SLIDE 19

19

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

✓ State of the Art for DSE ✓ The Idea: Leveraging Prior Knowledge ✓ The Methodology ➡ Signature Encoding

  • Similarity Evaluation
  • Inference Process
  • Results
slide-20
SLIDE 20

20

The Methodology: Signature Encoding

A DSE is characterized with a simplified compact representation that abstracts the specification (code) and the associated configurations (set of applied directives). Signature encoding : Specification Encoding & Configuration Space Descriptor The Specification Encoding (SE) is a simplified representation

  • f the original code describing those

aspects of an HLS-application that can be targeted by HLS directives. The Configuration Space Descriptor (CSD) describes the user-defined configuration space indicating the set of

  • ptimisations type and values considered

for the DSE.

slide-21
SLIDE 21

21

The Methodology: Signature Encoding

Specification Encoding (SE): simplified representation of the original code automatically generated trough a compiler pass with LLVM.

Specification Encoding symbols:

  • Functions —> F
  • Function parameter passed by value—> V
  • Function parameter passed by reference —> P
  • Arrays definition or declaration—> A
  • Structs definition or declaration —> S
  • Loops —> L
  • Load operations (e.g. a = Array[0]) —> R
  • Store operations (e.g Array[0] = a) —> W
  • Function call —> C#<function_name>#
  • Scope —> {}

void last_step_scan(int bucket[BUCKETSIZE], int sum[SCAN_RADIX]) { int radixID, i, bucket_indx; last_1:for (radixID=0; radixID<SCAN_RADIX; radixID++) { last_2:for (i=0; i<SCAN_BLOCK; i++) { bucket_indx = radixID * SCAN_BLOCK + i; bucket[bucket_indx] = bucket[bucket_indx] + sum[radixID]; } } }

F{PP}L{L{RRW}}

LLVM pass

Running Example

slide-22
SLIDE 22

22

The Methodology: Signature Encoding

Configuration Space Descriptor (CSD): a DSL is created to describe the optimisations type and values considered for the DSE. A CSD defines entirely the user-defined configuration space.

void last_step_scan(int bucket[BUCKETSIZE], int sum[SCAN_RADIX]) { int radixID, i, bucket_indx; last_1:for (radixID=0; radixID<SCAN_RADIX; radixID++) { last_2:for (i=0; i<SCAN_BLOCK; i++) { bucket_indx = radixID * SCAN_BLOCK + i; bucket[bucket_indx] = bucket[bucket_indx] + sum[radixID]; } } }

Example of CSD:

resource;last_step_scan;bucket;{RAM_2P_BRAM} resource;last_step_scan;sum;{RAM_2P_BRAM} array_partition;last_step_scan;bucket;1; {cyclic,block};{1->512,pow_2} array_partition;last_step_scan;sum;1; {cyclic,block};{1->128,pow_2} unroll;last_step_scan;last_1;{1->128,pow_2} unroll;last_step_scan;last_2;{1,2,4,8,16} clock;{10}

Directive type Location Set of directive values Knob Running Example

slide-23
SLIDE 23

23

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

✓ State of the Art for DSE ✓ The Idea: Leveraging Prior Knowledge ✓ The Methodology ✓ Signature Encoding ➡ Similarity Evaluation

  • Inference Process
  • Results
slide-24
SLIDE 24

24

The Methodology: Similarity Evaluation

Similarity Evaluation: in order to identify the proper source for the inference process the similarity among a target DSE and the available source is calculated. The similarity function (Sim) is given by a linear combination of Signature Encoding similarity (SimSE) and Configuration Space Descriptor similarity (SimCSD).

Sim = αSimSE + (1 − α)SimCSD α ∈ [0,1] SimSE = LCS(SET, SES) SimCSD = 1 − [ 1 I

I

i=1

Δ(Ki, MT,S(Ki))/DMAX] Δ(Ki, Kj) =

|Ki|

n=1

(

|Kj|

min

m=1 |δ(kn, km)|)2

kn ∈ Ki, km ∈ Kj δ(kn, km) =

Z

z=1

|kn,z, km,z|2

slide-25
SLIDE 25

F{PP}L{L{RRW}}

25

The Methodology: Similarity Evaluation

CSD similarity: measures the similarity among knobs of target and source CSDs. F{PPP}L{L{RRW}} SESource

array_partition;get_delta_matrix_weights2;delta_weights2;1; {cyclic,block};{1->256,pow_2} array_partition;get_delta_matrix_weights2;output_difference; 1;{cyclic,block};{1->64,pow_2} array_partition;get_delta_matrix_weights2;last_activations; 1;{cyclic,block};{1->64,pow_2} unroll;get_delta_matrix_weights2;loop_1;{1->64,pow_2} unroll;get_delta_matrix_weights2;loop_2;{1->64,pow_2} clock;{10} resource;last_step_scan;bucket;{RAM_2P_BRAM} resource;last_step_scan;sum;{RAM_2P_BRAM} array_partition;last_step_scan;bucket;1; {cyclic,block};{1->512,pow_2} array_partition;last_step_scan;sum;1; {cyclic,block};{1->128,pow_2} unroll;last_step_scan;last_1;{1->128,pow_2} unroll;last_step_scan;last_2;{1,2,4,8,16} clock;{10}

A top-down mapping maps knobs of the source Signature Encoding to knobs of the target one. SETarget CSDTarget CSDSource

Running Example

slide-26
SLIDE 26

26

The Methodology: Similarity Evaluation

CSD similarity: measures the similarity among knobs of target and source CSDs.

Domain

Mapping

Target knobs

K1 K2 K3 K4 K5 K6 K7

Resource Resource

  • Part. type
  • Part. factor
  • Part. type
  • Part. factor

Unroll Unroll Clock

Source knobs

K1 K2 K3 K4 K5 K6

  • Part. type
  • Part. factor
  • Part. type
  • Part. factor
  • Part. type
  • Part. factor

Unroll Unroll Clock

Domain Knob values Set of values for target knob K6 1 2 4 6 8 16 32 64 128 Set of values for source knob K5 1 2 4 6 8 16 32 64

Running Example

slide-27
SLIDE 27

27

The Methodology: Similarity Evaluation

1 5 10 15 20 25 30 35 1 5 10 15 20 25 30 35 1 5 10 15 20 25 30 35 1 5 10 15 20 25 30 35

Target ID Target ID Source ID Source ID

SimSE SimCSD

slide-28
SLIDE 28

28

The Methodology: Similarity Evaluation

1 5 10 15 20 25 30 35 1 5 10 15 20 25 30 35

Encoding Signature similarity

Target ID Source ID

slide-29
SLIDE 29

29

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

✓ State of the Art for DSE ✓ The Idea: Leveraging Prior Knowledge ✓ The Methodology ✓ Signature Encoding ✓ Similarity Evaluation ➡ Inference Process

  • Results
slide-30
SLIDE 30

30

The methodology: Inference Process

g(.) XS XS P(S, XS) XT XT

S

P(T, XT) XT

xS = [x1

S, …, xJ S] ∈ XS

xS

xT = [x1

T, …, xI T] ∈ XT

xT

δ(kn, km) =

Z

z=1

|kn,z, km,z|2

xi

T = argmin{δ(kn, xj S)}

n

P(T, XT) P(T, XT) XT

S

= ^

slide-31
SLIDE 31

31

The methodology: Inference Process

g(.) XS XS P(S, XS) XT XT

S

P(T, XT) P(T, XT) P(T, XT) XT

S

= ^ XT xS

Domain Inference Source knobs K1 K2 K4 K5 K6

cyclic 256 cyclic 8 32 64 10

Target knobs

K K K K K K

K1 K2 K3 K4 K5 K6 K7

2P_BRAM 2P_BRAM cyclic, block 1,…,256,512 cyclic, block 1,..,8,..,128 1,..,32,..,128 1,2,4,8,16 10

xT

Running Example

slide-32
SLIDE 32

The source design space is iteratively peeled and lower-rank Pareto frontiers are used for the inference.

32

The methodology: Inference Process

Area Latency

1st-rank Pareto-front

slide-33
SLIDE 33

The source design space is iteratively peeled and lower-rank Pareto frontiers are used for the inference.

33

The methodology: Inference Process

Area Latency

1st-rank Pareto-front 2nd-rank Pareto-front

slide-34
SLIDE 34

The source design space is iteratively peeled and lower-rank Pareto frontiers are used for the inference.

34

The methodology: Inference Process

Area Latency

1st-rank Pareto-front 2nd-rank Pareto-front i th-rank Pareto-front . . . .

slide-35
SLIDE 35

35

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

✓ State of the Art for DSE ✓ The Idea: Leveraging Prior Knowledge ✓ The Methodology ✓ Signature Encoding ✓ Similarity Evaluation ✓ Inference Process ➡ Results

slide-36
SLIDE 36

36

Results

We have considered 39 out of 50 possible design from Machsuite[4]. For each of them we have performed an exhaustive exploration and used it as a ground-truth to evaluate the quality of the DSE. We have used Average Distance from Reference Set (ADRS) metric to measure the distance among the retrieved Pareto frontier and the ground-truth.

ADRS( ¯ P, P) = [ 1 |P| ∑

p∈P

min

¯ p∈ ¯ P(d( ¯

p, p))] d( ¯ p, p) = max{0,(A¯

p − Ap)/Ap, (L¯ p − Lp)/Lp}

[4] B. Reagen et al. International Symposium on Workload Characterisation, 2014.

slide-37
SLIDE 37

37

Results

Effectiveness of the similarity metric: 1st-ranked source. ✓ High Specification Encoding similarity ✓ High Configuration Space Descriptor similarity

2000 4000 6000 Effective latency [ns] 0.0 0.2 0.4 0.6 Area ID:27, Rank:1st ADRS=0.004

slide-38
SLIDE 38

38

Results

Effectiveness of the similarity metric: 30th-ranked source. X Low Specification Encoding similarity ✓ High Configuration Space Descriptor similarity

2000 4000 6000 Effective latency [ns] 0.0 0.2 0.4 0.6 Area ID:2, Rank:30th ADRS=0.85

slide-39
SLIDE 39

39

Results

Effectiveness of the similarity metric: 35th-ranked source. ✓ High Specification Encoding similarity X Low Configuration Space Descriptor similarity

2000 4000 6000 Effective latency [ns] 0.0 0.2 0.4 0.6 Area ID:34, Rank:35th ADRS=1.50

slide-40
SLIDE 40

Effectiveness of the similarity metric: 37th-ranked source.

2000 4000 6000 Effective latency [ns] 0.0 0.2 0.4 0.6 Area ID:35, Rank:37th ADRS=5.53

40

Results

X Low Specification Encoding similarity X Low Configuration Space Descriptor similarity

slide-41
SLIDE 41

41

Results

Effectiveness of the similarity metric: source ranking.

1 2 3 4 5 6 7 8 9 10 Source rank according to metric 10−2 100 Aggregated ADRS

slide-42
SLIDE 42

42

Results

Effectiveness of the similarity metric: selection criterion.

Oracle Prior Knowl. Average Random 10−3 10−1 101 Aggregated ADRS

slide-43
SLIDE 43

43

Results

Effectiveness of the similarity metric: influence of multiple Pareto frontier rank inference.

1 2 3 4 5 6 7 8 9 10 # of inferred Pareto fronts 0.0 0.1 0.2 0.3 Aggregated ADRS

20 40 Average # of synthesis

slide-44
SLIDE 44

44

Results

Comparison of our methodology with respect to SoA ones for similar problems size. Number of synthesis required to reach an ADRS goal of 0.04.

[8] H. Liu et al. Design Automation Conference, 2013. [9] L. Ferretti et al. IEEE Transactions on Emerging Topics in Computing, 2018. [10] L. Ferretti et al. International Conference on Computer Design, 2018. [11] Zhong et al. International Conference on Computer Design, 2014. Refinement-Based Model-Based

slide-45
SLIDE 45

45

Table of Contents

✓ Motivation

✓ HLS-driven Design Space Exploration

✓ State of the Art for DSE ✓ The Idea: Leveraging Prior Knowledge ✓ The Methodology ✓ Signature Encoding ✓ Similarity Evaluation ✓ Inference Process ✓ Results Thank you for your attention! Database of DSEs will be released soon!