-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fair performance comparison with QuantLib #80
Comments
Thanks for reaching out, Dmitri! I think the point was to demonstrate GPU speed up rather than direct comparison to QL. We would very much welcome a contribution for a better CPU benchmark! |
Sounds good! I'll come back to you later on CPU benchmark for this. Also, you do not include graph optimization time into reporting. I know, it's not dependent on number of paths, but it's still part of total pricing time. And for QL CPU execution it's 0. Shouldn't you report this separately? |
On second thought, if you simulate 100 time steps and only apply 1 exp() at the end, you don't really do much of calculations per path. So your problem is basically reduced to RNG algo competition. You should somehow increase complexity in your SDE. Perhaps, use the Heston local vol model to make this benchmark more relevant to real world. With flat vols, flat rates and a simple normal process, I don't know how relevant this benchmark is for practitioners. |
What random generator is used if "PSEUDO_ANTITHETIC" is set? |
There is an additional question about memory consumption, especially when run with XLA optimization. |
To answer @DmitriGoloubentsev question, yes, antithetic sampling uses fewer samples indeed. I think we could measure time it takes to simulate random numbers and then subtract that from runtime. I think at the time of writing that colab I was mainly motivated by GPU speed up and not comparing CPU performance. The colab can be extended to sample from Heston model as well. (just need to update As for graph compilation time, normally you would deploy a TensorFlow graph to avoid any compilation time overhead. @SergK13GH , The samples are precomputed for vectorization purpose. You could switch to |
Sorry, can you please elaborate on what "deploy a TensorFlow graph" means? Do you assume you can compile graph once and use it for all valuations in the future? |
I can see how it may work for simple case (flat model parameters and the same number of time steps). But am I right that in real problems you need to recompile graph everyday for all models and all trades? I think you can only reuse valuation graph on the same trading day and it's still a good idea to report how much time and memory needed for this step. Simulating normal process using Euler scheme for 1000 time step is a very basic problem. What happens when you have 1000 IR swaps to price for xVA? Your graph is going to be huge and compilation time significant regardless if you use GPU or CPU. |
Hi guys,
In the "Monte Carlo via Euler Scheme" example you compare TF with QuantLib pricing and conclude that TF finance is x100 times faster(or more).
I want to note that in QL you evolve 100 time steps of Log Normal process, but in TF you work in log space and only apply exp() at the end.
I agree QL may not be very fast, but in this example you compare 100 exponents per path in QL to just 1 exponent in TF...
Thank you!
The text was updated successfully, but these errors were encountered: