# Leveraging Spark 3 and NVIDIA's GPUs to Reduce Cloud Cost by up to 70% for Big Data Pipelines

DevFeed: [Leveraging Spark 3 and NVIDIA's GPUs to Reduce Cloud Cost by up to 70% for Big Data Pipelines](<https://devfeed.tech/articles/leveraging-spark-3-and-nvidia-s-gpus-to-reduce-cloud-cost-by-up-to-70-for-big-data-pipelines-31935.md>)

Original publisher: [Read original article](<https://medium.com/paypal-tech/leveraging-spark-3-and-nvidias-gpus-to-reduce-cloud-cost-by-up-to-70-for-big-data-pipelines-e0bc02ec4f88?source=rss----6423323524ba---4>)

Author: Ilay Chen

Published: 2024-02-21T16:42:14Z

Content type: article

Language: en

Sources: [PayPal Technology](<https://devfeed.tech/sources/paypal-technology.md>)

Topics: [Apache Spark](<https://devfeed.tech/topics/spark.md>), [big-data](<https://devfeed.tech/topics/big-data.md>), [GPU](<https://devfeed.tech/topics/gpu.md>), [cloud cost management](<https://devfeed.tech/topics/cloud-cost-management.md>), [RAPIDS](<https://devfeed.tech/topics/rapids.md>), [Data pipelines](<https://devfeed.tech/topics/data-pipelines.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [ai](<https://devfeed.tech/tags/ai.md>), [apache-spark](<https://devfeed.tech/tags/apache-spark.md>), [big-data](<https://devfeed.tech/tags/big-data.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [cloud-computing](<https://devfeed.tech/tags/cloud-computing.md>), [cost](<https://devfeed.tech/tags/cost.md>), [data](<https://devfeed.tech/tags/data.md>), [data-processing](<https://devfeed.tech/tags/data-processing.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [gpus](<https://devfeed.tech/tags/gpus.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [nvidia](<https://devfeed.tech/tags/nvidia.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [paypal](<https://devfeed.tech/tags/paypal.md>)

## AI overview

PayPal reports that tuning a large Spark workload before GPU migration--using larger input partitions and Spark 3 adaptive query execution--cut runtime by about 20% and cluster resources by about 30%, for an estimated 45% cost reduction. After migrating the job to NVIDIA Spark RAPIDS, the authors report potential savings up to 70% for eligible workloads. They identify large-data SQL operations such as joins, grouping and sorts as candidates, and cite NVIDIA's Qualification Tool for assessing jobs. GPU tuning required balancing concurrent tasks against memory limits; their Tesla T4 setup settled on two GPU tasks at a time. GPU memory spills also pressured local disks, so doubling SSDs and increasing host spill storage improved stability and runtime. Results depend on workload and configuration; the article notes Spark RAPIDS is not suitable for every job.

## Source excerpt

By Ilay Chen and Tomer Akirav At PayPal, hundreds of thousands of Apache Spark jobs run on an hourly basis, processing petabytes of data and requiring a high volume of resources. To handle the growth of machine learning solutions, PayPal requires scalable environments, cost awareness and constant innovation. This blog explains how Apache Spark 3 and GPUs can help enterprises potentially reduce Apache Spark's jobs cloud costs by up to 70% for big data processing and AI applications. Our journey will begin with a brief introduction of Spark RAPIDS -- Apache Spark's accelerator that leverages GPUs to accelerate processing via the RAPIDS libraries. We will then review PayPal's CPU-based Spark 2 application, our upgrade to Spark 3 and its new capabilities, explore the migration of our Apache Spark application to a GPU cluster, and how we tuned Spark RAPIDS parameters. We will then discuss some challenges we encountered and the benefits of the updates. Libra scales in the cloud, generated by AIBackground GPUs are everywhere, and their parallelism characteristics are perfect for processing AI and graphics applications, among other things. For those unfamiliar: what makes GPUs different from CPUs, computation-wise, is that CPUs have a limited amount of very strong cores, whereas GPUs have thousands, or even tens of thousands or more, relatively weak cores that work together very well. PayPal has been leveraging GPUs to train models for some time now, and so we decided to evaluate if the parallelism of the GPU can be helpful with processing big data applications based on Apache Spark. In our research, we encountered NVIDIA's Spark RAPIDS open-source project. It has many purposes, however we focused on Spark RAPIDS's cost reduction potential, because enterprises like PayPal spend lots of money on running Spark jobs in the cloud. Using Spark with GPUs isn't common in the industry yet, but according to our findings as described in this blog, the potential benefits could be enorm