NVIDIA / NVIDIA/cccl

Reduce cub::DeviceTransform compile time and binary size

Open
#10,027 4 comments 0 reactions 1 assignee Claimed by @bernhardmgruber View on GitHub
cub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

In [rapidsai/cudf#23343](https://github.com/rapidsai/cudf/pull/23343), we use `cub::DeviceTransform::Transform` to materialize range-window bounds from a `cuda::counting_iterator` into a raw output pointer. The transform operation performs a group lookup and binary search.

Replacing `cub::DeviceTransform` with a minimal custom kernel reduced the CUDA compile time from 283.81s to 82.49s and the affected object size from 16.21 MB to 4.99 MB. The measured runtime difference was at most 1% across the cuDF benchmark cases.

The build used CCCL 3.4.0 and CUDA 13.2 on aarch64, with sccache disabled. The relevant code and measurements are available in [this PR comment](https://github.com/rapidsai/cudf/pull/23343#discussion_r3617036963).

We would prefer to use CUB instead of maintaining a custom kernel. Could the compile-time and generated-code overhead of `cub::DeviceTransform` be reduced for this use case?

Related to #5823.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.