A serverless architecture for high performance financial modelling

By Amazon Web Services

September 13, 2022

Contributions from Blythe Walker , CTO RenaissanceRe, Colum Thorne, VP Platform Architecture RenaissanceRe, Eoin Shanaghy – CTO fourTheorem, Luciano Mammino, Senior Cloud Architect fourTheorem, Matthew Meckes, Senior Serverless Specialist AWS

RenaissanceRe is one of the world’s leading reinsurance companies, consistently recognized for our innovation, technical excellence, and creative problem-solving. We specialize in matching well-structured risks with efficient sources of capital to help companies and government entities manage the risks of operating in a volatile and uncertain world, including climate change, natural hazards like wildfires and hurricanes, cyber threats, and significant societal upheaval. In 2021 gross premiums were $8B with around $18B of capital under management.

Understanding deal and portfolio risk and capital requirements is a computationally expensive process that requires the execution of multiple financial forecasting models every day and often in real-time. The company invests heavily in developing and refining its modeling expertise and technology to ensure that it can provide world-class services to its customers.

Understanding the risk portfolio requirements

The process of computing market risk exposure is called the portfolio rollup. This process executes Monte-Carlo based risk models and simulations to compute the market exposure across all deals in the portfolio.

The portfolio is a graph that comprises over 7,000 deals with a complex dependency relationship between deals.

RenaissanceRe ran the portfolio rollup as a batch computation processing approximately 45TB of data and producing 600GB of raw analytic output for every run. During typical operations, the requirement is to run around 5 rollup runs per day.

Besides batch-based risk computation, the business requires real-time deal analytics. This mode of operation provides the capability to run risk models on individual deals so that underwriters can price in near real-time, for example, when they are on the phone with a broker. While deal analytics operates on a fraction of the data, it must run at a much higher frequency – thousands of deal analytics runs per day, at peak times.

The on-premises system

RenaissanceRe implemented the previous incarnation of their risk modelling system on-premises.

Figure 1: A Python-based web server distributing jobs to a large Celery cluster through RabbitMQ using Redis and a Network File Share and a high-performing SAN for state management and data persistence. The Celery cluster comprised 9 high specification servers (512GB of RAM and 48 CPU cores).

Because of strong business growth, the number of contracts under risk has grown significantly since this solution was first implemented. This placed considerable stress on the available on-premises compute resources. Specifically:

  • At current volumes, the on-premises system could run a maximum of only 2-3 runs of portfolio rollups per day, each of which could take up to 10 hours. This limited the ability to re-assess the risk position as the portfolio evolved.
  • They executed deal analytics in the same cluster, causing resource contention. This required careful coordination among staff and caused frustration, limiting our business agility.
  • There was a growing requirement to run multiple, isolated, workloads to model additional market exposure scenarios. This could not be done with the on-premises compute and the available resource pool.
  • The overall total cost of ownership (TCO) was high. Adding capacity to the existing cluster required a lot of upfront capacity planning.

The road to AWS and serverless

In 2020 RenaissanceRe decided to stop investing in the on-premises cluster, and to re-imagine the system on AWS. While it would certainly have been possible to lift and shift this workload to EC2, we instead adopted a ‘serverless first’ approach for the migration based on these six high-level goals:

  1. Reduce overall execution times for portfolio rollup, with a target execution time to be close to 1 hour.
  2. Support higher volume of executions (plan for 15x data volume).
  3. Benefit from scale on-demand and reduce costs through a pay-per-use pricing model.
  4. Reduce undifferentiated heavy lifting and lower the overall TCO.
  5. Adopt Infrastructure as Code (IaC) and CI/CD pipelines for reliable, repeatable automated deployments.
  6. Increase business agility and support rapid innovation.

The solution

Achieving these goals required the team to adopt a design for the system that is radically different to the current on-premises system. Figure 2 illustrates the architecture.

Figure 2: Serverless architecture for the risk modelling system with batch workflows using AWS Fargate and real time analytics using AWS Lambda.

The two primary flows are the bulk / batch computation (yellow) for portfolio rollup and the high priority real-time (blue) for deal analytics. Both types execute the same modelling codes and are controlled by the same orchestration components.

When a portfolio rollup or a deal analytics execution starts, we submit it to the execution planner, which is implemented in AWS Step Functions. This builds the execution plan for the run, which is then stored in Amazon ElastiCache for Redis and begins execution of jobs that can run immediately.

We post jobs that are ready to the Amazon Kinesis ‘Job’ stream and from there, we send the jobs to either AWS Fargate or AWS Lambda for execution. The Fargate containers and Lambda modelling functions run the same modelling code, however both services offer different scaling and pricing characteristics; Lambda provides rapid on demand scaling and execution but at a higher price point. This makes it ideal for real-time deal analytics. At the scale of a full portfolio rollup, Lambda is more expensive and the instant scale out is not required, so we compute these jobs on Fargate. This can significantly lower the cost for bulk modelling, sacrificing some raw throughput to container scale-out time.

