speeding up monte carlo simulation using an emulator · introduction: the objective...

56
Where innovation starts Speeding Up Monte Carlo Simulation Using An Emulator A.K. Tyagi, W.H.A. Schilders, X. Jonsson, T.G.J. Beelen Center for Analysis, Scientific Computing and Applications (CASA), Mentor Graphics R , Grenoble (FR) November 04, 2015

Upload: others

Post on 15-Feb-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

Where innovation starts

Speeding Up Monte Carlo SimulationUsing An Emulator

A.K. Tyagi, W.H.A. Schilders, X. Jonsson, T.G.J. Beelen

Center for Analysis, Scientific Computingand Applications (CASA),

Mentor Graphics R©, Grenoble (FR)

November 04, 2015

Page 2: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

1/22

/

Outline

1 Introduction

2 Project Startup

3 Motivation

4 An Emulator Technique

5 Results

6 Conclusion and Further Steps

Page 3: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

1/22

/

Outline

1 Introduction

2 Project Startup

3 Motivation

4 An Emulator Technique

5 Results

6 Conclusion and Further Steps

Page 4: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

2/22

/

Introduction: The Project

ASIVA14: Analog Simulation and Variability Analysis for 14nm design

http://www.itn-asiva14.eu

Page 5: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

3/22

/

Introduction: The Project

ASIVA14 Objectives

1) Speed up time-domain simulations fornearly-periodic circuits from 1 week to 2hours (70x speedup) (Giovanni De Luca)

2) Speed up time-domain simulations in fullchip verification by orders of magnitude(10x speedup) (Nhunh Dang)

3) Variability Analysis: Reduce the number ofMonte Carlo runs for variability and uncertaintyanalysis in ICs (1010x speedup /) (Anuj Tyagi)

Page 6: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

4/22

/

Introduction: The Project

Promotor:

Prof. Wil SchildersTU Eindhoven, Netherlands

email: [email protected]

My Supervisors:

Dr. Xavier JonssonMentor Graphics, Grenoble

email: [email protected]

Dr. Theo BeelenTU Eindhoven, Netherlandsemail: [email protected]

Page 7: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

5/22

/

Introduction: The Project

How we work

• Regular Meetings

Page 8: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

5/22

/

Introduction: The Project

How we work

• Reports

• Weekly reports

• Technical reports

Page 9: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

6/22

/

Introduction: Variability Analysis

• With each new technology, device sizes shrink

• Biggest challenge: uncertainty in circuit performance

• Uncertainty leads to circuit failure that affects the production yield

Page 10: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

6/22

/

Introduction: Variability Analysis

• With each new technology, device sizes shrink

• Biggest challenge: uncertainty in circuit performance

• Uncertainty leads to circuit failure that affects the production yield

Page 11: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

6/22

/

Introduction: Variability Analysis

• With each new technology, device sizes shrink

• Biggest challenge: uncertainty in circuit performance

• Uncertainty leads to circuit failure that affects the production yield

Page 12: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

7/22

/

Introduction: The objective

• Estimate the circuit failure probability

• Uncertainty and variability of the probability estimator

• Estimation shall be possible within required computational time

Page 13: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

7/22

/

Introduction: The objective

• Estimate the circuit failure probability

• Uncertainty and variability of the probability estimator

• Estimation shall be possible within required computational time

Page 14: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

7/22

/

Introduction: The objective

• Estimate the circuit failure probability

• Uncertainty and variability of the probability estimator

• Estimation shall be possible within required computational time

Page 15: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

8/22

/

Introduction: State of the Art

• Monte Carlo (MC) Simulation

Prb(h(x) ≤ µ) =1N

N∑i=1

1h(Xi)

where Xi are N i.i.d. random numbers generated from the pdf(x) and

1h(x) =

