Skip to content

Additional fixes for libcudf large strings support - #23612

Open
davidwendt wants to merge 3 commits into
NVIDIA:mainfrom
davidwendt:large-strings-again
Open

Additional fixes for libcudf large strings support#23612
davidwendt wants to merge 3 commits into
NVIDIA:mainfrom
davidwendt:large-strings-again

Conversation

@davidwendt

Copy link
Copy Markdown
Contributor

Description

Fixes some code logic where strings offsets were hardcoded to expect int32 (or cudf::size_type).
These were found while investigating size_type/offset-type usage in libcudf.

Checklist

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

@davidwendt davidwendt self-assigned this Aug 10, 2026
@davidwendt davidwendt added the bug Something isn't working label Aug 10, 2026
@davidwendt
davidwendt requested a review from a team as a code owner August 10, 2026 20:47
@davidwendt davidwendt added the 3 - Ready for Review Ready for review by team label Aug 10, 2026
@davidwendt
davidwendt requested a review from vyasr August 10, 2026 20:47
@davidwendt davidwendt added the libcudf Affects libcudf (C++/CUDA) code. label Aug 10, 2026
@davidwendt davidwendt added the non-breaking Non-breaking change label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Performance

    • Improved GPU-based processing for JSON string handling, field-name matching, string joining, and n-gram tokenization.
    • Reduced host-side offset construction and improved offset processing during data transfers.
  • Bug Fixes

    • Improved compatibility and correctness when working with string offsets and generated tokenization results.
  • Maintenance

    • Updated copyright attributions and internal processing utilities.

Walkthrough

The PR updates JSON string-offset copying and field-name hashing to use offsetalator_factory. String joining and n-gram tokenization now use make_offsets_child_column for offset construction.

Changes

Offset handling updates

Layer / File(s) Summary
JSON offset iterator handling
cpp/src/io/json/host_tree_algorithms.cu, cpp/src/io/json/json_tree.cu
String offsets are normalized into int64_t device storage before host copying. Decoded field-name hashing and equality use offset iterators.
String and text offset construction
cpp/src/strings/combine/join.cu, cpp/src/text/ngrams_tokenize.cu
String joining and n-gram tokenization use make_offsets_child_column to construct output offsets. Copyright notices and required headers are updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: improvement

Suggested reviewers: vyasr, pmattione-nvidia, karthikeyann

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies additional fixes for libcudf large-string support, which matches the main changeset.
Description check ✅ Passed The description explains that the changes fix hardcoded int32 and cudf::size_type string offsets, matching the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cpp/src/io/json/json_tree.cu (1)

577-581: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Declare the return type of d_equal.

d_equal is a generic device comparator used by cuco::static_set. Add -> bool to the lambda declaration.

As per coding guidelines, extended device lambdas passed to device algorithms must declare explicit return types.

Proposed fix
-  auto const d_equal = [char_ptr, offset_itr] __device__(auto node_id1, auto node_id2) {
+  auto const d_equal =
+    [char_ptr, offset_itr] __device__(auto node_id1, auto node_id2) -> bool {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/src/io/json/json_tree.cu` around lines 577 - 581, Update the d_equal
device lambda declaration to explicitly specify a bool return type using
trailing-return syntax, preserving its existing comparator logic and
compatibility with cuco::static_set.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cpp/src/io/json/json_tree.cu`:
- Around line 577-581: Update the d_equal device lambda declaration to
explicitly specify a bool return type using trailing-return syntax, preserving
its existing comparator logic and compatibility with cuco::static_set.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3a041847-a7ab-40e5-8790-421d72decebc

📥 Commits

Reviewing files that changed from the base of the PR and between 463fba2 and 1b0c47a.

📒 Files selected for processing (4)
  • cpp/src/io/json/host_tree_algorithms.cu
  • cpp/src/io/json/json_tree.cu
  • cpp/src/strings/combine/join.cu
  • cpp/src/text/ngrams_tokenize.cu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants