erkandem / calcbsimpvol

Calculate Black Scholes Implied Volatility - Vectorwise
https://erkandem.github.io/calcbsimpvol/
MIT License
15 stars 5 forks source link

Possibility for GPU-backed vector computation? #8

Open Shellcat-Zero opened 3 years ago

Shellcat-Zero commented 3 years ago

I was wondering if any performance optimization has been explored on the GPU for this. In particular, I was thinking that Python JAX would be very well suited to this optimization. I'm still familiarizing myself with the source/algorithm used here for the computation, but in addition to providing optional GPU-backed numpy for computing, JAX also provides:

jit(), for speeding up your code
grad(), for taking derivatives
vmap(), for automatic vectorization or batching.

in case any of these would be helpful here. A demo of computing the greeks via differentials on Black-Scholes from grad() is shown here, although I've found that the demo is further improved with jit() on the functions there.

erkandem commented 3 years ago

Hey @Shellcat-Zero, thx for the general interest in the code. Hope it solves sth for you.

GPU stuff sounds interesting and very suited for matrix stuff. I run the apps which using this package on regular chips. If you know how to do it and it benefits you feel free to fork it.

Quite interesting but not worth it for my usage.