You are on page 1of 21

Enhancing pricing performance and Quants

productivity in a Cloud based development


environment
Nicolas BLANC
Software Engineer
Misys at a glance
Who we are “We are transforming the global financial services
industry by making financial institutions more
A global leader in financial
services software with resilient, more efficient and more competitive.”

4,500+ employees
What we offer
50+ . countries The broadest and deepest portfolio of financial services software on the
market. Misys solutions cover retail and corporate banking, lending, treasury,
capital markets, investment management and enterprise-wide risk
Who we serve management

of the world’s
2K clients 46 top 50 banks
$ 12 of the top 20
asset managers

© Misys 2017 9 May, 2017 2


Goals and challenges

Our goals
• Run current and future pricing models on GPUs to dramatically speed up processing time for complex trading
analytics and risk management calculations,

• Make it available in the cloud for a large ecosystem.

Challenges
GPU code is complex to write

Requires specific skillset

Maintenance and extensibility is often difficult

Not everybody can access professional grade GPUs

© Misys 2017 9 May, 2017 3


Write financial GPU code ?

Software engineers Quantitative analysts


Experienced in GPU progamming Experienced in finance
Less experienced in finance Less experienced GPU programming

Fusion parallel processor

Possible solutions
Each team gains experience in both fields ?

Migrate legacy code ?

Create an abstraction layer

© Misys 2017 9 May, 2017 4


Parallel Processing framework concept

Software engineers Quantitative analysts


Build a scripting engine Write pricing models
Write payoffs

Translate a groovy script to OpenCL / CUDA / java bytecode

Easy to write and maintain Runs fast

© Misys 2017 9 May, 2017 5


Parallelization

Easy to write and maintain Runs fast

Where does the workload come from ?


• Price a whole portfolio of deals
• Price a deal using multiple market data (Montecarlo)
• Price a deal at several dates (PFE)

We separate the logic of the script from its parallelization axis

© Misys 2017 9 May, 2017 6


Script example
Script Deal
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
{
// Compute daycount fraction "currency1": "USD",
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1) "currency2": “EUR",
"fixingDate": "2015-03-17",
// Compute discount factor "effectiveDate": "2015-03-01",
def factor = discountFactor(calculationDate(), maturityDate, basis) "maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
// Compute the price "notional": 1000000
def price = notional * daycount * (rate - fixedRate) * factor }

// return price
return price

Deal axis

© Misys 2017 9 May, 2017 7


Script example
Script Deal
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
{
// Compute daycount fraction "currency1": "USD",
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1) "currency2": “EUR",
"fixingDate": "2015-03-17",
// Compute discount factor "effectiveDate": "2015-03-01",
def factor = discountFactor(calculationDate(), maturityDate, basis) "maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
// Compute the price "notional": 1000000
def price = notional * daycount * (rate - fixedRate) * factor }

// return price
return price

Deal axis Market data axis

© Misys 2017 9 May, 2017 8


Script example
Script Deal
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
{
// Compute daycount fraction "currency1": "USD",
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1) "currency2": “EUR",
"fixingDate": "2015-03-17",
// Compute discount factor "effectiveDate": "2015-03-01",
def factor = discountFactor(calculationDate(), maturityDate, basis) "maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
// Compute the price "notional": 1000000
def price = notional * daycount * (rate - fixedRate) * factor }

// return price
return price

Deal axis Market data axis Date axis

© Misys 2017 9 May, 2017 9


Script example
Script Deal
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
{
// Compute daycount fraction "currency1": "USD",
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1) "currency2": “EUR",
"fixingDate": "2015-03-17",
// Compute discount factor "effectiveDate": "2015-03-01",
def factor = discountFactor(calculationDate(), maturityDate, basis) "maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
// Compute the price "notional": 1000000
def price = notional * daycount * (rate - fixedRate) * factor }

// return price
return price

Deal axis Market data axis Date axis User defined functions

© Misys 2017 9 May, 2017 10


Language syntax highlights
Static type inference
No explicit typing, everything is detected and optimized at compile time
Natively supported types : Integer, Double, String, Date, Boolean, Array, Matrix, Cubes…
Standard flow operators
for, while, if, else, switch/case, break, continue…

Custom functions
Function declaration with typeless parameters

Custom structures
Class-like structure definitions, possibility to define functions of structures

Function pointers
Through seamless static templating

Standard library
A set of optimized standard functions and algorithms provided by default

© Misys 2017 9 May, 2017 11


Technical insight
Compute invariants only once

Script Precomputation
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency], fixingDate)

// Compute daycount fraction Not depending on any market data


def daycount = dayCountFraction(effectiveDate, maturityDate, currency) Not depending on calculation date
// Compute discount factor daycount is precomputed
def factor = discountFactor(calculationDate(), maturityDate, basis)

// Compute the price notional comes from the deal


def price = notional * daycount * (rate - fixedRate) * factor
daycount is precomputed
// return price notional * daycount is precomputed
return price

© Misys 2017 9 May, 2017 12


The assets of the engine
The framework takes care of:
• Data alignment / Coalescence
• Memory copy
• Optimized occupancy
• Multi GPU
• Single or double precision
• Separation of CPU / GPU execution through precomputation
• …

Optimizing the engine optimizes all existing scripts

© Misys 2017 9 May, 2017 13


Going into the Cloud

VaaS: Valuation as a Service

© Misys 2017 9 May, 2017 14


Valuation as a Service

Provide a cloud based Integrated development environment


Users just need a web browser and internet access. Based on the open source project Eclipse Che.

Runs on AWS servers


Uses K80 GPUs, easy to scale up, no need to worry about the drivers. Everything is preconfigured thanks
to Docker images.

Rely on collaboration
Users can write an upload their codes in order to be used by others. Possibility to get up to date pricing
models easily.

© Misys 2017 9 May, 2017 15


Valuation as a Service

User
Proxy
workspace

User
Master 1

Dispatcher Master 2

Master 3

© Misys 2017 9 May, 2017 16


Valuation as a Service
VMs
User 1 User 2 User 3
Workspace Workspace Workspace • User workspaces can be hosted on
several servers.

• K80 could have been directly used by the


VMs, but the schedulor ensures that tasks
Schedulor are done one by one, preventing out of
memory for instance.
Physical
• The schedulor also has the ability to
dispatch work on different servers.

K80 K80

© Misys 2017 9 May, 2017 17


Demonstration
Summary
Scripting language
Easy to code, read and maintain scripts

Same script, multiple use cases


Can be used for 3D simulation, Monte carlo pricing, PFE, CVA…

Tools available
Debugger, non regression framework

Performance
Single or double precision and multiple GPU support

Cloud based IDE


Easy to access, easy to use, takes leverage of the community.

© Misys 2017 9 May, 2017 19


Nicolas BLANC
Software Engineer
nicolas.blanc@misys.com
@MisysFS

misys.com Misys @ LinkedIn

MisysVideoChannel
Please consider the environment before printing this PowerPoint.
Latest FPP benchmark on AWS EC2 P2 instance
70,000,000 • We are reaching 61M
PV/seconds on a p2.8x
60,000,000
instance with 8 GPUs
50,000,000
• Test done a 1M Swaps
40,000,000
portfolio with the
PV/s following composition
average PV/s
30,000,000
Maturity Cashflows per trade Trade
<5Y 27 3%
20,000,000 30 <nb cf <=150 17%
10Y<mat<15Y 150<nb cf<250 20%
10,000,000 336 3%
30<nb cf <=100 27%
15Y<mat<20Y
200 3%
0 30<nb cf <=100
0 1 2 3 4 5 6 7 8 9 18%
20Y<mat<25Y
GPUs 150<nb cf<290 9%

© Misys 2017 9 May, 2017 21

You might also like