Skip to content

Use nvbench_compare_robust in benchmark workflow - #10636

Open
oleksandr-pavlyk wants to merge 15 commits into
NVIDIA:mainfrom
oleksandr-pavlyk:benchmark-workflow-to-use-nvbench-compare-robust
Open

Use nvbench_compare_robust in benchmark workflow#10636
oleksandr-pavlyk wants to merge 15 commits into
NVIDIA:mainfrom
oleksandr-pavlyk:benchmark-workflow-to-use-nvbench-compare-robust

Conversation

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

Description

This PR switch bench.yaml workflow to save benchmark data with binary sidecars storing bulk data for durations and frequencies.

Use of nvbench-compare script is replaced with use of nvbench-compare-robust which takes bulk data into account.
The new script introduces AMBG (ambiguous/undecided) classification, designated for comparisons where making determination between FAST/SLOW/SAME is difficult.

Closes #10635

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Aug 4, 2026
This change makes sure that the same version of NVBench is used when
building reference and compare benchmarks (previously, pinned SHAs
from respective branches were used and those could be difference).

The default is to use top-of-tree NVBench, but this can be controlled
via script arguments.
@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the benchmark-workflow-to-use-nvbench-compare-robust branch from c293017 to 346e96c Compare August 4, 2026 20:06
@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

/ok to test 346e96c

@jrhemstad
jrhemstad marked this pull request as ready for review August 4, 2026 21:10
@jrhemstad
jrhemstad requested review from a team as code owners August 4, 2026 21:10
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Aug 4, 2026
@jrhemstad

Copy link
Copy Markdown
Collaborator

/ok to test 346e96c

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

Summary by CodeRabbit

  • Benchmarking

    • Updated benchmark comparisons with robust NVBench reporting, including interval, simple, and explanatory reports.
    • Benchmark outputs now include binary sidecar files.
    • CUB benchmark builds can target a specified NVBench revision.
    • Added configurable cold-start warmup iterations and execution limits.
    • Improved benchmark setup, dependency handling, and credential isolation.
  • Documentation

    • Clarified benchmark setup, comparison requirements, credential handling, failure cases, and generated artifacts.

Walkthrough

Changes

NVBench benchmark integration

Layer / File(s) Summary
Comparison environment and workflow wiring
.github/workflows/bench.yml
The workflow resolves the NVBench revision, prepares a temporary comparison environment, passes comparison settings into the container, and restores AWS configuration during cleanup.
Robust comparison and benchmark execution
ci/bench/compare_paths.sh
Benchmark scripts use nvbench-compare-robust, configurable Python and comparison executables, binary JSON output, selected NVBench revisions, multiple report formats, and optional credential removal.
NVBench revision, warmup settings, and documentation
cmake/CCCLGetDependencies.cmake, ci/bench.template.yaml, ci/bench.yaml, ci/bench/README.md
The default NVBench revision and cold warmup arguments changed. Documentation describes comparison dependencies, binary sidecars, revision propagation, reports, and AWS credential handling.

Assessment against linked issues

Objective Addressed Explanation
Use the new NVBench comparison script in the CCCL benchmark workflow [#10635]

Suggested reviewers: griwes, jrhemstad, gonidelis


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

coderabbitai[bot]

This comment was marked as resolved.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

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

cmake LGTM

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

I triggered the benchmark compare workflow manually: https://github.com/NVIDIA/cccl/actions/runs/30951999074

Resolve NVBench main once before benchmark builds and pass the pinned SHA
through to both CUB build trees. Install cuda-bench compare dependencies in a
pre-AWS benchmark venv, use that venv for compare execution, and remove GH_TOKEN
from the benchmark container.

Also add an opt-in credential drop in compare_paths.sh so the workflow can clear
AWS/sccache credential state after CUB builds and before benchmark execution,
comparison, and Python benchmark environment setup.
@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 036b298e-399e-4ec6-b277-c3a90da04c8b

📥 Commits

Reviewing files that changed from the base of the PR and between ff89306 and 2ce37e4.

📒 Files selected for processing (4)
  • .github/workflows/bench.yml
  • ci/bench/README.md
  • ci/bench/compare_paths.sh
  • cmake/CCCLGetDependencies.cmake

Comment thread .github/workflows/bench.yml Outdated
…port

Output default `--display intervals` and, additionally, `--display simple`,
`--display explain` and legacy report.

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
ci/bench/compare_paths.sh (3)

443-446: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

suggestion: the env-var branch skips the -x check that both fallbacks apply. The workflow always exports CCCL_BENCH_LEGACY_COMPARE_BIN=/bench-compare-venv/bin/nvbench-compare-legacy (.github/workflows/bench.yml:373-393). If that entry point is missing in the installed cuda-bench[compare] version, every target gets a rc=127 legacy report block in the summary instead of the legacy section being omitted. Gate it:

-  if [[ -n "${CCCL_BENCH_LEGACY_COMPARE_BIN:-}" ]]; then
-    printf "%s" "${CCCL_BENCH_LEGACY_COMPARE_BIN}"
-    return 0
+  if [[ -n "${CCCL_BENCH_LEGACY_COMPARE_BIN:-}" ]]; then
+    if [[ -x "${CCCL_BENCH_LEGACY_COMPARE_BIN}" ]]; then
+      printf "%s" "${CCCL_BENCH_LEGACY_COMPARE_BIN}"
+      return 0
+    fi
+    echo "CCCL_BENCH_LEGACY_COMPARE_BIN is set but not executable: ${CCCL_BENCH_LEGACY_COMPARE_BIN}" >&2
+    return 1
   fi

710-740: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

suggestion: the display list intervals simple explain is now hardcoded in four places (here, run_python_compare_target line 479, and write_summary lines 881 and 903). Define it once, for example readonly COMPARE_DISPLAYS=(intervals simple explain), and iterate over it. That keeps report generation and summary rendering from drifting apart.


816-818: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

suggestion: use -s instead of -f. A comparison that exits 0 with no stdout leaves a zero-byte report, and the summary then contains an empty collapsible block that still counts toward reports_emitted.

-  if [[ ! -f "${compare_report_file}" ]]; then
+  if [[ ! -s "${compare_report_file}" ]]; then

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 045528b6-525d-4eea-9724-2e6a7705e48d

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce37e4 and 708deaa.

📒 Files selected for processing (5)
  • .github/workflows/bench.yml
  • ci/bench.template.yaml
  • ci/bench.yaml
  • ci/bench/README.md
  • ci/bench/compare_paths.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/bench.yml
  • ci/bench/README.md

Comment thread ci/bench/compare_paths.sh Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…Lo / Ce / Hi]

