Data Science

RAPIDS cuDF Instantly Accelerates pandas up to 50x on Google Colab

At Google I/O’24, Laurence Moroney, head of AI Advocacy at Google, announced that RAPIDS cuDF is now integrated into Google Colab. Developers can now instantly accelerate pandas code up to 50x on Google Colab GPU instances, and continue using pandas as data grows—without sacrificing performance.

RAPIDS cuDF is a GPU DataFrame library that accelerates the data processing tool pandas with zero code changes. Google Colab is one of the most popular platforms for Python-based data science that has become a standard tool with more than 10 million monthly users

A cloud-hosted platform, Colab provides an out-of-the-box data science notebook environment that’s accessible from your browser. Its easy-to-use infrastructure includes GPUs across free and paid tiers. 

You can accelerate your pandas code on the platform in seconds using a single command at the top of your GPU-enabled Colab notebook: 

%load_ext cudf.pandas

We’re excited that RAPIDS cuDF is now instantly available to all developers for accelerating data analytics workflows. This post explains more about RAPIDS cuDF, expected performance on Colab, and how to get started.

RAPIDS cuDF accelerates pandas with zero code changes

While pandas is one of the world’s most popular data processing tools, it struggles as data sizes grow. With even 5 to 10 GB of data, many simple operations can take minutes to finish on the CPU, slowing down exploratory analysis and production data pipelines.

RAPIDS cuDF brings the power of accelerated computing to pandas, so you can continue using pandas as data grows—without compromising performance. The library seamlessly accelerates pandas code on GPUs where applicable, and otherwise falls back to CPU pandas. The cuDF zero code change acceleration for pandas (cudf.pandas) is generally available and ready for production use with the 24.02 release. 

Benchmarking performance on Google Colab

The impact that larger datasets have on performance is readily visible in the pandas portion of the popular DuckDB Database-like Ops Benchmark. Originally developed by, the DuckDB benchmark setup compares popular CPU-based DataFrame and SQL engines on a series of common analytics tasks, such as joining data together or computing statistical measures per group.

Based on the DuckDB Database-like Ops Benchmark at 5 GB scale, pandas performance slows to a crawl, taking minutes to perform the series of join and advanced group-by operations.

In comparison, cuDF provides up to 50x speedups over standard pandas on the DuckDB benchmark operations when using NVIDIA L4 Tensor Core GPUs. These GPUs are newly available in Google Colab for paid-tier users. 

Bar chart shows a 50x speed increase using pandas with RAPIDS cuDF on NVIDIA L4 GPUs that are available in the Google Colab paid tier.
Figure 1. Standard DuckDB Data Benchmark (5 GB) performance comparison between cudf.pandas and traditional pandas v2.2 

HW: NVIDIA L4, CPU: Intel Xeon 8480CL | SW: pandas v2.2.1, RAPIDS cuDF 24.02

For more information about these benchmark results and how to reproduce them, see the cuDF benchmarks documentation.

Get started

Ready to try RAPIDS cuDF on Google Colab? Simply change the runtime type to GPU and drop in %load_ext cudf.pandas over pandas code.

To learn more about using RAPIDS cuDF on Google Colab, explore these example notebooks: 

For a complete overview of RAPIDS cuDF, check out the GTC session, Accelerating Pandas with Zero Code Change Using RAPIDS cuDF.

Discuss (0)