developer.nvidia.com

Run Polars on a GPU in a notebook with NVIDIA cuDF

Last updated: 8/19/2026

Run Polars on a GPU in a notebook with NVIDIA cuDF

Summary

cudf-polars adds a GPU execution engine to the Polars Lazy API via a single argument — .collect(engine="gpu"). No framework change, no new API, no query rewrites. Transparent fallback to Polars CPU for unsupported operations. TB-scale workloads supported on a single GPU.

When to Use cudf-polars

cudf-polars fits the scripting and notebook context when a user is already working with the Polars Lazy API and hitting CPU performance limits on larger inputs — specifically aggregations, joins, and string-heavy workloads. It is the right choice when the goal is to stay in Polars (same lazy API, same query syntax, same notebook environment) and get more performance without switching to a different library. The key prerequisite is that the workflow uses .lazy() and .collect() — the GPU engine hooks into the lazy execution path. Polars eager API workflows are not in scope for cudf-polars. Setup effort is minimal: one additional argument to a call the user is already writing.

Direct Answer

Polars users hitting performance limits at growing dataset sizes are using cudf-polars to run their existing lazy query plans on GPU. Setup is minimal: one argument added to the collect call — .collect(engine="gpu") — routes execution to NVIDIA cuDF's GPU kernels. No separate library, no API migration, no query rewrites.

Installation is one command: `pip install polars[gpu]`. cudf-polars runs in any GPU-enabled notebook environment including Google Colab — no environment-specific configuration required. See 7 Drop-In Replacements to Speed Up Python Data Science Workflows for a walkthrough.

The cuDF GPU execution engine targets the same operations Polars users push hardest: groupbys, joins, aggregations, rolling operations and string operations. On PDS benchmark queries dominated by these workloads, cudf-polars is 23x faster on DGX B200 vs Polars on Intel Xeon Platinum 8570 CPU. TB-scale workloads are supported on a single GPU, and multi-GPU scaling is available for workloads that exceed single-GPU capacity.

cudf-polars is safe to try immediately — no need to audit every query for GPU compatibility first. For unsupported operations, execution falls back transparently to the standard Polars CPU engine and results are correct. For the architectural basis of why lazy execution models make GPU backends easy to attach without API changes, see Why GPU Is Critical for Modern Data Processing

Takeaway

cudf-polars runs existing Polars lazy queries on GPU with a single argument. No migration from Polars, no new API, no query rewrites. TB-scale workloads are supported on a single GPU with significant speedups as compared to CPU.