On job completion, we send an event to the Job State Change’ Kinesis stream, which is picked up by the Lambda scheduler. The scheduler queries and updates the execution plan and submits further jobs that can now be run to the job stream.

We use Amazon Simple Storage Service (Amazon S3) as the primary storage service, creating a computational data lake, supplying input model parameters, exposures, loss and contract data files. Results from both portfolio rollup and deal analytics are written to S3 for downstream consumption by reporting and line-of-business systems.

Execution planner

The execution planner sits at the head of the process. We provide it with a set of deals to compute which could be as small as a single deal for a deal analytic, or up to seven thousand deals for a full portfolio rollup. There is a complex interdependency between deals. This means that the inputs to some deal computations require the results from previous deals to complete first. The first step in planning the execution is to build a directed acyclic graph (DAG) of deal dependencies (the deal DAG). Once the deal DAG has been constructed, the scheduler then computes an execution plan by walking the DAG.

We consult the execution plan throughout the run, in order to determine which jobs are available for execution. Execution begins with the set of jobs at the start of the chain, i.e., those that have no dependencies.

Job scheduling, caching and error handling

We give each job an execution priority during the planning phase. Typically, we assign a high priority to deal analytics and a lower priority to portfolio rollups.

We place standard priority jobs into an Amazon Simple Queue Service (Amazon SQS) queue for execution by a Fargate modelling container. During a full run, there will be up to 3,000 containers executing in parallel. High priority jobs are submitted to Lambda for execution which provides immediate scale on demand.

As each job completes, we write results to S3 and update the ‘job state change’ Kinesis Stream. The scheduler Lambda functions take input from the change stream and update the job state cache which is held in ElastiCache for Redis. This dynamically updates the overall execution plan for the run. As the run proceeds, the scheduler consults the execution plan to identify jobs that have satisfied their upstream dependencies. These jobs are submitted for execution.

Elasticache is also used to cache results. If a deal has been recently computed with the same input parameters, we use the cached result and update the execution plan – updated as if we had run the job.

Occasionally, failures will occur during job execution, like a Fargate container crash. This will cause an error event to be written to Amazon EventBridge. A handler function will log this error condition and then place an update into the job state stream. The job scheduler will resubmit the failed job for execution up to three times before marking the job as permanently failed. A run that has jobs that repeatedly fail to execute will cause the entire run to be halted and raise an alert condition.

Challenges we overcame

Applying a serverless technology stack to financial modelling has proven to be beneficial to the business, but there were several key challenges to be overcome along the way…

Read the full blog to learn more. Reminder: You can learn a lot from AWS HPC engineers by subscribing to the HPC Tech Short YouTube channel, and following the AWS HPC Blog channel.

Return to Solution Channel Homepage
Subscribe to HPCwire's Weekly Update!

Be the most informed person in the room! Stay ahead of the tech trends with industy updates delivered to you every week!

Nvidia Shuts Out RISC-V Software Support for GPUs 

September 23, 2022

Nvidia is not interested in bringing software support to its GPUs for the RISC-V architecture despite being an early adopter of the open-source technology in its GPU controllers. Nvidia has no plans to add RISC-V support for CUDA, which is the proprietary GPU software platform, a company representative... Read more…

Microsoft Closes Confidential Computing Loop with AMD’s Milan Chip

September 22, 2022

Microsoft shared details on how it uses an AMD technology to secure artificial intelligence as it builds out a secure AI infrastructure in its Azure cloud service. Microsoft has a strong relationship with Nvidia, but is also working with AMD's Epyc chips (including the new 3D VCache series), MI Instinct accelerators, and also... Read more…

Nvidia Introduces New Ada Lovelace GPU Architecture, OVX Systems, Omniverse Cloud

September 20, 2022

In his GTC keynote today, Nvidia CEO Jensen Huang launched another new Nvidia GPU architecture: Ada Lovelace, named for the legendary mathematician regarded as the first computer programmer. The company also announced tw Read more…

Nvidia’s Hopper GPUs Enter ‘Full Production,’ DGXs Delayed Until Q1

September 20, 2022

