Add cudf::partition benchmarks #25352
<!-- coderabbit-ai-generated:v1 -->
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
<a href="https://app.coderabbit.ai/change-stack/NVIDIA/cudf/pull/25352?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>
<!-- review_stack_entry_end -->
<!-- recent_review_status_start -->
No actionable comments were generated in the recent review.
<!-- recent_review_status_end -->
<!-- walkthrough_start -->
<details>
<summary><strong>Summary</strong></summary>
<dl>
<dd>
<br>
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Chores
Expanded performance benchmark coverage for table partitioning across configurable input sizes, partition counts, and table layouts.
Added benchmarks for string columns with varying row counts, column counts, string lengths, and null percentages.
Added scenarios with concentrated or varied partition assignments, and measurements of input size and peak memory usage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
The change adds benchmarks that partition generated input tables with generated maps. The benchmarks cover fixed-width, string, and nullable mixed layouts. They record row count, input size, timing, and peak memory.
Changes: Partition Map Benchmarks
|Layer / File(s)|Summary|
|:---|:---|
|Map partition benchmark flow <br> cpp/benchmarks/hashing/partition.cpp|Adds map generation for fixed-width, string, and nullable mixed layouts. The runner checks map bounds, times cudf::partition, and records row count, input size, and peak memory.|
|String benchmarks and registrations <br> cpp/benchmarks/hashing/partition.cpp|Adds string-table benchmarks with configurable column counts, lengths, and null percentages. Registers string and map benchmarks with their parameter axes.|
<!-- change_assessment_start -->
Estimated code review effort: 2 (Simple) | ~12 minutes
<!-- change_assessment_commit:"167143b0efb39fe870eec64bd7501bfbe92eb272" -->
<!-- change_assessment_priority:{"version":1,"urgency":"p3","manual":false} -->
Change: Other
<!-- change_assessment_end -->
Suggested reviewers: vyasr
</dd>
</dl>
</details>
<!-- walkthrough_end -->
<details>
<summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>16714</code></summary>
<dl>
<dd>
<br>
<!-- final_review_risk_start -->
<!-- final_review_risk_label
Merge Risk: ⚪ Minimal · up to 16714
-->
<!-- final_review_risk_coverage:{"sourceCommitId":"167143b0efb39fe870eec64bd7501bfbe92eb272","coveredCommitId":"167143b0efb39fe870eec64bd7501bfbe92eb272","kind":"reviewed"} -->
This PR adds benchmark-only coverage for cudf::partition and does not change library behavior. The author reports that it built and ran on two GPUs. No merge-blocking risk was identified.
<!-- final_review_risk_end -->
</dd>
</dl>
</details>
<details>
<summary><strong>Architecture risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Medium</strong> · up to <code>16714</code></summary>
<dl>
<dd>
<br>
<!-- architecture_review_start -->
<!-- architecture_review_label
Architecture Summary
Architecture risk: 🟡 Medium · up to 16714
-->
The change affects 1 system.
Changed systems: cpp
Architecture concerns
No architecture-level concerns identified.
<details>
<summary><strong>Review details</strong></summary>
<dl>
<dd>
<br>
Systems and components
Before / after behavior
run_map_partition, which checks that the map’s minimum is nonnegative and maximum is below the partition count, then times cudf::partition and records row count, input allocation size, and peak memory usage.bench_partition_map: generates a uniform INT32 map over [0, partitions - 1], or [0, 0] for the hot-partition setting, and constructs one of the listed integer, decimal, string, or nullable mixed layouts. Unknown layouts skip the benchmark.run_map_partition.Reliability and maintainability
</dd>
</dl>
</details>
<!-- architecture_review_end -->
</dd>
</dl>
</details>
<!-- pre_merge_checks_walkthrough_start -->
<details>
<summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary>
<dl>
<dd>
<br>
| Check name | Status | Explanation |
| :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Title check | !Passed | The title "Add cudf::partition benchmarks" matches the main change: the PR adds standalone cudf::partition NVBench coverage in cpp/benchmarks/hashing/partition.cpp. It is short, specific, and states t… |
| 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. |
| Description check | !Passed | The description is specific and related to the changeset. It states that the PR extracts the cudf::partition NVBench coverage into cpp/benchmarks/hashing/partition.cpp. It names the three new benchmar… |
<details>
<summary><strong>Full details: Title check</strong></summary>
<dl>
<dd>
<br>
Explanation
The title "Add cudf::partition benchmarks" matches the main change: the PR adds standalone cudf::partition NVBench coverage in cpp/benchmarks/hashing/partition.cpp. It is short, specific, and states the primary change. The title does not mention the baseline purpose, but it does not need to cover every detail.
</dd>
</dl>
</details>
<details>
<summary><strong>Full details: Description check</strong></summary>
<dl>
<dd>
<br>
Explanation
The description is specific and related to the changeset. It states that the PR extracts the cudf::partition NVBench coverage into cpp/benchmarks/hashing/partition.cpp. It names the three new benchmarks (partition_strings, partition_string_lengths, partition_map) and the HASHING_NVBENCH target. It also gives build and smoke-test validation details. The raw summary and objectives match these points.
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary><strong>Finishing Touches</strong></summary>
<dl>
<dd>
<br>
<details open>
<summary><strong>Generate unit tests (beta)</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- recent_review_start -->
<h6>
<details>
<summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary>
<dl>
<dd>
<br>
<!-- review_info_content -->
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
<dl>
<dd>
<br>
1c0ef5d7-4465-4548-a6e2-646718a31c20</dd>
</dl>
</details>
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
<dl>
<dd>
<br>
Reviewing files that changed from the base of the PR and between 487ce5cba83d4a9f722e30a9843e8cbe97bdb831 and 167143b0efb39fe870eec64bd7501bfbe92eb272.
</dd>
</dl>
</details>
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 1</strong></summary>
<dl>
<dd>
<br>
cpp/benchmarks/hashing/partition.cpp</dd>
</dl>
</details>
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.
</dd>
</dl>
</details>
</h6>
<!-- recent_review_end -->
Why ascii string column?
/ok to test 167143b
/ok to test 167143b
@res-life, there was an error processing your request: E2
See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/
/ok to test 167143b0efb39fe870eec64bd7501bfbe92eb272
/ok to test a7cac7f18e955405aab2aa63dcb53fd1e37d0ea6
@davidwendt could you please help review one more time.
This looks good. The smoketest mentioned in the last bullet runs in CI which has somewhat limited resources. Can you run these benchmarks with the --profile option to get an idea on how long it takes to complete?
@davidwendt Ran the full parameter matrices of all three new benchmarks with --profile --devices 0 -q --rmm_mode cuda on an NVIDIA L4 at a7cac7f18e:
| Benchmark | States | Wall time |
| --- | ---: | ---: |
| partition_strings | 8 | 3.16 s |
| partition_string_lengths | 56 | 4.48 s |
| partition_map | 320 | 14.82 s |
| Total | 384 | 22.47 s |
All commands passed. JSON results confirm one execution per state and zero skipped states. These local wall times include a separate container startup for each group, input generation, GPU execution, and JSON output; compilation is excluded. Runtime on CI hardware may differ.
Added the commands and results to the PR description.
davidwendt
res-life
Context: #25154 and the request to land standalone benchmarks before the optimization stack.
Description
Extract the
cudf::partitionNVBench coverage from #25154 into a standalone benchmark-only PR. This provides a baseline onmainbefore the optimization stack beginning at #25285 merges.partition_strings: vary row count, string column count, and partition count.partition_string_lengths: vary string lengths, null density, column count, and partition count.partition_map: cover fixed-width, STRING, and mixed nullable tables with uniform or hot partition maps.Input generation and partition-map range validation remain outside the timed region; benchmarks record row count, input allocation size, and peak allocation usage. The extraction modifies only
cpp/benchmarks/hashing/partition.cppand reuses the existingHASHING_NVBENCHtarget and data-generation helpers. Its contents match that file at #25154 commitc285951eeddfae0a34379d82f0c40dbbd264e695exactly.Validation:
git diff --check.89-real): built the fullHASHING_NVBENCHtarget with GCC toolset 14 and CUDA 12.9.1; passed 39 GPU smoke states (1partition_strings, 6partition_string_lengths, 32partition_map), with zero skipped states in the JSON results.75-real): built the fullHASHING_NVBENCHtarget with the same toolchain and passed the same 39 GPU smoke states, with zero skipped states in the JSON results.CUDF_KVIKIO_REMOTE_IO=OFFfor generated local inputs. Smoke validation uses NVBench--profilesingle-execution mode; no new performance comparison is claimed.Full
--profileruntimeAt
a7cac7f18e, rebuiltHASHING_NVBENCHand ran the complete parameter matrices of the three new benchmarks on an NVIDIA L4 (89-real), using GCC toolset 14 and CUDA 12.9.1:| Benchmark | States | Wall time |
| --- | ---: | ---: |
|
partition_strings| 8 | 3.16 s ||
partition_string_lengths| 56 | 4.48 s ||
partition_map| 320 | 14.82 s || Total | 384 | 22.47 s |
All three commands exited successfully. The JSON results confirm that all 384 states ran once, with zero skipped states. Each benchmark group ran in a separate container; these local wall times include container startup, input generation, GPU execution, and JSON output, and exclude compilation. This measures the smoke-run cost of the new benchmarks; runtime on CI hardware may differ.
Checklist