RAPIDS Release 22.04

Sophie Watson
RAPIDS AI
Published in
5 min readApr 14, 2022

Scaling and simplifying developer experience

Fresh off the back of another successful NVIDIA GPU Technology Conference (GTC), the RAPIDS Team is excited to announce the release of RAPIDS 22.04. In his keynote, NVIDIA’s Founder and CEO, Jensen Huang, spoke about the popularity of RAPIDS and announced that RAPIDS has now been downloaded over 2 million times. This is a huge milestone for the team and community, and we are grateful for your support and engagement.

Many members of the RAPIDS team presented updates and overviews at GTC — you can check out their sessions, and others, on the GTC site.

This latest RAPIDS release provides more support for your data workflows through the addition of new models, techniques and data processing capabilities across all of the RAPIDS libraries. We continue to optimize existing RAPIDS components, and focus on delivering a streamlined user experience, no matter where you’re working.

Key updates from the 22.04 release include:

  • Addition of two new Kernel Methods in cuML
  • New cuGraph algorithms, and trillion-scale benchmarks
  • All NumPy universal functions enabled for cuDF DataFrames

New Kernel Methods in cuML

This release adds two Kernel-based algorithms to cuML’s existing suite of models.

Kernel Density Estimation produces non-parametric density estimates of given datasets, and allows you to impose smoothness and continuity constraints on the resultant estimate through your choice of kernel shape and width. This technique is particularly useful for estimating marginal density functions of particular features in a dataset.

Line graph. The true sample distribution is smooth. It increases from (0,0) to a global maximum at (0.5, 2.5) then decays to (0.5, 0.5), before increasing again to a local maximum at (0.8, 0.8), then decreases to (1.0, 0). The KDE of ‘epanechnikov’ (orange) and ‘linear’ (red) are smooth, and reach the magnitude of the first peak, and overestimate the second. The ‘gaussian’ (navy) KDE is oversmoothed. The ‘tophat’ (sea blue) KDE is a piecewise continuous function.
Kernel Density Estimation of 100 random numbers drawn from a Beta Mixture model using different kernel shapes.
from cuml.neighbors import KernelDensity
import numpy as np
rng = np.random.RandomState(42)
X = rng.random_sample((100, 3))
kde = KernelDensity(kernel='gaussian', bandwidth=0.5).fit(X)
log_density = kde.score_samples(X[:3])

The new Kernel Ridge Regression model allows you to learn a non-parametric estimate of the relationship between variables. This new cuML implementation works for both 1 and 2-dimensional data.

from cuml.kernel_ridge import KernelRidge
import cupy as cp
n_samples, n_features = 10, 5
rng = cp.random.RandomState(0)
y = rng.randn(n_samples)
X = rng.randn(n_samples, n_features)
model = KernelRidge(kernel="poly").fit(X, y)
pred = model.predict(X)
The true sample is plotted in grey. The data is Gaussian with noise, and rises from (-1, 8) to a peak at around (2, 14), then decays to (10, 2). The Kernel Ridge Regressions from ‘poly’ (orange), ‘rbf’ (sea blue) and ‘laplacian’ (red) kernels become less smooth in that order, but the resultant regression estimates are similar.
Kernel Ridge Regression on noisy samples from a truncated Gaussian.

Interruptible execution in cuML

If you’ve worked with cuML before, you’ve probably already run into the situation where you want to stop or interrupt a piece of long-running code which is executing. Perhaps you noticed a typo in your code, or the computation is simply taking longer than you expected, so you wish to cease computation and re-run on a smaller sample of data or with different parameters. However, until this release it was not possible to interrupt code which was already executing without going to the extremes of restarting your Kernel.

With this release it is now possible to interrupt or cancel long-running cuML tasks, using Ctrl+C, giving you a more responsive experience and making it easier to correct your errors quickly! And, we’ve implemented this in a way that means it can be supported in cuGraph in the future — watch this space!

New cuGraph Algorithms and Trillion-scale Benchmarks

cuGraph continues to expand their library, and in the 22.04 release the team has introduced a range of new algorithms and features.

In many situations it is desirable to not only know the connections of your graph, but also associate names and properties with those connections. You can now implement Property Graphs in cuGraph allowing you to model more diverse networks and keep track of metadata and dependencies between nodes.

This release also introduces both a Neighborhood Sampling algorithm and HITS algorithm that works on Multi-Node Multi-GPU (MNMG environments), expanding the range of tools and techniques you can use on large graph datasets.

All of the recent work on cuGraph has led to improved performance of our Supported cuGraph models. We recently ran benchmarks on Trillion-edge networks and were able produce some astonishing results! PageRank was tested on a graph of 1.1 trillion edges, across 2,048 GPUs, and ran in just 19.3 seconds, and Louvain was tested on 1.1 trillion directed edges across 1,024 GPUs, and ran in 336 seconds!

Page Rank benchmarks at scale.

All NumPy universal functions now enabled for DataFrames

If you work with NumPy and pandas, you’re surely comfortable with applying universal functions to scalars, vectors, matrices, series, and data frames — for example, np.round(x) will work whether x is 3.14159, [0.1, 0.1, 0.2, 0.3, 0.5], or a GPU data frame. This is a useful feature because it enables you to write code that is generic with respect to the kind of value (or collection of values) it operates on. Until recently, only some universal functions were supported by cuDF DataFrames, but with the 22.04 RAPIDS release you can now use all of the NumPy ufuncs with your cuDF DataFrames, making it much easier to transform and filter collections on the GPU.

Byte-range support for reading text

When reading text into cuDF it’s not uncommon to want to specify the specific range of text you wish to load. Perhaps you only want to read part of a file, or are processing files across multiple GPUs. For these situations, we have expanded the read_text API so that you can now read text with multiple byte delimiters by specifying a byte_range argument. This enables reading only a subset of the source text efficiently.

import cudf
from io import StringIO
cudf.read_text(StringIO("abc..def..ghi.."), delimiter="..")
0 abc..
1 def..
2 ghi..
3
dtype: object
cudf.read_text(StringIO("abc..def..ghi.."), delimiter="..", byte_range=(0, 7))
0 abc..
1 def..
dtype: object

Compute Covariance of GroupBy Objects

Over the past few RAPIDS releases we have been expanding the set of functions you can apply to GroupBy objects in cuDF. You can now compute the covariance within groups of your data using .groupby().cov().

Put your ARM into it

You can now install RAPIDS on ARM SBSA-based systems such as the EGX platform. Just like with our x86/64 installs, you can quickly get going with Conda or Docker:

Conda

conda create -n rapids-22.04 -c rapidsai -c nvidia -c conda-forge \
rapids=22.04 python=3.9 cudatoolkit=11.5

Docker

docker pull \
rapidsai/rapidsai-core-arm64:22.04-cuda11.5-base-ubuntu20.04-py3.9
docker run --gpus all --rm -it \
rapidsai/rapidsai-core-arm64:22.04-cuda11.5-base-ubuntu20.04-py3.9

Conclusion

On top of the updates discussed here, we’ve been working on additional improvements to bring you updated library versions, the newest versions of dependent libraries, better user experience and more functionality and reliability across all the RAPIDS libraries. Be sure to check out the release notes for all the details.

Thank you to all of the RAPIDS community for the continued feedback, pull requests, and discussions which help us to deliver you an even better RAPIDS experience.

As always, find us on GitHub, follow us on Twitter, and check out our documentation and getting started resources.

--

--