Delivering the Missing Building Blocks for NVIDIA CUDA Kernel Fusion in Python

AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.

Why it matters

Python GPU developers can now use CUB/Thrust building blocks directly, fusing custom algorithms into single kernels without writing C++ or slow memory-allocating array code.

Read this as

NVIDIA released cuda-cccl, a Python library giving access to CUB and Thrust, C++ building blocks that libraries like PyTorch use internally for fast GPU code. It lets developers combine small operations into a single fast computation instead of allocating memory for each step. In a test, it summed a sequence in 28.3 microseconds versus 690 microseconds using CuPy's array operations. It is for people building custom GPU algorithms in Python rather than replacing existing libraries.

NVIDIA's cuda-cccl closes a gap that forced Python GPU library developers to write C++ for custom algorithms, on which projects like PyTorch, TensorFlow, XGBoost and RAPIDS already rely. It is free via pip install cuda-cccl and targets library builders rather than everyday users of CuPy or PyTorch. Teams currently maintaining C++ Python bindings to Thrust or CUB are the most direct beneficiaries. Adoption cost is low, but the APIs are deliberately low-level.

cuda-cccl exposes CUB and Thrust to Python via two modules: cuda.compute for array/range algorithms and cuda.coop for block- and warp-level numba.cuda kernels. Speedup comes from iterators like CountingIterator and TransformIterator representing sequences without allocation, explicit kernel fusion, and a thin layer over device code, reducing four kernel launches to one. Benchmark: reduce_into built with cuda.compute ran 28.3 μs versus 690 μs for a naive CuPy implementation on an RTX 6000 Ada Generation GPU. The C++-mirroring APIs are intentionally low-level.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

cuda-cccl cuda.compute cuda.coop CUB Thrust CountingIterator TransformIterator

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading