← Back to Pull requests

refactor(primbench): shared benchmark types #9093

Closed
unknown closed this pull request without merging on Oct 10, 2026 00:55 UTC
View on GitHub
unknown unknown commented on Jul 06, 2026 08:56 UTC
Author

Motivation

Right now every benchmark queues specializations based on a hardcoded list of types and values.
This is the reason why a lot of rocPRIM's benchmarks aren't benchmarking as many types as they are supposed to, including custom types.

Technical Details

Provides constexpr static void queue_type(primbench::executor& executor, Functor&& f) which can be used to easily reuse and combine preset type categories.
For example:

benchmark_types::queue_type<(benchmark_types::Type_Category::integer_signed
                                 | benchmark_types::Type_Category::integer_128
                                 | benchmark_types::Type_Category::type_custom_i64_i64)>(
        executor,
        [&](auto type_tag)
        {
            using T = typename decltype(type_tag)::type;
            CREATE_TYPED_BENCHMARK(T)
        });

Calls CREATE_TYPED_BENCHMARK with all signed integer types, 128-bit integer types, and type_custom_i64_i64.
This noticeably reduces repetition, and allows for easier addition of additional types. For example, in the future, this could be switched to Type_Category::arithmetic, which would benchmark all floating-point and integer types with very little effort.

A few benchmarks were left unchanged as these either:

  • Are made up of a complex set of key/value pairs

  • Differentiate between tuned and non tuned types.
  • Test Plan

    Build and run all benchmarks with --dry. Compare what benchmarks were runs.

    Test Result

    The set of run benchmarks are identical.

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
  • Diff: 215 lines (+161 / -54) across 2 files Reviewer: Naraenda Review duration: 137759m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 215 lines diff across 2 files
    0.37
    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%
    60%
    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.322
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #9093"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 36.6% (MEDIUM) · Higher = larger blast radius
    36.6%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 14.5% · Safe to merge
    14.5%