Introdction Algorithmic Trading has created an increasing demand for high performance compting soltions within financial organizations. The actors of portfolio management and ris assessment have the obligation to increase their compting resorces in order to provide competitive models for financial management and pricing financial instrments. GPU Stands for "Graphic Processing Unit". GPU processing (or Stream Processing) defines a class of algorithms that ses Massively Parallel Architectres as a starting point for Software Design. Comptational performance is no longer coming from increase in cloc speed, bt in leveraging the astonishing performances of those massively parallel architectres. This docment describes how GPU technologies can improve efficiency and throghpt in the comptation of Option Prices. It presents a nmber of benchmars specific to financial analysis in order to demonstrate the tremendos advantage of porting trading algorithms to the GPU platform. The benefits of porting compting algorithms to the GPU are: Improve application performance from 0 to 700 fold. Qicly bild and deliver massively parallel applications. Leverage existing grid infrastrctre by simply adding low cost graphic hardware to the nits. Applications bilt to rn on GPU hardware have virtally no limits in their scalability. GPU Implementation of Option Pricing Algorithms Option Models and Definitions Used terminology and concepts: Options derive their vale from an nderlying asset (or secrity).
A Call Option contract gives the holder the right, bt not the obligation, to by the nderlying asset for a strie price, on the expiration date. A Pt Option gives the holder the right to sell the nderlying asset at a strie price, on the expiration date. Both the strie price (X), the price of the nderlying asset at the expiration date strongly inflence the ftre vale of the option, and ths its vale now. Under certain assmptions, one can statistically model the asset's ftre price flctation sing its crrent price (S), and its volatility (v), witch describes how widely the price changes over time. Additional factors inflence the price of the option: The time to expiration date (T). Longer terms imply a wider range of possible vales for the nderlying asset on the expiration date, therefore more ncertainty abot the vale of the asset when it expires. The risless rate of retrn (r). The vale of an asset at some ftre time (t), 0 t T, mst be disconted by mltiplying it by e rt. Exercise restriction. o Eropean options may be exercised only on the day the option expires. o American options may be exercised at any time p and inclding the expiration date. This flexibility means that an American option will be priced at least as high as the corresponding Eropean option. Other factors, sch as dividend payots, can also be incorporated. We however limit or model to the preceding considerations. Experiment Methodology Hardware and Software setp o Hardware CPU: AMD Athlon 64 X Dal Core Processor 400+,. GHz, Gb of RAM GPU: NVIDIA Ge Force 8800 GT,.5 GHz, Gb of RAM o Software Microsoft Windows NT 5..600 Service Pac 3 Microsoft Visal Stdio 005 NVIDIA CUDA.0 Beta Driver v77.35 NVIDIA CUDA.0 Beta SDK Software for Option Pricing Experiment: o The same pricing modles have been coded in C++, for the CPU version and in CUDA langage (NVIDIA's "Compte Unified Device Architectre") for the GPU version. o The C++ version implements doble precision floating nmbers, the CUDA version implements single precision floating nmbers. The L Norm of the difference between CPU and GPU reslts is monitored for every option calclation, in order to control the precision.
Blac-Scholes Model Description The Blac-Scholes model comptes the vale (V), on an Eropean call option as (the formla for a pt option is similar): where, V = S CND d log = S X ( d ) Xe rt CND( ) d v + T r + v T d = d v T The Cmlative Normal Distribtion fnction, CND(x), gives the probability that a normally distribted random variable will have a vale less than x. There is no closedform expression for this fnction, and it mst be evalated nmerically. A polynomial fnction is sed to approximate it. Reslts Speedp, fnction of the total nmber of Options 800 700 600 Speedp Factor 500 400 300 00 00 0 8K 6K 3K 64K 8K 56K 5K 04K 048K 4096K 89K 6384K 3768K 65536K Nmber of Options Figre x-xx. CPU vs. GPU Performance of Blac-Scholes Option Pricing. The horizontal axis gives the total nmber of pricing problems to be solved. The vertical axis represents the speedp factor between CPU and GPU comptation times. The GPU significantly otperform the CPU, when enogh options are priced to allow for high resorce tilisation, and to allow the constant costs of GPU bffer management to be amortized. The slight decrease in performances of the GPU software after arond 0 Mega options, is de to the fact that the whole data set is loaded at once to the GPU, reaching its memory bandwidth limits. The prodction version of this software shold consider those limits and streamline the memory transfers to maintain the performances at the optimal level. 3
Options Compted per second, fnction of the total nmber of Options 4.5 Billions of Options per Sec. 4 3.5 3.5.5 0.5 0 8K 6K 3K 64K 8K 56K 5K 04K 048K 4096K 89K 6384K 3768K 65536K Nmber of Options Figre x-xx. CPU vs GPU Performance of Blac-Scholes Option Pricing. The horizontal axis gives the total nmber of pricing problems to be solved. The vertical axis represents the nmber of options compted per second. This graph presents a crve that has a similar shape of the preceding. Lattice Models The Blac-Scholes eqation provides a convenient analytical method to compte the price of Eropean options. However, it is not sitable for pricing American options, which can be exercised at any time prior to the date of expiration, or the Bermdan option which can be exercised at varios points. In fact, there is no nown closed-form expression that gives the fair price of an American option nder the same set of assmptions sed by the Blac-Scholes eqation. Another family of option pricing models is Lattice models. These models se a dynamic programming approach to derive the vale of an option at time 0 (now) by starting at time T (expiration date) and iteratively stepping "bacward" toward t = 0 in a discrete nmber of time steps (N). This approach is versatile and simple to implement, bt it can be comptationally expensive de to its iterative natre. The binomial lattice model presented here can be sed to compte both Eropean and American options. The Binomial Model The binomial model is so named becase it assmes that if the nderlying asset has a price S at a time step, its price at step +, can tae only two possible vales S and ds, corresponding to an "p" or "down" movement in the price of the stoc. Typically, is calclated by assming that dring a small period dt, the change of the asset vale is normally distribted, with a standard deviation that is eqal to S v dt. rdt If d is chosen sch that d = ( = e, v = e = ), the possible asset prices dring the lifetime of the option form a tree. The set of nodes at depth from the root represent rdt 4
T the range of possible asset prices at time, t = dt, where dt =. The nodes at N = N ( t = T ), represent the range of prices the asset might have at the expiration date. The psedo-probability P that the asset price will move "p" at any given time, is compted assming a "ris-netral" world, which implies that the expected retrn on the nderlying asset is eqal to r. The psedo-probability of the "down" movement is given by Pd = P. Even if P is not a tre probability, one will treat it as sch. ( P + d( P )) S = e rdt S P = rdt e d d Figre x-xx. Binomial Tree for 4 time steps, d = From the binomial tree representation, one can iteratively derive the option price for each node of the tree, starting at the leaves. At each leaf of the tree, call and pt option price is derived: V call = max( S X, 0) : if the maret price S at expiry date is greater than strie price X, a call option retrns S-X profit, for the same day sale transaction, or zero otherwise. V pt = max( X S, 0) : if the maret price S at expiry date is lower than strie price X, a pt option retrns X-S profit or zero otherwise. After comptation of all the possible options prices at expiry date, the algorithm moves bac to the root, sing the formla: V t rdt ( P V + P V ) e =, t+ d d, t+ Vt V, t+ V d, t+ Where, is the option price for one node at time t, and and are the prices of its two child nodes. 5
Reslts Average Speedp, fnction of the nmber of time steps 40 0 Average Speedp 00 80 60 40 0 0 56 steps 5 steps 04 steps 048 steps 4096 steps 89 steps Nmber of Step Figre x-xx. Speedp The horizontal axis gives the nmber of steps compted between "now" and the option expiry date. The vertical axis gives the speedp between the CPU and GPU code. In this analysis, one can measre the real impact of the GPU acceleration, when the code is written to handle recrsive iterative comptations. Conclsion Both Blac-Scholes model and lattice model for option pricing are basic bilding blocs of comptational finance. This article shows how the GPU can be sed to price these models more efficiently than the CPU. As the GPUs contine to become faster more qicly than CPUs, the difference in performance between the two is liely to grow for this type of application. Financial Applications demanding great compting performances Monte Carlo Simlation Monte Carlo and Qasi-Monte simlations analysis are also widely sed for implementing financial models in the indstry. These simlations have many advantages, inclding the ease of implementation and applicability to mltidimensional problems commonly encontered in finance. However, calclations sing Monte Carlo techniqes are very time consming de to the need for simlating many trajectories with mltiple parameters. These algorithms are therefore well sited for the GPU, becase they rely on rnning a large nmber of independent trials and compting the overall estimates based on all the trials 6
together. The independent estimates are compted in parallel, and the final reslt is compted by redctions. Portfolio Optimization Using GPUs, analysts rn their models on parallel servers, clsters, and grids to optimize thosands of individal portfolios overnight based on the previos day s trading reslts. Valation of Financial Derivatives Valing financial derivatives is comptationally intensive, and reqires large amonts of compter time. A firm may need to vale and compte hedge strategies for hndreds of thosands of policy holders in its portfolio on a reglar and timely basis. Software written for GPU enables analysts to explore new valation methodologies sing high performance compting techniqes to rn billions of complex scenarios. Detection of Credit Card Frad The rise of identity theft together with the poplarity of online shopping has reslted in a hge increase in credit card frad. As thieves become increasingly shrewd in exploiting secrity weanesses, bans and credit card companies need to be extremely agile to stay ahead of them. GPUs enable a ban to rn more sophisticated frad detection algorithms against tens of millions of credit card acconts. Hedge Fnd Trading In balancing a large portfolio of stocs, analysts need to search for short- and longterm patterns, identify correlations between secrities, and develop forecasts. Intense comptations are reqired against terabyte-sized tic data databases potentially a decade or more of trading data for thosands of secrities. Using GPU software allows faster reaction time to maret conditions, enabling analysts to evalate more sophisticated algorithms that tae into accont larger data sets. Ris Analysis GPU is a natral fit for creating and rnning the mltiple simlations (each with nmeros scenarios and variables) needed to accrately assess the degree of ris in stoc portfolios, in a set of financial contracts, or other investment vehicles. In particlar, otlier cases reqire a great many simlations to captre the level of ris. References. Blac, Fisher, and Myron Scholes. 973. "The Pricing of Options and Corporate Liabilities." Jornal of Political Economy 8(3), pp. 63-654.. Cox, John C., A. Ross and Mar Rbinstein. 979. "Option Pricing: A Simplified Approach." Jornal of Financial Economics 7: 9-63. 3. General Prpose Comptation on Graphic Processing Units reference website, http://www.gpgp.org. 7