← Back to Pull requests

feat(primbench): Adding Function To Get All Bytes Per Second #12119

Closed
unknown closed this pull request without merging on Sep 23, 2026 18:06 UTC
View on GitHub
unknown unknown commented on Sep 15, 2026 17:50 UTC
Author

Motivation


While running kernel tuner for device_segmented_radix_sort I noticed that the generated params were extremely good for longer segment lengths while extremely bad for short ones.

By adding this function in primbench I am hoping that we can improve kernel tuning for the small segment lengths as well.

JIRA ID: AIPRIMS-236 & EXSWSTRHPC-322

Note: See #11678 to see how the new function is used.

Technical Details


The current way Kernel Tuner (generate.py) choose a config is by taking the min time returned by a .cpp.jinja2 file across the different params. Currently it is just based solely on m_last_bytes_per_second. However in the case of something like device_segmented_radix_sort, m_last_bytes_per_second is the total time taken across all segment counts and segment lengths (see segmented_radix_sort constructor and segmented_radix_sort run). This means that the m_last_bytes_per_second is heavily weighted towards the bigger segments. The result is that the tuned params are very good for larger segments while it performs poorly for the smaller segments.

By implementing get_all_bytes_per_second in primbench this gives us the chance to take each individual time and calculate the geometric mean of the segments, and hopefully get a config that does not hurt the smaller segments.

Test Plan

Generate new tune params and compare the results of just using m_last_bytes_per_second and using get_all_bytes_per_second. If get_all_bytes_per_second does better than I will open this PR.

Test Result

Pending results.

Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Diff: 273 lines (+204 / -69) across 3 files Reviewer: Naraenda Review duration: 11536m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 273 lines diff across 3 files
    0.40
    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.336
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #12119"
    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: 39.5% (MEDIUM) · Higher = larger blast radius
    39.5%
    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: 15.6% · Safe to merge
    15.6%