← Back to Pull requests

[libcu++][fp] nvbench benchmarks for the fpmp pair types and their math library #12784

Closed
unknown closed this pull request without merging on Nov 25, 2026 08:16 UTC
View on GitHub
unknown unknown commented on Nov 24, 2026 02:29 UTC
Author

Adds benchmarks of the cuda/fp component to libcudacxx/benchmarks, with the tooling to run
them on demand and to compare a tree with main.

Benchmarks (libcudacxx/benchmarks/bench/fp/fpmp/, targets libcudacxx.bench.fp.fpmp.<family>.base)

  • One executable per function family: arith, explog, pow, trig, invtrig, hyperbolic, special,

  • rounding; 50 functions over the type axes Type{ct} = {fp32mp2, fp64mp2} and
    Accuracy{ct} = {low, mid, high}, 306 cells.
  • throughput: 2048 x 256 threads, each a chain of 1024 dependent evaluations, reported as

  • evaluations per SM clock per SM (ev/clk/SM). latency: one thread, a chain of 4096
    dependent evaluations, SM clocks per evaluation (clk/ev). Both use the SM clock nvbench
    measured during the samples, so boost and power capping do not bias the figures: the same
    binary gives the same per-clock numbers on an RTX 6000 Ada and an L40S within 0.3 %.
  • ref_throughput / ref_latency time the reference precision (the double expression) the

  • same way, for the Gain columns of the table.
  • Accuracy per cell: the maximum relative error over 2^20 random normalized pairs against a

  • double reference, as u2 (units of 2^-48), Bits, a PASS/WARN/FAIL Check with the thresholds
    of the fpmp accuracy suite, and the worst arguments as C99 hex floats. fp64mp2 is checked
    against double until a binary128 reference exists on the device.
  • The chain feeds both limbs of each result into every operand of the next evaluation; with a

  • loop-invariant operand the compiler hoists work out of the loop (a division by an invariant
    divisor measured as a multiplication by its reciprocal).
  • A __noinline__ function with exactly one evaluation per cell gives the SASS instruction

  • count of the operation, read from the executable by the table script.

    Tooling (libcudacxx/benchmarks/fp/)

  • fp_bench.py: configures the libcudacxx-benchmark preset in its own build tree, builds the

  • selected executables, runs them on a chosen GPU, joins the table and compares it with a
    baseline. --compare-ref <git ref> builds and runs the same benchmark sources against the
    library of that ref (a git worktree with the current benchmarks overlaid) and compares cell
    by cell, which answers "did this change make any cell slower or less accurate than main?"
    in one call. A registry keeps it open for further benchmarks of the component.
  • fp_table.py joins the nvbench CSVs with the SASS counts into one row per cell (u2, Bits,

  • Check, ev/clk/SM, Gain tp, clk/ev, Gain lat, SASS, Regs, Worst at).
  • fp_compare.py judges a table against a baseline: accuracy FAIL when u2 grew by more than

  • 1.5x and 0.5 u2, performance FAIL beyond 25 % and WARN beyond 10 %, any SASS change a WARN,
    with a per-cell detail table (compare.csv, compare.md).
  • tests/ (pytest) and a README with the quick start, the regression check and the rules.
  • CI

  • ci/project_files_and_dependencies.yaml ignores libcudacxx/benchmarks/fp/: the scripts are

  • executed by no CI job, so a change to them does not spend the libcudacxx matrix. The
    benchmark sources still mark libcudacxx dirty.
  • This PR adds no CI job. A follow-up PR, prepared on top of this one, hooks the benchmarks

  • into CI: a sass: entry in ci/matrix.yaml builds the fpmp executables on the CPU runners of
    every PR that touches libcu++ and reports SASS changes of the fpmp functions; lit tests
    under libcudacxx/test/libcudacxx/cuda/fp/units/fpmp/ (math_sampling_<family>.pass.cpp) run
    the accuracy sampling on GPU in the regular libcu++ test jobs, so an accuracy regression
    fails CI; and ci/bench.yaml gets an example filter for the on-request timing comparison
    between two refs, which stays on demand as for the other CCCL benchmarks.

    Verified on RTX A6000, RTX 6000 Ada, L40S, B300 and RTX PRO 6000 Blackwell: every Check PASS;
    a family runs in 15 to 90 s, all eight in about 2.5 minutes on an idle GPU.

    Diff: 488 lines (+366 / -122) across 6 files Reviewer: miscco Review duration: 1787m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.47) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 488 lines diff across 6 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    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.370
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #12784"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.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: 47.4% (MEDIUM) · Higher = larger blast radius
    47.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: 56.8% · Lower = rushed or shallow review
    56.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: 20.5% · Safe to merge
    20.5%
    Repository