{1 if h(x) ≤ µ0 otherwise

,

Page 16: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

8/22

/

Introduction: State of the Art

• Monte Carlo (MC) Simulation

Prb(h(x) ≤ µ) =1N

N∑i=1

1h(Xi)

where Xi are N i.i.d. random numbers generated from the pdf(x) and

1h(x) =

{1 if h(x) ≤ µ0 otherwise

,

Page 17: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

9/22

/

Introduction: State of the Art

• Monte Carlo (MC) Simulation

Benefits:

• Robustness• Doesn’t care about the number of parameters• Easy to implement

Drawbacks:

• Computationally expensive

Page 18: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

9/22

/

Outline

1 Introduction

2 Project Startup

3 Motivation

4 An Emulator Technique

5 Results

6 Conclusion and Further Steps

Page 19: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

10/22

/

Project Startup

• Sensitivity Analysis

• Given, input x→ IC Model → output h(x)

• Find∂h∂x

and get most dominant parameters

• We do this to use Uncertainty Quantification

Drawback: UQ limited up to few parameters

Page 20: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

10/22

/

Project Startup

• Sensitivity Analysis

• Given, input x→ IC Model → output h(x)

• Find∂h∂x

and get most dominant parameters

• We do this to use Uncertainty Quantification

Drawback: UQ limited up to few parameters

Page 21: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

10/22

/

Project Startup

• Sensitivity Analysis

• Given, input x→ IC Model → output h(x)

• Find∂h∂x

and get most dominant parameters

• We do this to use Uncertainty Quantification

Drawback: UQ limited up to few parameters

Page 22: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

10/22

/

Outline

1 Introduction

2 Project Startup

3 Motivation

4 An Emulator Technique

5 Results

6 Conclusion and Further Steps

Page 23: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

11/22

/

Motivation

• Large number of statistical parameters

• Monte Carlo doesn’t care about the number of parameters

• Keep this method and Speed it up

• An Emulator approach can be used

Page 24: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

11/22

/

Outline

1 Introduction

2 Project Startup

3 Motivation

4 An Emulator Technique

5 Results

6 Conclusion and Further Steps

Page 25: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

12/22

/

An Emulator Technique

• Given IC model

IC Modelθ(x, α1, · · · , αk)

inputx = (x1, · · · , xp) output h(x)

Page 26: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

12/22

/

An Emulator Technique

• Given IC model

IC Modelθ(x, α1, · · · , αk)

inputx = (x1, · · · , xp) output h(x)

• Take m uniformly distributed random vectors Xi and get a training set (X,H)

IC Modelθ(x, α1, · · · , αk)X =

X1X2...

Xm

h(X1)h(X2)...

h(Xm)

= H

Page 27: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

12/22

/

An Emulator Technique

• Given IC model

IC Modelθ(x, α1, · · · , αk)

inputx = (x1, · · · , xp) output h(x)

• Fit a regression model y = f (x) such that h(x) = y(x) + δ(x)

Page 28: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

12/22

/

An Emulator Technique

• Given IC model

IC Modelθ(x, α1, · · · , αk)

inputx = (x1, · · · , xp) output h(x)

• Fit a regression model y = f (x) such that h(x) = y(x) + δ(x)

Page 29: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

12/22

/

An Emulator Technique

• Given IC model

IC Modelθ(x, α1, · · · , αk)

inputx = (x1, · · · , xp) output h(x)

• Fit a regression model y = f (x) such that h(x) = y(x) + δ(x)

Page 30: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

12/22

/

An Emulator Technique

• Given IC model

IC Modelθ(x, α1, · · · , αk)

inputx = (x1, · · · , xp) output h(x)

• Fit a regression model y = f (x) such that h(x) = y(x) + δ(x)

Page 31: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

13/22

/

An Emulator Technique

• Compute outputs y(X∗) for X∗ ∼ N(µ,Σ) using regression model

RegressionModel y = f (x)X∗ =

X∗1X∗2...

X∗N∗

y(X∗1)y(X∗2)...

y(X∗N∗ )

= Y∗

Page 32: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

13/22

/

An Emulator Technique

• Compute outputs y(X∗) for X∗ ∼ N(µ,Σ) using regression model

RegressionModel y = f (x)X∗ =

X∗1X∗2...

X∗N∗

y(X∗1)y(X∗2)...

y(X∗N∗ )

= Y∗

• An Emulator model

Page 33: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

13/22

/

An Emulator Technique

• Compute outputs y(X∗) for X∗ ∼ N(µ,Σ) using regression model

RegressionModel y = f (x)X∗ =

X∗1X∗2...

X∗N∗

y(X∗1)y(X∗2)...

y(X∗N∗ )

= Y∗

• An Emulator model

Page 34: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

13/22

/

An Emulator Technique

• Compute outputs y(X∗) for X∗ ∼ N(µ,Σ) using regression model

RegressionModel y = f (x)X∗ =

X∗1X∗2...

X∗N∗

y(X∗1)y(X∗2)...

y(X∗N∗ )

= Y∗

• An Emulator model

he(x) =

{h(x) if |y(x) − µ| ≤ zαδ(x)y(x) otherwise

where zα is such that Φ(zα) = α, Φ(x) is cdf of standard normaldistribution.

Page 35: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

14/22

/

An Emulator Technique

• The failure probability is given by:

Prb(h(x) ≤ µ) ≈ Prb(he(x) ≤ µ) =1

N∗

N∗∑i=1

1he (X∗

i )

Note:

• We can reduce the rejections by having a ‘best’ regression model

• The ‘best’ model predict a good approximation in the importantregion

• An adaptive sampling might be used

Page 36: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

14/22

/

An Emulator Technique

• The failure probability is given by:

Prb(h(x) ≤ µ) ≈ Prb(he(x) ≤ µ) =1

N∗

N∗∑i=1

1he (X∗

i )

Note:

• We can reduce the rejections by having a ‘best’ regression model

• The ‘best’ model predict a good approximation in the importantregion

• An adaptive sampling might be used

Page 37: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

15/22

/

An Emulator Technique: Adaptive Sampling

Page 38: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

15/22

/

Outline

1 Introduction

2 Project Startup

3 Motivation

4 An Emulator Technique

5 Results

6 Conclusion and Further Steps

Page 39: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

16/22

/

Results

Example:

• Input:x = (x1, x2) ∈ R2

∼ N(0, I)

• Output:

h1(x) = x21 − 8x2 + 16,

h2(x) = −16x1 + x22 + 32

h(x) = max(h1(x), h2(x))

• Evaluate Prb(h ≤ 20)

• We used Matlab Kriging toolbox to fit Gaussian regression model y(x)

Page 40: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

17/22

/

Results

Figure: α = 0.01 i.e., 99% confidence bound for accept model

Prb_err = 1.0%

Page 41: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

18/22

/

Results

Figure: α = 0.001 i.e., 99.9% confidence bound for accept model

Prb_err = 0.9%

Page 42: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

19/22

/

Results

Figure: Number of rejections w.r.t. adaptive runs for α = 0.01 and α = 0.001

Page 43: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

20/22

/

Results: Check Validity of the Emulator

• Get the failure probability Prmc using Monte Carlo simulator

• Evaluate failure probability PrEm through Emulator

• Repeat the processor few number of times

• Evaluate Root Mean Squared Error (RMSE) for probability estimator

RMSE =

√√√1

Nrep

Nrep∑i=1

(PrEmi − Prmc)2

Page 44: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

20/22

/

Results: Check Validity of the Emulator

• Get the failure probability Prmc using Monte Carlo simulator

• Evaluate failure probability PrEm through Emulator

• Repeat the processor few number of times

• Evaluate Root Mean Squared Error (RMSE) for probability estimator

RMSE =

√√√1

Nrep

Nrep∑i=1

(PrEmi − Prmc)2

Page 45: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

20/22

/

Results: Check Validity of the Emulator

• Get the failure probability Prmc using Monte Carlo simulator

• Evaluate failure probability PrEm through Emulator

• Repeat the processor few number of times

• Evaluate Root Mean Squared Error (RMSE) for probability estimator

RMSE =

√√√1

Nrep

Nrep∑i=1

(PrEmi − Prmc)2

Page 46: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

20/22

/

Results: Check Validity of the Emulator

• Get the failure probability Prmc using Monte Carlo simulator

• Evaluate failure probability PrEm through Emulator

• Repeat the processor few number of times

• Evaluate Root Mean Squared Error (RMSE) for probability estimator

RMSE =

√√√1

Nrep

Nrep∑i=1

(PrEmi − Prmc)2

Page 47: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

21/22

/

Results: Check Validity of the Emulator

Figure: Distribution of the probability P(h ≤ 20)

Page 48: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

21/22

/

Outline

1 Introduction

2 Project Startup

3 Motivation

4 An Emulator Technique

5 Results

6 Conclusion and Further Steps

Page 49: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

22/22

/

Conclusion and Further Steps

Conclusion

• The Emulator technique is easy to implement

• We assume N > 10(m + N∗rej) and get a speedup ofN

m + N∗rej> 10x, where

N∗rej is the number of rejections by the Emulator

Further Steps

• The Gaussian process doesn’t work well [4] for the dim > 10 therefore ouraim is to use dimension reduction methods

• Find alternatives (independent of dimensions) of Gaussian Process.

Page 50: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

22/22

/

Conclusion and Further Steps

Conclusion

• The Emulator technique is easy to implement

• We assume N > 10(m + N∗rej) and get a speedup ofN

m + N∗rej> 10x, where

N∗rej is the number of rejections by the Emulator

Further Steps

• The Gaussian process doesn’t work well [4] for the dim > 10 therefore ouraim is to use dimension reduction methods

• Find alternatives (independent of dimensions) of Gaussian Process.

Page 51: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

22/22

/

References

C. E. Rasmussen and C. K. I. Williams: Gaussian Processes forMachine Learning, the MIT Press, 2006.

V. Dubourg, Adaptive surrogate models for reliability analysisand reliability-based design optimization. PhD Thesis,BlaisePascal University - Clermont II, 2011.

S. N. Lophaven, H. B. Nielsen and J. SondergaardL: DACE, AMATLAB Kriging Toolbox Version 2.0, Technical University ofDenmark , August 1, 2002.

Marrel, A., Iooss, B., Van Dorpe, F. and Volkova, E.: An efficientmethodology for modeling complex computer codes withGaussian processes. Comput. Statist. Data Anal (2008).

Page 52: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

22/22

/

Page 53: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

1/2

/

Gaussian Process

• A generalization of a multivariate Gaussian distribution.

• Fully specified by a mean function m(x) and covariance function k(x, x′):

f (x) ∼ GP(m(x), k(x, x′))

• We choose

m(x) = 0

k(x, x′) = exp(−

12l|x − x′|2

).

where, l is a scaled factor called hyperparameter.

Page 54: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

1/2

/

Gaussian Process

• A generalization of a multivariate Gaussian distribution.

• Fully specified by a mean function m(x) and covariance function k(x, x′):

f (x) ∼ GP(m(x), k(x, x′))

• We choose

m(x) = 0

k(x, x′) = exp(−

12l|x − x′|2

).

where, l is a scaled factor called hyperparameter.

Page 55: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

1/2

/

Gaussian Process

• A generalization of a multivariate Gaussian distribution.

• Fully specified by a mean function m(x) and covariance function k(x, x′):

f (x) ∼ GP(m(x), k(x, x′))

• We choose

m(x) = 0

k(x, x′) = exp(−

12l|x − x′|2

).

where, l is a scaled factor called hyperparameter.

Page 56: Speeding Up Monte Carlo Simulation Using An Emulator · Introduction: The objective Estimatethecircuit failure probability Uncertainty and variability of the probability estimator

2/2

/

Gaussian Process

• data: x, h (training set)

• model: h = y(x) + ε

Gaussian likelihood:h|x, y(x) ∼ N(y, σ2I)

Gaussian process prior:y(x) ∼ GP(0, k(x, x′))

Gaussian process posterior:

y(x)|x,h ∼ GP(mpost(x) = k(x, x)T[K(x, x) + σ2I]−1y,

kpost(x, x′) = k(x, x′) − k(x, x)[K(x, x) + σ2I]−1k(x, x′)).

Gaussian predictive distribution:

y∗|x∗, x, y ∼ N(k(x∗, x)T[K+σ2I]−1y, k(x∗, x∗)+σ2−k(x∗, x)T[K+σ2I]−1k(x∗, x)). (1)