Use of vertical pipe symbol | messes up markdown rendering
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Require an explicitly configured legacy compare binary to be executable before
using it, so missing optional entry points do not produce rc=127 report blocks.

Centralize the robust compare display list and skip empty compare report files
when rendering the benchmark summary.
@bernhardmgruber

Copy link
Copy Markdown
Contributor

I triggered the benchmark compare workflow manually: https://github.com/NVIDIA/cccl/actions/runs/30951999074

What worries me is that even with the robust comparison script, comparing two git SHAs without benchmark changes results in many AMBG runs. I would have hoped for a clearer message that the performance before and after is the same.

Avoid process substitution in compare runners so report files are fully
written before emptiness checks and summary generation. Route the plain and
PYTHONPATH compare paths through a shared helper to keep capture behavior
consistent.
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

nvbench_compare_args is passed to robust compare script
nvbench_compare_legacy_args is passed to legacy compare script
This helps avoid skipping of tests after multiple warm-up runs are added

"skip_reason": "Warmup time did not meet skip_time limit: 6.048us < 15.000us."
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 18m: Pass: 100%/534 | Total: 5d 09h | Max: 2h 06m | Hits: 100%/640656

See results here.

AI failure analysis

1. Merged RAPIDS environment contains incompatible rapids-logger pins · 1 job

Explanation: The RAPIDS build stops while creating its shared conda environment, before any library is configured or compiled. The generated environment simultaneously requires mutually exclusive `rapids-logger` 0.2 and 0.3 versions.

Evidence:

Build RAPIDS (optional) / rmm ucxx kvikio rapidsmpf cudf cudf_kafka, step 6

2026-08-10T10:40:57.8822790Z - rapids-logger==0.2.*,>=0.0.0a0
2026-08-10T10:40:57.8823031Z - rapids-logger==0.3.*,>=0.0.0a0
2026-08-10T10:41:28.2441566Z error    libmamba Could not solve for environment specs

Root cause: The job clones the selected RAPIDS repositories from their current upstream `main` branches and merges their dependency files; those snapshots are temporarily inconsistent about the required `rapids-logger` minor version. The log does not preserve dependency provenance, so it does not identify which cloned repository contributes each constraint; the PR changes only benchmark infrastructure and do not modify this RAPIDS setup. Sources: .github/workflows/build-rapids.yml:96, ci/rapids/post-create-command.sh:141.

Suggested next steps: Reproduce only environment generation with `RAPIDS_LIBS='rmm ucxx kvikio rapidsmpf cudf cudf_kafka' .devcontainer/launch.sh -d -c 13.3 -H rapids-conda -- ./ci/rapids/rapids-entrypoint.sh`, then inspect each generated repository conda YAML to identify both pins. Pin the out-of-sync repository to a compatible branch/commit through its `RAPIDS_<repo>_GIT_REPO` workflow variable, or update the upstream dependency pin so every selected repository uses the same `rapids-logger` series.

Copy this prompt into a coding agent
Repository: https://github.com/NVIDIA/cccl
Workflow run: https://github.com/NVIDIA/cccl/actions/runs/31379817713
Failure group: Merged RAPIDS environment contains incompatible rapids-logger pins
Affected jobs:
- Build RAPIDS (optional) / rmm ucxx kvikio rapidsmpf cudf cudf_kafka: https://github.com/NVIDIA/cccl/actions/runs/31379817713/job/93427436150

