← Writing 4 min read

From HPC to quant

Why I moved from HPC software to quantitative finance in 2018: back to building models, on the same full stack, for systems that cannot go down.

In 2018 I left HPC software for quantitative finance. Until then I had spent five and a half years at ANSYS and Shell building the machinery that other people’s simulations run on: parallel solvers that scaled from one CPU to more than 100,000 cores, and a backend that streams terabytes of seismic data across a cluster. Then I joined BP as a front-office quant developer, and today I build risk infrastructure and models for energy trading at ExxonMobil.

People sometimes read that as a change of career. To me it was the next step of the same one, for three reasons.

Back to building models

My career started with models, not infrastructure: the quasi-1D gas dynamics model of the hybrid rocket engine my senior design team built at Cairo University is what pulled me toward computation. After that came the FDV method for compressible flow, large-eddy simulation of a combustion actuator, and plasma dynamics for my Ph.D.: years of turning equations into numbers I could trust.

HPC moved me one layer down. At ANSYS the question was no longer what to compute but how to compute it on 100,000 cores: domain decomposition, algebraic multigrid, Krylov solvers, parallel I/O. I enjoyed that work, and it taught me most of what I know about performance. But the models themselves belonged to someone else.

Quantitative finance brought me back to them. Pricing and risk are simulation problems: stochastic processes instead of conservation laws, Monte Carlo paths instead of meshes, distributions of outcomes instead of a single flow field. The questions are the ones I asked about the FDV method. Is the scheme right? Does it converge? Which number in the output can be trusted, and how far?

The same full stack, on demanding problems

Leaving HPC did not mean leaving computation behind. Quant analytics is computationally demanding in its own way, and it uses everything I had built up:

  • C++ and Python together. At BP I designed and built a Quantitative Analytics Framework in Python and C++ from scratch, a project with a budget of more than $3 million. Several internal teams adopted it after its first release, and their requests filled a two-year roadmap.
  • Clusters and the cloud. The habits of MPI, from partitioning the work to keeping every core busy, carry over to distributed processing with Databricks and Dask, and to services on Kubernetes and AWS EKS. At BP I also led the move of several analytics products to the cloud.
  • Data at scale. The Shell backend taught me to keep terabytes in memory across a cluster for many users at once. Market data and risk results are smaller, but they are needed by many people at the same time, and always fast.

The full stack matters because a model is only useful once it runs: on current data, at the size of a real portfolio, inside a system that people depend on.

The mathematical side

Quant analytics also appeals to the academic side of me. Pricing and risk rest on probability and stochastic calculus, and on the same numerical analysis I used for my Ph.D.: discretizing equations, controlling error, knowing when a result has converged. The difference is that the results are used the same day.

That interest does not stop at work. Outside it, I maintain samplepaths, a library that generates sample paths of 68 stochastic processes, the raw material of Monte Carlo models. Its results are checked against an independent implementation in Rust, the way I learned to check a CFD code against a known solution; the post on rebuilding it describes how.

Systems that cannot go down

The last reason is the one I expected least. A simulation on a supercomputer is a batch job: if it fails at 3 a.m., it is resubmitted, and the result arrives a little later. Analytics for trading work under different rules. They have to be available when the market moves, answer many users at once, and give the same answer every time.

High availability under high demand is an engineering problem I find as interesting as scaling a solver. It asks for the same discipline, measuring before optimizing, testing the parts that fail rarely, and keeping results reproducible, applied to a system that never stops.

What it adds up to

Looking back, the move from HPC to quant was less a turn than a return: to building models, with the infrastructure skills I gained along the way, for people who need the answer now. The quantitative finance and risk page has the roles, and the HPC software page the years that led to them. The step before this one is in From CFD to seismic.

Copyright © Bassem Girgis