← Back to Pull requests

fix(hipcub): restore deprecated thread operators and iterators for backward compatibility #16222

Closed
unknown closed this pull request without merging on Nov 19, 2026 15:19 UTC
View on GitHub
unknown unknown commented on Nov 18, 2026 13:19 UTC
Author

Motivation

hipCUB 3.1 removed some thread operators and iterator classes. Downstream code still uses them. E.g. TensorFlow will fail to build without these. This PR brings them back as deprecated wrappers.

Technical Details

Thread operators (Max, Min, Sum, Difference, Division, Equality, Inequality, InequalityWrapper) are restored in the rocPRIM backend. Each one now derives from the matching libhipcxx functor, such as hip::maximum or hip::std::plus. InequalityWrapper stores a caller functor, so it stays hand-written.

The iterators (hipcub::ConstantInputIterator, hipcub::CountingInputIterator, hipcub::TransformInputIterator, hipcub::DiscardOutputIterator) are restored for the rocPRIM backend. They are the original removed files, plus deprecation messages that point to hip::constant_iterator and friends from libhipcxx. The CUB backend does not provide them, because CUB removed them in CCCL 3.0. There, an include gives a compile error that explains the migration path.

Everything is gated behind HIPCUB_USE_LEGACY_API. It is on by default. End users can define it as 0 to remove the legacy API. This follows the same pattern as #15388 (0de212e30ac8).

A new test hipcub.LegacyApi covers both groups.

Test Plan

CI should pass with newly added test. The legacy API was also built locally with -DHIPCUB_USE_LEGACY_API=0 to check that all legacy symbols vanish.

Test Result

Local tests build and uses the legacy API produces deprecation warnings. With HIPCUB_USE_LEGACY_API=0, all legacy names are gone and hipCUB headers still compile.

Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.
  • Diff: 219 lines (+164 / -55) across 2 files Reviewer: umfranzw Review duration: 1560m
    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 · 219 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.323
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16222"
    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.7% (MEDIUM) · Higher = larger blast radius
    36.7%
    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%