Skip to content

Add parquet benchmark for output_dict_columns option - #23596

Merged
rapids-bot[bot] merged 6 commits into
NVIDIA:mainfrom
y2kiran:ykiran-dict-transcode-bench
Aug 21, 2026
Merged

Add parquet benchmark for output_dict_columns option#23596
rapids-bot[bot] merged 6 commits into
NVIDIA:mainfrom
y2kiran:ykiran-dict-transcode-bench

Conversation

@y2kiran

@y2kiran y2kiran commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds benchmarks to test the newly added output_dict_columns options for the Parquet reader, which was introduced in this PR

Checklist

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

@y2kiran
y2kiran requested review from a team as code owners August 7, 2026 22:08
@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 65687c84-25fb-4afb-8236-86a7eb0e6c2c

📥 Commits

Reviewing files that changed from the base of the PR and between 7c536bf and 3483447.

📒 Files selected for processing (2)
  • cpp/benchmarks/io/nvbench_helpers.hpp
  • cpp/benchmarks/io/parquet/parquet_reader_options.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • cpp/benchmarks/io/nvbench_helpers.hpp
  • cpp/benchmarks/io/parquet/parquet_reader_options.cpp

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added benchmark coverage for reading Parquet data with dictionary-encoded or string output.
    • Expanded benchmark options to compare dictionary output across different row-group sizes.
    • Added a public setting for enabling or disabling dictionary output.

Walkthrough

The PR adds an output_dict NVBench enum and applies it to Parquet reader option benchmarks. Existing benchmark axes expose dictionary output, and parquet_read_dict_output compares dictionary and string output across row-group sizes.

Changes

Parquet dictionary-output benchmarks

Layer / File(s) Summary
Dictionary-output benchmark contract
cpp/benchmarks/io/nvbench_helpers.hpp
Adds the public output_dict enum with YES and NO values and registers NVBench string conversions.
Parquet reader benchmark integration
cpp/benchmarks/io/parquet/parquet_reader_options.cpp
Adds dictionary-output configuration to existing benchmark axes and introduces parquet_read_dict_output for flat-string reads across two row-group sizes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 34834

This PR only updates Parquet benchmark support in two benchmark files; no actionable merge-blocking risk remains, so it is merge-ready after normal checks and review.

Suggested reviewers: mattgara, misiugodfrey

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.10% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding a Parquet benchmark for the output_dict_columns option.
Description check ✅ Passed The description directly explains that the pull request adds benchmarks for the Parquet reader's output_dict_columns option.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@vuule vuule left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we add this to parquet_reader_options.cpp and follow the existing benchmark patterns there? Since this measures output_dict_columns, keeping it with the other reader-options benchmarks would make it easier to find and maintain.
Could we also make the PR title more specific, for example: “Add benchmark for Parquet output_dict_columns”?

@vuule vuule added tests Unit testing for project improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 12, 2026
@y2kiran y2kiran changed the title Add parquet benchmark Add parquet benchmark for output_dict_columns option Aug 12, 2026
@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch from 6b75627 to 6edb425 Compare August 12, 2026 21:43
@y2kiran
y2kiran requested a review from a team as a code owner August 12, 2026 21:43
@copy-pr-bot

copy-pr-bot Bot commented Aug 12, 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.

@y2kiran

y2kiran commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@vuule Apologies for the title. Apparently I missed it and it just used the name of the commit.

I've incorporated this into the existing parquet_reader_options benchmark. Thanks for the input!

@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.

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@cpp/benchmarks/io/parquet/parquet_reader_options.cpp`:
- Around line 206-222: The BM_parquet_read_options benchmark currently validates
only column count, so add a non-timed preflight that inspects an eligible flat
STRING column and verifies its type is DICTIONARY32 when output_dict is YES and
STRING when output_dict is NO. Keep the timing path unchanged and use the
existing benchmark setup and output_dict axis symbols.
- Around line 221-222: Update the row_group_size_rows axis in the benchmark
options to use 100'000 instead of 1'000'000, preserving 0 while ensuring the
configured values represent distinct row-group limits.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e4f95eb-a035-46c1-a993-59aa00e24692

📥 Commits

Reviewing files that changed from the base of the PR and between 4ec7b3b and 6edb425.

📒 Files selected for processing (2)
  • cpp/benchmarks/io/nvbench_helpers.hpp
  • cpp/benchmarks/io/parquet/parquet_reader_options.cpp

Comment thread cpp/benchmarks/io/parquet/parquet_reader_options.cpp Outdated
Comment thread cpp/benchmarks/io/parquet/parquet_reader_options.cpp Outdated
@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch from 6edb425 to a40db45 Compare August 13, 2026 19:44
@vuule
vuule self-requested a review August 14, 2026 02:36
Comment on lines +100 to +119
// Non-timed preflight: confirm the reader honors `output_dict_columns` on a flat STRING column --
// YES transcodes it to DICTIONARY32, NO leaves it as STRING. Skipped when
// `convert_strings_to_categories` is set.
if constexpr (not str_to_categories) {
auto const preflight_tbl = cudf::io::read_parquet(read_options).tbl;
auto const preflight = preflight_tbl->view();
auto const has_type = [&](cudf::type_id id) {
return std::any_of(preflight.begin(), preflight.end(), [id](auto const& col) {
return col.type().id() == id;
});
};
if constexpr (output_dict_columns) {
CUDF_EXPECTS(has_type(cudf::type_id::DICTIONARY32),
"output_dict_columns=YES must produce a DICTIONARY32 column");
} else {
CUDF_EXPECTS(has_type(cudf::type_id::STRING),
"output_dict_columns=NO must produce a STRING column");
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need this check. Other options don't check if they are applied correctly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the latest commit.

Apologies for the force push. As you can see from the coderabbit comments below - I messed up a rebase/pull on main. The state was really messed up, and I thought the best option was to reset to a clean state.

My bad. Won't happen again.

@y2kiran
y2kiran requested review from a team as code owners August 14, 2026 19:48
@github-actions github-actions Bot added Python Affects Python cuDF API. cudf-polars Issues specific to cudf-polars labels Aug 14, 2026
@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch 2 times, most recently from 9f6186a to 3483447 Compare August 17, 2026 21:07
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch from 3483447 to c610a67 Compare August 17, 2026 21:31
@mhaseeb123

Copy link
Copy Markdown
Contributor

@y2kiran Can you please run this benchmark and post some base numbers as a comment here for posterity

@vyasr
vyasr removed request for a team August 18, 2026 05:54
Comment on lines +222 to +223
// 0 == cuDF default (1,000,000 rows/RG → few, large row groups); 100,000 forces ~10x more,
// smaller row groups, exercising the multi-row-group concatenate path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we explicitly enumerate the row group sizes we want to benchmark rather than relying on defaults that live a long way from here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Added in explicit row group sizes of 1K , 10K , 100K, 1M.

Thanks!

@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch 2 times, most recently from 347a997 to e0b4fa8 Compare August 18, 2026 18:45
@y2kiran

y2kiran commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Here are results of the benchmark on a RTX 6000 Blackwell. As expected, there is a regression when the row groups are small, and the number of row groups is very large. But it will be fixed in a follow up MR. @mhaseeb123

column_selection row_selection str_to_categories uses_pandas_metadata output_dict_columns timestamp_type row_group_size_bytes row_group_size_rows Samples CPU Time Noise GPU Time Noise bytes_per_second peak_memory_usage encoded_file_size
ALL ALL NO NO YES EMPTY 0 1000000 499x 29.961 ms 1.27% 29.932 ms 1.27% 17936120899 916.439 MiB 105.246 MiB
ALL ALL NO NO YES EMPTY 0 100000 479x 31.235 ms 0.99% 31.206 ms 0.99% 17204085973 919.389 MiB 105.893 MiB
ALL ALL NO NO YES EMPTY 0 10000 426x 35.129 ms 1.65% 35.083 ms 1.66% 15302852678 937.291 MiB 113.186 MiB
ALL ALL NO NO NO EMPTY 0 1000000 144x 29.676 ms 1.11% 29.648 ms 1.11% 18108016504 921.984 MiB 105.268 MiB
ALL ALL NO NO NO EMPTY 0 100000 496x 30.166 ms 0.98% 30.139 ms 0.98% 17813362588 923.476 MiB 105.920 MiB
ALL ALL NO NO NO EMPTY 0 10000 485x 30.869 ms 1.53% 30.833 ms 1.53% 17412085964 940.082 MiB 113.185 MiB

@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch 2 times, most recently from b879ed6 to a81cb89 Compare August 20, 2026 16:42
@wence-

wence- commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

/ok to test a81cb89

@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch from a81cb89 to 97d60d0 Compare August 20, 2026 17:57
@y2kiran
y2kiran force-pushed the ykiran-dict-transcode-bench branch from 97d60d0 to 721fac5 Compare August 20, 2026 20:26
@y2kiran

y2kiran commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit afb91f5 into NVIDIA:main Aug 21, 2026
149 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in cuDF Python Aug 21, 2026
@y2kiran
y2kiran deleted the ykiran-dict-transcode-bench branch August 21, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake CMake build issue cudf-polars Issues specific to cudf-polars improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Python Affects Python cuDF API. tests Unit testing for project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants