enhancing pricing performance and quants productivity in a...
TRANSCRIPT
![Page 1: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/1.jpg)
Enhancing pricing performance and Quants productivity in a Cloud based development environment
Nicolas BLANC Software Engineer
![Page 2: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/2.jpg)
Misys at a glance
Who we are
What we offer
A global leader in financial
services software with
4,500+ employees
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
management Who we serve
2K clients 12 of the top 20
asset managers $ 46 of the world’s
top 50 banks
2 © Misys 2017 9 May, 2017
“We are transforming the global financial services
industry by making financial institutions more
resilient, more efficient and more competitive.”
![Page 3: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/3.jpg)
Goals and challenges
3
• 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
Our goals
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
![Page 4: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/4.jpg)
Write financial GPU code ?
4
Possible solutions
Software engineers Quantitative analysts
Experienced in GPU progamming Less experienced in finance
Experienced in finance Less experienced GPU programming
Each team gains experience in both fields ?
Create an abstraction layer
Migrate legacy code ?
© Misys 2017 9 May, 2017
Fusion parallel processor
![Page 5: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/5.jpg)
Parallel Processing framework concept
5
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
![Page 6: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/6.jpg)
Parallelization
6
Easy to write and maintain Runs fast
• Price a whole portfolio of deals • Price a deal using multiple market data (Montecarlo) • Price a deal at several dates (PFE)
© Misys 2017 9 May, 2017
Where does the workload come from ?
We separate the logic of the script from its parallelization axis
![Page 7: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/7.jpg)
Script example
7
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
// Compute daycount fraction
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1)
// Compute discount factor
def factor = discountFactor(calculationDate(), maturityDate, basis)
// Compute the price
def price = notional * daycount * (rate - fixedRate) * factor
// return price
return price
Script Deal
{
"currency1": "USD",
"currency2": “EUR",
"fixingDate": "2015-03-17",
"effectiveDate": "2015-03-01",
"maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
"notional": 1000000
}
© Misys 2017 9 May, 2017
Deal axis
![Page 8: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/8.jpg)
Script example
8
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
// Compute daycount fraction
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1)
// Compute discount factor
def factor = discountFactor(calculationDate(), maturityDate, basis)
// Compute the price
def price = notional * daycount * (rate - fixedRate) * factor
// return price
return price
Script Deal
{
"currency1": "USD",
"currency2": “EUR",
"fixingDate": "2015-03-17",
"effectiveDate": "2015-03-01",
"maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
"notional": 1000000
}
Market data axis
© Misys 2017 9 May, 2017
Deal axis
![Page 9: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/9.jpg)
Script example
9
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
// Compute daycount fraction
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1)
// Compute discount factor
def factor = discountFactor(calculationDate(), maturityDate, basis)
// Compute the price
def price = notional * daycount * (rate - fixedRate) * factor
// return price
return price
Script Deal
{
"currency1": "USD",
"currency2": “EUR",
"fixingDate": "2015-03-17",
"effectiveDate": "2015-03-01",
"maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
"notional": 1000000
}
Market data axis
© Misys 2017 9 May, 2017
Deal axis Date axis
![Page 10: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/10.jpg)
Script example
10
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency1], fixingDate)
// Compute daycount fraction
def daycount = dayCountFraction(effectiveDate, maturityDate, currency1)
// Compute discount factor
def factor = discountFactor(calculationDate(), maturityDate, basis)
// Compute the price
def price = notional * daycount * (rate - fixedRate) * factor
// return price
return price
Script Deal
{
"currency1": "USD",
"currency2": “EUR",
"fixingDate": "2015-03-17",
"effectiveDate": "2015-03-01",
"maturityDate": "2015-03-01",
"basis": "ACTUAL_360",
"notional": 1000000
}
Market data axis User defined functions
© Misys 2017 9 May, 2017
Deal axis Date axis
![Page 11: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/11.jpg)
Language syntax highlights
11
Standard flow operators for, while, if, else, switch/case, break, continue…
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…
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
![Page 12: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/12.jpg)
Technical insight
12
Compute invariants only once
// Retrieve rate
def rate = data0D(“INTEREST_RATE”, [currency], fixingDate)
// Compute daycount fraction
def daycount = dayCountFraction(effectiveDate, maturityDate, currency)
// Compute discount factor
def factor = discountFactor(calculationDate(), maturityDate, basis)
// Compute the price
def price = notional * daycount * (rate - fixedRate) * factor
// return price
return price
Script Precomputation
Not depending on any market data Not depending on calculation date
daycount is precomputed
notional comes from the deal daycount is precomputed
notional * daycount is precomputed
© Misys 2017 9 May, 2017
![Page 13: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/13.jpg)
The assets of the engine
13
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
![Page 14: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/14.jpg)
Going into the Cloud
14
VaaS: Valuation as a Service
© Misys 2017 9 May, 2017
![Page 15: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/15.jpg)
Valuation as a Service
15
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
![Page 16: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/16.jpg)
Valuation as a Service
16
© Misys 2017 9 May, 2017
Dispatcher
Master 1
Master 2
Master 3
Proxy
User
User workspace
![Page 17: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/17.jpg)
Valuation as a Service
17
© Misys 2017 9 May, 2017
User 1 Workspace
User 2 Workspace
User 3 Workspace
K80 K80
Schedulor
VMs
Physical
• User workspaces can be hosted on several servers.
• K80 could have been directly used by the VMs, but the schedulor ensures that tasks are done one by one, preventing out of memory for instance.
• The schedulor also has the ability to dispatch work on different servers.
![Page 18: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/18.jpg)
Demonstration
![Page 19: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/19.jpg)
Tools available Debugger, non regression framework
Cloud based IDE Easy to access, easy to use, takes leverage of the community.
Summary
19
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…
Performance Single or double precision and multiple GPU support
© Misys 2017 9 May, 2017
![Page 20: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/20.jpg)
misys.com Please consider the environment before printing this PowerPoint.
@MisysFS
Misys @ LinkedIn
MisysVideoChannel
Nicolas BLANC Software Engineer
![Page 21: Enhancing pricing performance and Quants productivity in a ...on-demand.gputechconf.com/gtc/2017/presentation/s7138-nicolas-bl… · Provide a cloud based Integrated development environment](https://reader033.vdocuments.us/reader033/viewer/2022042222/5ec81f6740ce05398b7cd0cb/html5/thumbnails/21.jpg)
Latest FPP benchmark on AWS EC2 P2 instance
21
© Misys 2017 9 May, 2017
• We are reaching 61M PV/seconds on a p2.8x instance with 8 GPUs
• Test done a 1M Swaps portfolio with the following composition
Maturity Cashflows per trade Trade <5Y 27 3%
10Y<mat<15Y
30 <nb cf <=150 17%
150<nb cf<250 20% 336 3%
15Y<mat<20Y 30<nb cf <=100 27%
200 3%
20Y<mat<25Y 30<nb cf <=100 18%
150<nb cf<290 9%
0
10,000,000
20,000,000
30,000,000
40,000,000
50,000,000
60,000,000
70,000,000
0 1 2 3 4 5 6 7 8 9
PV/s
GPUs
average PV/s