Skip to content

Document and Migrate host_span vs span public APIs - #22588

Merged
rapids-bot[bot] merged 33 commits into
NVIDIA:mainfrom
joannamooon:docs/host-span-vs-std-span
Jun 30, 2026
Merged

Document and Migrate host_span vs span public APIs#22588
rapids-bot[bot] merged 33 commits into
NVIDIA:mainfrom
joannamooon:docs/host-span-vs-std-span

Conversation

@joannamooon

@joannamooon joannamooon commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #22560

  • Adds a "When to use host_span vs std::span" subsection to DEVELOPER_GUIDE.md
  • Migrates all paired cudf:: / cudf::detail:: public APIs that used host_span purely as a host buffer view to std::span (null mask, groupby, concatenate, interop, scalar, dictionaries, rolling, parquet, hybrid scan)
  • Updates the corresponding Cython bindings (span.pxd, hybrid_scan.pxd/.pyx) to expose std::span via a new std_span wrapper
  • Internal-only implementation files (compute_groupby, compute_single_pass_aggs, extract_single_pass_aggs, etc.) were updated as a necessary cascade to keep the build consistent after the public API signatures changed — not as an intentional scope expansion

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Clarified when to prefer `std::span` for host-side data and when to use `cudf::host_span`, including specific scenarios for each. This enhances the documentation for developers regarding memory management in the library.
@copy-pr-bot

copy-pr-bot Bot commented May 19, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label May 19, 2026
@github-actions github-actions Bot added Python Affects Python cuDF API. pylibcudf Issues specific to the pylibcudf package labels May 20, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python May 20, 2026
@joannamooon
joannamooon marked this pull request as ready for review May 22, 2026 04:01
@joannamooon
joannamooon requested review from a team as code owners May 22, 2026 04:01
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Converts many host-side non-owning parameters from cudf::host_span to std::span, adds <span> includes, updates call-site adapters, updates developer guide, and adjusts Cython bindings for hybrid-scan and Parquet IO.

Changes

std::span migration and doc update

Layer / File(s) Summary
Span migration (headers, sources, bindings, docs)
cpp/include/*, cpp/src/*, cpp/doxygen/developer_guide/DEVELOPER_GUIDE.md, python/pylibcudf/*
Replaces cudf::host_span with std::span across public/detail headers and C++ sources (groupby, copying, IO/parquet, hybrid-scan, rolling, null-mask, dictionary, scalar, roaring, etc.), adds #include <span> where required, adapts call sites by constructing host_span adapters when downstream still expects host_span, updates developer guide subsection about when to use host_span vs std::span, and updates Cython .pxd/.pyx to use std_span interop.
  • Estimated code review effort:
    🎯 4 (Complex) | ⏱️ ~60 minutes

  • Possibly related PRs:

    • rapidsai/cudf#22587 — Updates Python parquet readers and footer plumbing; intersects with this PR’s Parquet footer std::span changes.
  • Suggested reviewers:

    • shrshi
    • mroeschke
    • wence-
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@joannamooon

joannamooon commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

rapidsmpf links against libcudf and is pulled into CI prebuilt from nightlies. It's being compiled against the old host_span signatures.

I created a new PR in rapidsmpf: rapidsai/rapidsmpf#1077
This PR update cudf call sites.

After merging rapidsmpf#1077, the next published rapidsmpf nightly should clear the failures in the current ci.

@PointKernel PointKernel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and thank you @joannamooon for updating rapidsmpf accordingly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those cuIO changes look legitimate to me. Just FYI, @mhaseeb123 is also working in the same files

@PointKernel

Copy link
Copy Markdown
Member

/ok to test 0c4a9d4

@vyasr

vyasr commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@joannamooon I'm in the middle of a large refactor that will move all the parts of rapidsmpf that call libcudf into a new library in this repository. All rapidsmpf development is temporarily frozen as a result of that. Once that is done, though, you should have a much easier time getting unblocked here.

…td-span

# Conflicts:
#	cpp/src/io/parquet/experimental/hybrid_scan_impl.cpp
#	cpp/src/io/parquet/experimental/hybrid_scan_impl.hpp
#	cpp/src/io/parquet/io_utils/parquet_io_utils.cpp
#	cpp/src/rolling/grouped_rolling.cu
@vyasr

vyasr commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

/ok to test 40581d5

@vyasr

vyasr commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

/ok to test 210fb82

@vyasr

vyasr commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

/ok to test 058fb95

@vyasr

vyasr commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

/ok to test a10bd5c

@PointKernel

Copy link
Copy Markdown
Member

/ok to test c1834b7

@PointKernel

Copy link
Copy Markdown
Member

/ok to test b3949e9

@PointKernel

Copy link
Copy Markdown
Member

@joannamooon We don't need to keep the branch continuously updated with the latest upstream main. I'll relaunch the CI, and if it passes, I'll merge it as-is, even if it's a few commits behind main.

@PointKernel

Copy link
Copy Markdown
Member

/ok to test c9a88c0

@PointKernel

Copy link
Copy Markdown
Member

/merge

@rapids-bot
rapids-bot Bot merged commit aa8cfca into NVIDIA:main Jun 30, 2026
137 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA] Document and apply the host-side span convention: prefer std::span unless device accessibility is needed

6 participants