Narrowly reproduce the RAPIDS conda-environment generation failure for `RAPIDS_LIBS='rmm ucxx kvikio rapidsmpf cudf cudf_kafka'` under the CUDA 13.3 `rapids-conda` devcontainer. Determine which cloned repository dependency files contribute `rapids-logger==0.2.*` and `rapids-logger==0.3.*`; verify whether this is a transient mismatch among upstream `main` branches. Implement the smallest durable fix, preferably pinning the out-of-sync repository via the appropriate `RAPIDS_<repo>_GIT_REPO` setting in `.github/workflows/build-rapids.yml` or correcting local manifest generation if it incorrectly combines dependency sets. Do not alter the benchmark changes from this PR. Run focused validation that regenerates and solves the merged RAPIDS environment, then confirm the configure phase begins without the logger conflict.

Jobs:

@jrhemstad
jrhemstad requested a review from gevtushenko August 11, 2026 15:43
@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

I triggered the benchmark compare workflow manually: https://github.com/NVIDIA/cccl/actions/runs/30951999074

Several issues with that run:

  • Only one output table of new comparison script is displayed (default --display intervals)
  • Run was triggered with no additional NVBench-instrumented benchmark arguments (hence no warm-ups, use of default stdrel- stopping criterion, etc)

Since then the generated summary was changed:

  • Include comparison tables rendered using all display modes ('intervals', 'simple', and 'explain')
  • Include comparison table using legacy comparison script
  • Prominently include nvbench_args argument used to execute NVBench-instrumented benchmarks

Please see: https://github.com/NVIDIA/cccl/actions/runs/31379861590

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

As noted by @bernhardmgruber there are plenty of undecided comparison, so I looked into some of those.

  1. Download the artifact from https://github.com/NVIDIA/cccl/actions/runs/31379861590
  2. Unzip it: unzip bench-rtxa6000-20260810T105401Z-1649d886-6013fbe3.zip
  3. Step into artifact folder: cd bench-rtxa6000-6013fbe35108-20260810T105409Z-origin_main
  4. Generate loader file: nvbench-compare-robust base/cub.bench.reduce.min.base.json test/cub.bench.reduce.min.base.json -a "T{ct}=I8" -a "OffsetT{ct}=I32" --bulk-debug-python loader.py
  5. Download visualization script make_plot.py from https://gist.github.com/oleksandr-pavlyk/6cf4be493405212e5254e5b03e25afdd
  6. Plotting utility assume loader.py has been pre-generated. Execute python make_plot.py --row 0 to generate visualization for row 0, etc.

Here are visualization for cub.bench.reduce.min.base benchmark for T{ct}=I8 OffsetT{ct}=I32:

reduce_min_T_I8_Offset_I32_Elems_pow2_16 reduce_min_T_I8_Offset_I32_Elems_pow2_20
reduce_min_T_I8_Offset_I32_Elems_pow2_24 reduce_min_T_I8_Offset_I32_Elems_pow2_28

@oleksandr-pavlyk

oleksandr-pavlyk commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@bernhardmgruber @gevtushenko believes that for the 4 rows visualized above the decisions should have been FAST, FAST, FAST, SAME because the distribution in 3 cases looks same shape but shifted to the left.

This will need to be addressed in a follow-up work though as this PR gets in a metric (# of AMBG) we want to optimize.

Script may be available and set, but its runtime dependencies
are not guaranteed to be installed even if the script itself
is available
This change is to be opened as a stand-alone PR
@github-actions

Copy link
Copy Markdown
Contributor

⏱️ CCCL compile-time benchmark comparison: Public headers compile-time bench

Result: 1 regression row(s), 6 improvement row(s) above threshold.

Run Value
Config public-headers-gcc13
Baseline origin/main
Preset all-dev
Targets cub.headers.base, thrust.cpp.cuda.headers.base, libcudacxx.test.public_headers
GPU / launch args rtx2080 / --cuda 13.3 --host gcc13

Artifacts: reports and traces

Direct file processing

-f file-processing exclusive --sort total

🔴 Direct file processing — Regressions
Rank Regression impact Selected Δ Baseline Current Event Matched traces
1 1.054646 1.054646 0.165203 1.219849 Processing Header File: cub/cub/device/dispatch/tuning/common.cuh 131
🟢 Direct file processing — Improvements
Rank Improvement impact Selected Δ Baseline Current Event Matched traces
1 1.229218 -1.229218 5.405328 4.176110 Processing Header File: libcudacxx/include/cuda/std/__cccl/prologue.h 550
2 0.311393 -0.311393 0.560760 0.249367 Processing Header File: cub/cub/device/dispatch/dispatch_batched_topk.cuh 3
3 0.301152 -0.301152 0.922288 0.621136 Processing Header File: libcudacxx/include/cuda/std/__functional/operations.h 279
4 0.291371 -0.291371 5.358672 5.067301 Processing Header File: libcudacxx/include/cuda/std/__iterator/concepts.h 437
5 0.221771 -0.221771 1.675093 1.453322 Processing Header File: libcudacxx/include/cuda/std/__cccl/epilogue.h 550
6 0.202509 -0.202509 0.705426 0.502917 Processing Header File: libcudacxx/include/cuda/__ptx/ptx_dot_variants.h 419

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Use new nvbench compare in CCCL benchmark workflow

4 participants