← Back to Pull requests

perf(rocprim): reduced branches in device_search and device_find_end (port of #11299 to hipccl3) #13006

Closed
unknown closed this pull request without merging on Nov 29, 2026 00:33 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 22:15 UTC
Author

Port of #11299 (by @DeltaNeverUsed) to the hipccl3 layout, so the change lands in projects/hipccl/hipccl3/ instead of the retired projects/ location. The original PR will be closed once this one is accepted.

Original description

Motivation

The inner loops in device_search used per-iteration branching that causes thread divergence on GPU wavefronts.
Benchmarks also did not cover the best-case scenario.

Technical Details

Part of this PR is refactoring the relevant benchmarks as well as adding the best case scenario to the benchmarks.

  • 021b2c4143f68661fb5e92fc2ae1dfdbdae0b177

  • - Combined the header files for device_search and device_find_end since they were nearly identical
  • dbe9169659c409918513f2972f9aa9c7059a882c

  • - Refactors and adds the best case scenario
  • aa8460851584b1e0288f4d152e67355d942591b3

  • - Is the actual performance improvement

    Test Plan

    All tests still pass

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
  • About this port

  • Commits are the original 5 commits, authors and messages unchanged, paths remapped (projects/rocprim/ -> projects/hipccl/hipccl3/rocprim/). The commit IDs differ from the originals.

  • CHANGELOG deviation: the last commit was edited. Develop's CHANGELOG.md has no x.y.z (unreleased) section, so the entry "Reduced branching in device_search and device_find_end" is placed under the existing Optimizations list of the 4.8.0 section, as agreed. The commit message notes this.

  • Result: 6 files, +112/-222.

  • Not built or tested here. No CI covers projects/hipccl yet, so the checks on this PR do not exercise the change. Please build the affected hipccl3 component and run its relevant tests before merging.
  • 🤖 Generated with Claude Code

    Diff: 237 lines (+177 / -60) across 2 files Reviewer: NguyenNhuDi Review duration: 82218m
    All Vouch review confidence checks passed
    Residual risk 0.15 = 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 · 237 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.327
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #13006"
    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: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    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.7% · Safe to merge
    14.7%