Just about six months ago, Nvidia’s spring GTC event saw the announcement of its hotly anticipated Hopper GPU architecture. Now, the GPU giant is announcing that Hopper-generation GPUs (which promise greater energy eff Read more…

NeMo LLM Service: Nvidia’s First Cloud Service Makes AI Less Vague

September 20, 2022

Nvidia is trying to uncomplicate AI with a cloud service that makes AI and its many forms of computing less vague and more conversational. The NeMo LLM service, which Nvidia called its first cloud service, adds a layer of intelligence and interactivity... Read more…

AWS Solution Channel

Shutterstock 1194728515

Simulating 44-Qubit quantum circuits using AWS ParallelCluster

Dr. Fabio Baruffa, Sr. HPC & QC Solutions Architect
Dr. Pavel Lougovski, Pr. QC Research Scientist
Tyson Jones, Doctoral researcher, University of Oxford

Introduction

Currently, an enormous effort is underway to develop quantum computing hardware capable of scaling to hundreds, thousands, and even millions of physical (non-error-corrected) qubits. Read more…

Microsoft/NVIDIA Solution Channel

Shutterstock 1166887495

Improving Insurance Fraud Detection using AI Running on Cloud-based GPU-Accelerated Systems

Insurance is a highly regulated industry that is evolving as the industry faces changing customer expectations, massive amounts of data, and increased regulations. A major issue facing the industry is tracking insurance fraud. Read more…

Nvidia Targets Computers for Robots in the Surgery Rooms

September 20, 2022

Nvidia is laying the groundwork for a future in which humans and robots will be collaborators in the surgery rooms at hospitals. The company announced a computer called IGX for Medical Devices, which will be populated in robots, image scanners and other computers and medical devices involved in patient care close to the point... Read more…

Nvidia Shuts Out RISC-V Software Support for GPUs 

September 23, 2022

Nvidia is not interested in bringing software support to its GPUs for the RISC-V architecture despite being an early adopter of the open-source technology in its GPU controllers. Nvidia has no plans to add RISC-V support for CUDA, which is the proprietary GPU software platform, a company representative... Read more…

Nvidia Introduces New Ada Lovelace GPU Architecture, OVX Systems, Omniverse Cloud

September 20, 2022

In his GTC keynote today, Nvidia CEO Jensen Huang launched another new Nvidia GPU architecture: Ada Lovelace, named for the legendary mathematician regarded as Read more…

Nvidia’s Hopper GPUs Enter ‘Full Production,’ DGXs Delayed Until Q1

September 20, 2022

Just about six months ago, Nvidia’s spring GTC event saw the announcement of its hotly anticipated Hopper GPU architecture. Now, the GPU giant is announcing t Read more…

NeMo LLM Service: Nvidia’s First Cloud Service Makes AI Less Vague

September 20, 2022

Nvidia is trying to uncomplicate AI with a cloud service that makes AI and its many forms of computing less vague and more conversational. The NeMo LLM service, which Nvidia called its first cloud service, adds a layer of intelligence and interactivity... Read more…

Nvidia Targets Computers for Robots in the Surgery Rooms

September 20, 2022

Nvidia is laying the groundwork for a future in which humans and robots will be collaborators in the surgery rooms at hospitals. The company announced a computer called IGX for Medical Devices, which will be populated in robots, image scanners and other computers and medical devices involved in patient care close to the point... Read more…

Survey Results: PsiQuantum, ORNL, and D-Wave Tackle Benchmarking, Networking, and More

September 19, 2022

The are many issues in quantum computing today – among the more pressing are benchmarking, networking and development of hybrid classical-quantum approaches. Read more…

HPC + AI Wall Street to Feature ‘Spooky’ Science for Financial Services

September 18, 2022

Albert Einstein famously described quantum mechanics as "spooky action at a distance" due to the non-intuitive nature of superposition and quantum entangled par Read more…

Analog Chips Find a New Lease of Life in Artificial Intelligence

September 17, 2022

The need for speed is a hot topic among participants at this week’s AI Hardware Summit – larger AI language models, faster chips and more bandwidth for AI machines to make accurate predictions. But some hardware startups are taking a throwback approach for AI computing to counter the more-is-better... Read more…

Nvidia Shuts Out RISC-V Software Support for GPUs 

September 23, 2022

Nvidia is not interested in bringing software support to its GPUs for the RISC-V architecture despite being an early adopter of the open-source technology in its GPU controllers. Nvidia has no plans to add RISC-V support for CUDA, which is the proprietary GPU software platform, a company representative... Read more…

AWS Takes the Short and Long View of Quantum Computing

August 30, 2022

It is perhaps not surprising that the big cloud providers – a poor term really – have jumped into quantum computing. Amazon, Microsoft Azure, Google, and th Read more…

The Final Frontier: US Has Its First Exascale Supercomputer

May 30, 2022

In April 2018, the U.S. Department of Energy announced plans to procure a trio of exascale supercomputers at a total cost of up to $1.8 billion dollars. Over the ensuing four years, many announcements were made, many deadlines were missed, and a pandemic threw the world into disarray. Now, at long last, HPE and Oak Ridge National Laboratory (ORNL) have announced that the first of those... Read more…

US Senate Passes CHIPS Act Temperature Check, but Challenges Linger

July 19, 2022

The U.S. Senate on Tuesday passed a major hurdle that will open up close to $52 billion in grants for the semiconductor industry to boost manufacturing, supply chain and research and development. U.S. senators voted 64-34 in favor of advancing the CHIPS Act, which sets the stage for the final consideration... Read more…

Top500: Exascale Is Officially Here with Debut of Frontier

May 30, 2022

The 59th installment of the Top500 list, issued today from ISC 2022 in Hamburg, Germany, officially marks a new era in supercomputing with the debut of the first-ever exascale system on the list. Frontier, deployed at the Department of Energy’s Oak Ridge National Laboratory, achieved 1.102 exaflops in its fastest High Performance Linpack run, which was completed... Read more…

Chinese Startup Biren Details BR100 GPU

August 22, 2022

Amid the high-performance GPU turf tussle between AMD and Nvidia (and soon, Intel), a new, China-based player is emerging: Biren Technology, founded in 2019 and headquartered in Shanghai. At Hot Chips 34, Biren co-founder and president Lingjie Xu and Biren CTO Mike Hong took the (virtual) stage to detail the company’s inaugural product: the Biren BR100 general-purpose GPU (GPGPU). “It is my honor to present... Read more…

Newly-Observed Higgs Mode Holds Promise in Quantum Computing

June 8, 2022

The first-ever appearance of a previously undetectable quantum excitation known as the axial Higgs mode – exciting in its own right – also holds promise for developing and manipulating higher temperature quantum materials... Read more…

AMD’s MI300 APUs to Power Exascale El Capitan Supercomputer

June 21, 2022

Additional details of the architecture of the exascale El Capitan supercomputer were disclosed today by Lawrence Livermore National Laboratory’s (LLNL) Terri Read more…

Leading Solution Providers

Contributors

Tesla Bulks Up Its GPU-Powered AI Super – Is Dojo Next?

August 16, 2022

Tesla has revealed that its biggest in-house AI supercomputer – which we wrote about last year – now has a total of 7,360 A100 GPUs, a nearly 28 percent uplift from its previous total of 5,760 GPUs. That’s enough GPU oomph for a top seven spot on the Top500, although the tech company best known for its electric vehicles has not publicly benchmarked the system. If it had, it would... Read more…

Exclusive Inside Look at First US Exascale Supercomputer

July 1, 2022

HPCwire takes you inside the Frontier datacenter at DOE's Oak Ridge National Laboratory (ORNL) in Oak Ridge, Tenn., for an interview with Frontier Project Direc Read more…

AMD Opens Up Chip Design to the Outside for Custom Future

June 15, 2022

AMD is getting personal with chips as it sets sail to make products more to the liking of its customers. The chipmaker detailed a modular chip future in which customers can mix and match non-AMD processors in a custom chip package. "We are focused on making it easier to implement chips with more flexibility," said Mark Papermaster, chief technology officer at AMD during the analyst day meeting late last week. Read more…

Intel Reiterates Plans to Merge CPU, GPU High-performance Chip Roadmaps

May 31, 2022

Intel reiterated it is well on its way to merging its roadmap of high-performance CPUs and GPUs as it shifts over to newer manufacturing processes and packaging technologies in the coming years. The company is merging the CPU and GPU lineups into a chip (codenamed Falcon Shores) which Intel has dubbed an XPU. Falcon Shores... Read more…

Nvidia, Intel to Power Atos-Built MareNostrum 5 Supercomputer

June 16, 2022

The long-troubled, hotly anticipated MareNostrum 5 supercomputer finally has a vendor: Atos, which will be supplying a system that includes both Nvidia and Inte Read more…

UCIe Consortium Incorporates, Nvidia and Alibaba Round Out Board

August 2, 2022

The Universal Chiplet Interconnect Express (UCIe) consortium is moving ahead with its effort to standardize a universal interconnect at the package level. The c Read more…

Using Exascale Supercomputers to Make Clean Fusion Energy Possible

September 2, 2022

Fusion, the nuclear reaction that powers the Sun and the stars, has incredible potential as a source of safe, carbon-free and essentially limitless energy. But Read more…

Is Time Running Out for Compromise on America COMPETES/USICA Act?

June 22, 2022

You may recall that efforts proposed in 2020 to remake the National Science Foundation (Endless Frontier Act) have since expanded and morphed into two gigantic bills, the America COMPETES Act in the U.S. House of Representatives and the U.S. Innovation and Competition Act in the U.S. Senate. So far, efforts to reconcile the two pieces of legislation have snagged and recent reports... Read more…

  • arrow
  • Click Here for More Headlines
  • arrow
HPCwire