← Back to Pull requests

Add cudf::partition benchmarks #25352

Open
res-life opened this pull request with 136 lines diff across 1 files
View on GitHub
res-life res-life commented on Nov 17, 2026 01:47 UTC
Author

Context: #25154 and the request to land standalone benchmarks before the optimization stack.

Description

Extract the cudf::partition NVBench coverage from #25154 into a standalone benchmark-only PR. This provides a baseline on main before 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.cpp and reuses the existing HASHING_NVBENCH target and data-generation helpers. Its contents match that file at #25154 commit c285951eeddfae0a34379d82f0c40dbbd264e695 exactly.

    Validation:

  • Passed all applicable pre-commit hooks and git diff --check.

  • NVIDIA L4 (89-real): built the full HASHING_NVBENCH target with GCC toolset 14 and CUDA 12.9.1; passed 39 GPU smoke states (1 partition_strings, 6 partition_string_lengths, 32 partition_map), with zero skipped states in the JSON results.

  • Quadro RTX 8000 (75-real): built the full HASHING_NVBENCH target with the same toolchain and passed the same 39 GPU smoke states, with zero skipped states in the JSON results.

  • Builds use CUDF_KVIKIO_REMOTE_IO=OFF for generated local inputs. Smoke validation uses NVBench --profile single-execution mode; no new performance comparison is claimed.
  • Full --profile runtime

    At a7cac7f18e, rebuilt HASHING_NVBENCH and 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:

    HASHING_NVBENCH --profile --devices 0 -q --rmm_mode cuda --benchmark partition_strings --json partition_strings.json
    HASHING_NVBENCH --profile --devices 0 -q --rmm_mode cuda --benchmark partition_string_lengths --json partition_string_lengths.json
    HASHING_NVBENCH --profile --devices 0 -q --rmm_mode cuda --benchmark partition_map --json partition_map.json
    

    | 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


  • I am familiar with the Contributing Guidelines.

  • New or existing tests cover these changes.

  • The documentation is up to date with these changes.
  • Diff: 136 lines (+136 / -0) across 1 files Reviewer: davidwendt Review duration: 28056m
    All Vouch review confidence checks passed
    Residual risk 0.04 = Change Risk (0.32) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.32 · 136 lines diff across 1 files
    0.32
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.93 · 5 substantive comment(s)
    0.93
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    86%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.294
    Real PR Conversation Timeline
    11 items
    copy-pr-bot[bot] copy-pr-bot[bot] commented on Nov 17, 2026 01:47 UTC
    Bot

    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.

    coderabbitai[bot] coderabbitai[bot] commented on Nov 17, 2026 11:01 UTC
    Bot

    <!-- 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&amp;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

  • _observed_ — cpp (service) was modified; 1 changed file maps to changed impact.
  • Before / after behavior

  • _observed_ — Modified behavior in cpp/benchmarks/hashing/partition.cpp: Adds the cudf reduction header required by the new map-partition benchmark’s minimum/maximum validation.

  • _observed_ — Modified behavior in cpp/benchmarks/hashing/partition.cpp: Adds 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.

  • _observed_ — Modified behavior in cpp/benchmarks/hashing/partition.cpp: Adds 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.

  • _observed_ — Modified behavior in cpp/benchmarks/hashing/partition.cpp: Adds string-table partitioning with an independently generated uniform partition map and the configured number of string columns. String values use the supplied length range and null probability; the resulting table is passed to run_map_partition.
  • Reliability and maintainability

  • _inferred_ — Risk-relevant change factors for cpp: blast_radius_1; direct_dependents_1
  • </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>

  • <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create a new PR
  • </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- finishing_touch_checkbox_end -->

    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- 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>

  • Source mode: Auto

  • Repository: [NVIDIA/cudf](<https://github.com/NVIDIA/cudf>)

  • Branch: [main](<https://github.com/NVIDIA/cudf/tree/main>)

  • File: [.coderabbit.yaml](<https://github.com/NVIDIA/cudf/blob/37e9bb08c1744683e2f7eb4ca860c5d65ae73202/.coderabbit.yaml>)

  • Commit: [37e9bb0](<https://github.com/NVIDIA/cudf/commit/37e9bb08c1744683e2f7eb4ca860c5d65ae73202>)

  • Layers: Repository YAML

  • Review profile: CHILL

  • Plan: Enterprise

  • Run ID: 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 -->

    davidwendt davidwendt commented on code on Nov 17, 2026 15:33 UTC
    Code Review
    cpp/benchmarks/hashing/partition.cpp:1
    @@ -402,8 +403,142 @@ void bench_hash_partition_all_keys_stress(nvbench::state& state)
       run_hash_partition(state, *input, num_columns, num_partitions);
     }
     
    +// Keep map generation outside the timed region and record output plus temporary allocation peaks.
    +void run_map_partition(nvbench::state& state,
    +                       cudf::table const& input,
    +                       cudf::column_view map,
    +                       cudf::size_type partitions)
    +{
    +  // Invalid partition ids have undefined behavior; check generated INT32 maps before timing.
    +  {
    +    auto const [minimum, maximum] = cudf::minmax(map);
    +    CUDF_EXPECTS(
    +      static_cast<cudf::numeric_scalar<cudf::size_type> const&>(*minimum).value() >= 0 &&
    +        static_cast<cudf::numeric_scalar<cudf::size_type> const&>(*maximum).value() < partitions,
    +      "Generated partition map is out of range");
    +  }
    +  state.set_cuda_stream(nvbench::make_cuda_stream_view(cudf::get_default_stream().get()));
    +  state.add_element_count(input.num_rows(), "rows");
    +  state.add_buffer_size(input.alloc_size(), "input_size", "input_size");
    +  auto const mem_stats_logger = cudf::memory_stats_logger();
    +  state.exec(nvbench::exec_tag::sync, [&](nvbench::launch&) {
    +    [[maybe_unused]] auto output = cudf::partition(input.view(), map, partitions);
    +  });
    +  state.add_buffer_size(
    +    mem_stats_logger.peak_memory_usage(), "peak_memory_usage", "peak_memory_usage");
    +}
    +
    +// Measure partition-map materialization separately from hash computation.
    +void bench_partition_map(nvbench::state& state)
    +{
    +  auto const rows       = get_size_type_axis(state, "num_rows");
    +  auto const partitions = get_size_type_axis(state, "num_partitions");
    +  auto const hot        = state.get_int64("hot_partition") != 0;
    +  data_profile const profile =
    +    data_profile_builder()
    +      .distribution(cudf::type_id::INT32, distribution_id::UNIFORM, 0, hot ? 0 : partitions - 1)
    +      .cardinality(0)
    +      .avg_run_length(1)
    +      .no_validity();
    +  auto map          = create_random_column(cudf::type_id::INT32, row_count{rows}, profile);
    +  auto const layout = state.get_string("layout");
    +  std::unique_ptr<cudf::table> input;
    +  if (layout == "int8") {
    +    input = make_input_table(std::array{cudf::type_id::INT8}, {}, rows);
    +  } else if (layout == "int8x2") {
    +    input = make_input_table(std::array{cudf::type_id::INT8, cudf::type_id::INT8}, {}, rows);
    +  } else if (layout == "int16") {
    +    input = make_input_table(std::array{cudf::type_id::INT16}, {}, rows);
    +  } else if (layout == "int32") {
    +    input = make_input_table(std::array{cudf::type_id::INT32}, {}, rows);
    +  } else if (layout == "int64") {
    +    input = make_input_table(std::array{cudf::type_id::INT64}, {}, rows);
    +  } else if (layout == "decimal128") {
    +    input = make_input_table(std::array{cudf::type_id::DECIMAL128}, {}, rows);
    +  } else if (layout == "strings10") {
    +    input = make_input_table({}, std::vector<cudf::type_id>(10, cudf::type_id::STRING), rows);
    +  } else if (layout == "mixed_nullable") {
    +    input = make_input_table(std::array{cudf::type_id::INT64},
    +                             std::array{cudf::type_id::STRING, cudf::type_id::INT32},
    +                             rows,
    +                             0.1,
    +                             0.1);
    +  } else {
    +    state.skip("Unknown partition layout: " + layout);
    +    return;
    +  }
    +  run_map_partition(state, *input, map->view(), partitions);
    +}
    +
    +// Vary byte lengths independently from the 10-column scaling workload.
    +void run_string_partition(nvbench::state& state,
    +                          cudf::size_type rows,
    +                          cudf::size_type min_length,
    +                          cudf::size_type max_length,
    +                          std::optional<double> null_probability)
    +{
    +  auto const partitions  = get_size_type_axis(state, "num_partitions");
    +  auto const num_columns = get_size_type_axis(state, "num_columns");
    +  data_profile const map_profile =
    +    data_profile_builder()
    +      .distribution(cudf::type_id::INT32, distribution_id::UNIFORM, 0, partitions - 1)
    +      .cardinality(0)
    +      .avg_run_length(1)
    +      .no_validity();
    +  data_profile const string_profile =
    +    data_profile_builder()
    +      .distribution(cudf::type_id::STRING, distribution_id::UNIFORM, min_length, max_length)
    +      .cardinality(0)
    +      .avg_run_length(1)
    +      .null_probability(null_probability);
    +  auto map = create_random_column(cudf::type_id::INT32, row_count{rows}, map_profile);
    +  std::vector<std::unique_ptr<cudf::column>> columns;
    +  for (cudf::size_type seed = 0; seed < num_columns; ++seed) {
    +    columns.push_back(create_ascii_string_column(string_profile, rows, seed));

    Why ascii string column?

    res-life res-life commented on Nov 18, 2026 10:35 UTC
    Author

    /ok to test 167143b

    copy-pr-bot[bot] copy-pr-bot[bot] commented on Nov 18, 2026 10:35 UTC
    Bot

    /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/

    davidwendt davidwendt commented on Nov 19, 2026 18:38 UTC
    Contributor

    /ok to test 167143b0efb39fe870eec64bd7501bfbe92eb272

    res-life res-life commented on Nov 20, 2026 09:20 UTC
    Author

    /ok to test a7cac7f18e955405aab2aa63dcb53fd1e37d0ea6

    res-life res-life commented on Nov 25, 2026 00:41 UTC
    Author

    @davidwendt could you please help review one more time.

    davidwendt davidwendt commented on Nov 25, 2026 15:34 UTC
    Contributor

    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?

    res-life res-life commented on Nov 27, 2026 07:22 UTC
    Author

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

    Reviewers
    Assignees
    res-life res-life
    Labels
    risk: low confidence: 86.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 32.4% (LOW) · Higher = larger blast radius
    32.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 86.8% · Lower = rushed or shallow review
    86.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.3% · Safe to merge
    4.3%
    Repository